我试图在启动释放项目之前清除项目依赖项的本地存储库,以确保所需的每个依赖项都在中央存储库上并从中下载。
在项目文件夹(包含 pom.xml)中,我启动以下命令:
mvn clean dependency:purge-local-repository -DreResolve=false -Dverbose=true
该项目的 POM 非常简单,只声明了对 junit:junit:3.8.1 的依赖项
该命令的输出给我:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building corelib-api 0.1.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ corelib-api ---
[INFO] Deleting d:\Users\fpaillard\git-repositories\TEST_CORELIB\corelib-api\target
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building corelib-api 0.1.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.1:purge-local-repository (default-cli) @ corelib-api ---
[WARNING] Missing POM for junit:junit:jar:3.8.1
[INFO] Skipping: corelib-api. It cannot be resolved.
[INFO] Nothing to do for project: test:corelib-api:jar:0.1.2-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.953s
[INFO] Finished at: Mon May 14 11:34:40 CEST 2012
[INFO] Final Memory: 6M/15M
[INFO] ------------------------------------------------------------------------
当我查看本地存储库(使用 选中的路径mvn help:effetive-settings
)时,junit JAR 或 POM 仍在.m2/repository/junit/junit/3.8.1
文件夹中。
不dependency:purge-local-repository
应该删吗?
我不明白上面输出的警告。为什么 junit:junit:jar:3.8.1 POM 不见了?它仍然存在于.m2/repository/junit/junit/3.8.1/junit-3.8.1.pom
问题与 INFO 行有关Skipping: corelib-api. It cannot be resolved.
吗?corelib-api
是我运行的项目的工件名称mvn dependency:purge-local-repository
。