Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven build error

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,

like image 298
hits_lucky Avatar asked Sep 26 '10 09:09

hits_lucky


2 Answers

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.

like image 89
dogbane Avatar answered Sep 19 '22 02:09

dogbane


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.

like image 45
Romain Linsolas Avatar answered Sep 23 '22 02:09

Romain Linsolas