运行AppFuse项目时出错:“无法在项目上执行目标”

时间:2013-06-10 07:31:13

标签: java maven appfuse

我正在使用AppFuse,我想创建一个多模块项目。我试图遵循AppFuse quick start guide,所以我使用下面的命令来创建项目:

mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-modular-jsf-archetype -DarchetypeVersion=2.2.1 -DgroupId=com.mycompany -DartifactId=myproject -DarchetypeRepository=http://oss.sonatype.org/content/repositories/appfuse

然后我得到“BUILD SUCCESS”消息,但在运行以下命令后(用于运行应用程序):

Path/myproject/web ---> mvn jetty:run

我遇到了这个错误:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:46.317s
[INFO] Finished at: Mon Jun 10 11:33:50 PDT 2013
[INFO] Final Memory: 10M/95M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myproject-web: Could not resolve dependencies for project com.mycompany:myproject-web:war:1.0-SNAPSHOT: Could not find artifact com.mycompany:myproject-core:jar:1.0-SNAPSHOT in appfuse-snapshots (http://oss.sonatype.org/content/repositories/appfuse-snapshots) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

不幸的是,我在ubuntu 13.04和win 8中都遇到了这个错误。

我该如何解决?

1 个答案:

答案 0 :(得分:1)

正如您所说,您正在使用模块化appfuse应用程序。

在appfuse模块化应用程序中,存在两个模块:核心 web 。 Web模块依赖于核心模块。

所以你应该首先安装核心模块。 在核心模块目录中尝试以下代码:

mvn install