Attempted to compile mahout but get error - unable to execute mojo: resources. Build doesn't use pom.xml

I followed these steps:

  • Installed Java 1.6
  • I am using Ubuntu 11.10. Added $ JAVA_HOME path to / etc / bash.bachrc
  • Installed maven. mvn --version

    shows maven installed correctly.
  • Downloaded Mahout from http://svn.apache.org/repos/asf/mahout/trunk

Now I go to mahout / trunk and try to do mvn clean install

or mvn clean install -X -e

, then it gives the following error -

Unable to execute mojo: resources. This requires a project with an existing pom.xml, but the assembly doesn't use it.

I just want to try the examples in mahout / examples. How do I fix this error?

The directory has pom.xml.

The complete terminal output is here:

+ Error stacktraces are turned on.
Apache Maven 2.2.1 (rdebian-6)
Java version: 1.6.0_23
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_IN, platform encoding: UTF-8
OS name: "linux" version: "3.0.0-16-generic" arch: "i386" Family: "unix"
[DEBUG] Building Maven user-level plugin registry from: '/home/kartikeya/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from: '/usr/share/maven2/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[DEBUG] Wagons could not be registered as the extension container was never created
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins:pom:12 for project: null:maven-clean-plugin:maven-plugin:2.3 from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent:pom:9 for project: org.apache.maven.plugins:maven-plugins:pom:12 from the repository.
[DEBUG] Retrieving parent-POM: org.apache:apache:pom:4 for project: org.apache.maven:maven-parent:pom:9 from the repository.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot execute mojo: clean. It requires a project with an existing pom.xml, but the build is not using one.
    at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:414)
    at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
    ... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Wed Mar 21 11:32:36 IST 2012
[INFO] Final Memory: 2M/55M
[INFO] ------------------------------------------------------------------------

      

+3


source to share


2 answers


Thanks ajozwik and Owen.

I have installed maven2 from aptitude. To fix this problem, I took the following steps:

  • Removed Maven2 sudo apt-get remove maven2

  • Installed Maven 3.0.4 for ubuntu as stated - Installing maven2 without openjdk

  • Even after that I got the error -

    Unable to locate the javac Compiler in:[ERROR] /usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar



To fix this, the JDK needs to be reinstalled. It worked for me !. For anyone even if this solution doesn't work, please have a look - Why is maven ignoring my JAVA_HOME?

Sincerely.

+5


source


"Unable to execute mojo: resources. This requires a project with an existing pom.xml"



This error means there is no pom.xml in the working directory

+2


source







All Articles