我试图用Maven管理多个项目,这些项目有许多相互依赖关系。这就是我所做的:
mvn package
构建了一个项目。mvn package
构建另一个依赖于另一个项目的项目。产生此输出:
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building classj 0.5-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/com/tbodt/jrestack/1.0/jrestack-1.0.pom
[WARNING] The POM for com.tbodt:jrestack:jar:1.0 is missing, no dependency information available
Downloading: http://repo.maven.apache.org/maven2/com/tbodt/jrestack/1.0/jrestack-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.332 s
[INFO] Finished at: 2014-04-09T17:45:17-08:00
[INFO] Final Memory: 3M/58M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project classj: Could not resolve dependencies for project com.tbodt:classj:jar:0.5-SNAPSHOT: Failure to find com.tbodt:jrestack:jar:1.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [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
正如您所看到的,Maven尝试并且无法从中央存储库下载我的项目。但是,它位于本地存储库中。我该怎么办?
答案 0 :(得分:2)
要在本地存储库中安装第一个项目,请运行:
mvn install