gpt4 book ai didi

maven - 尝试编译 mahout 但出现错误 - 无法执行 mojo : resources. Build is not using pom.xml

转载 作者:行者123 更新时间:2023-12-03 22:53:22 27 4
gpt4 key购买 nike

我已经完成了以下步骤:

  1. 已安装 Java 1.6
  2. 我使用的是 Ubuntu 11.10。在/etc/bash.bachrc 中添加 $JAVA_HOME 路径
  3. 安装了专家。 mvn --version 正确显示已安装的 maven。
  4. http://svn.apache.org/repos/asf/mahout/trunk 下载 Mahout

现在,我进入 mahout/trunk 并尝试执行 mvn clean installmvn clean install -X -e,然后出现以下错误 -

Cannot execute mojo: resources. It requires a project with an existing pom.xml, but the build is not using one.

我只想尝试 mahout/examples 中的示例。如何修复此错误?

目录下有个pom.xml

完整的终端输出在这里:

+ 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] ------------------------------------------------------------------------

最佳答案

谢谢 ajozwik 和 Owen。

我从 aptitude 安装了 maven2。我采取了以下步骤来解决此问题:

  1. 移除 Maven2 sudo apt-get remove maven2
  2. 按照 - Installing maven2 without openjdk 中的指示为 ubuntu 安装了 Maven 3.0.4

  3. 即使在执行此操作后,我仍收到错误 -

    无法在以下位置找到 javac 编译器:[错误]/usr/lib/jvm/java-6-openjdk/jre/../lib/tools.jar

    <

要解决此问题,需要重新安装 JDK。它对我有用!对于那些甚至,如果此解决方案不起作用,请查看 - Why maven ignores my JAVA_HOME?

问候。

关于maven - 尝试编译 mahout 但出现错误 - 无法执行 mojo : resources. Build is not using pom.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9799392/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com