Maven build error

I am very new to maven. I downloaded maven 2.0.11 and installed it on my 32-bit Redhat Linux along with JDK 1.4

After installation, I configured the proxy server settings. When I try to run the mvn install downlaod command of some repository (org) successfully, but then it fails with a build error, as shown 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 am i missing?
How can I disable the full repository?

Thanks,

+6
java linux maven-2
source share
4 answers

This error usually means that in the current directory there is no pom.xml you are trying to build.

ant build.xml has links to several 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 verify that they are reset when you run ant ? If not, try downloading pom manually from here and save it in the same directory as build.xml . Then try ant again.

+9
source share

Your Maven installation seems correct. However, to run the Maven command, it must be run in the directory where the pom.xml file is pom.xml . It seems that in the current directory you do not have pom.xml .

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

Please note that Maven also provides an Archetype plugin that can be used to create a completely new project of a certain type (Java project, Web application, Hibernate, Spring, etc.). The archetype will create a default structure and some files (including pom.xml ) for this type of project. This plugin is the only use case for Maven without the pom.xml file.

+2
source share

I had this problem today. In the configurations for Maven Build, I changed the base directory: from, for example,

C: / local / project / MyProject

which was installed using Browse File System ... on

$ {workspace_loc: / MyProject}

installed in the Browse ... workspace and was able to create a project.

0
source share

it seems that you are not in the same directory as in pom.xml. The Maven project first looks for pom.xml to create the project. Please make sure that you are building the project from the directory where pom.xml is located, and also be careful that pom.xml follows the correct hierarchy, otherwise it will not load any basic project structure or create it in the internal folder.

0
source share

All Articles