views:

41

answers:

2

Hi ,

I am very much new to maven. I downloaded the maven 2.0.11 version and installed it on my 32bit redhat linux along with JDK 1.4

After installation I have configured the proxy settings. When I try to run command mvn install downlaod of some repository(org) is successful but then it fails with build error as below :

[INFO] ------------------------------------------------------------------------   
[ERROR] BUILD ERROR   
[INFO] ------------------------------------------------------------------------   
[INFO] Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.   
[INFO] ------------------------------------------------------------------------   
[INFO] For more information, run Maven with the -e switch   
[INFO] ------------------------------------------------------------------------   
[INFO] Total time: 16 second

What does this error mean ? and what configuration I am missing ?
How can I downlaod the complete repository ?

Thanks,

+1  A: 

Your Maven installation seems correct. However, to be run, the Maven command must be run in the directory where the pom.xml file is located. It seems that you don't have any pom.xml in the current directory.

The pom.xml file describes your project, and it is the basis of Maven 2. Read the official documentation to get more information about this file.

Note that Maven also provides the Archetype plugin, which can be used to create a brand new project of a specific type (Java project, Web application, Hibernate, Spring, and so on). The archetype will create the default structure and some files (including the pom.xml) for this type of project. This plugin is the only case of Maven usage without a pom.xml file.

romaintaz
I am trying to build imperius sources :http://incubator.apache.org/imperius/community/contribute.html . I am simply following the step : "simply download the build file(build.xml) to a directory where you'd like to create the Imperius distribution and run ant from that directory. The build will use the Subversion client to pull down the latest files from the Imperius repository" During the build maven execution is failing .. There is no mention of pom.xml ??? How to resolve this ?
hits_lucky
@hits_lucky Did you run the Maven command in the directory that contains the pom.xml?
romaintaz
It seems that this project is using Ant and not Maven...
romaintaz
Inside the ant build file they are calling maven commands. This is the ant build file : http://svn.apache.org/viewvc/incubator/imperius/trunk/build.xml?view=co
hits_lucky
+2  A: 

This error usually means there is no pom.xml in the current directory where you're trying to build.

The ant build.xml has references to a few pom files:

<xmlproperty file="${IMPERIUS_SVN_MODULES}/pom.xml"/>
<property name="POM_XML_FILE" value="${basedir}/pom.xml"/>
<property name="POM_XML_URL" value="${IMPERIUS_SVN_TRUNK_REPOSITORY}/pom.xml?view=co"/>
<get src="${POM_XML_URL}" dest="${POM_XML_FILE}"/>

Can you check that these are being pulled down when you run ant? If not, try downloading the pom manually from here and save it in the same directory as build.xml. Then try running ant again.

dogbane
??? How is this relevant? How does the question have anything to do with ant ???? Maybe you should write a sentence about why you give an ant answer to a maven question ??? Yes, I know, I read the comments to the other answer, but if you just read the question and the answer it makes no sense at all.
seanizer