我正在使用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中都遇到了这个错误。

我应该如何解决?

最佳答案

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

在appfuse模块化应用程序中,存在两个模块:核心和Web。
Web模块取决于核心模块。

因此,您应该首先安装核心模块。
在您的核心模块目录中尝试以下代码:

mvn install

10-05 23:34