我遇到一个奇怪的问题,当在我们的Jenkins管道中运行mvn package
时下载依赖项,但是当我们用{{1}执行测试时,突然间Maven找不到它}。
mvn test
在运行 <dependency>
<groupId>com.my.org</groupId>
<artifactId>myArtifact</artifactId>
<version>[1.0.0,)</version>
</dependency>
目标之后:
mvn package
要验证是否安装了软件包,我什至在本地maven存储库中做了一个[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:22 min
[INFO] Finished at: 2018-12-11T18:33:01+00:00
[INFO] Final Memory: 54M/797M
[INFO] ------------------------------------------------------------------------
,文件显示如下:
ls
但是当我执行测试目标时...
+ ls /home/jenkins/.m2/repository/com/my/org/myArtifact/1.0.2 /home/jenkins/.m2/repository/com/my/org/myArtifact/maven-metadata-github.xml /home/jenkins/.m2/repository/com/my/org/myArtifact/maven-metadata-github.xml.sha1 /home/jenkins/.m2/repository/com/my/org/myArtifact/resolver-status.properties
/home/jenkins/.m2/repository/com/my/org/myArtifact/maven-metadata-github.xml
/home/jenkins/.m2/repository/com/my/org/myArtifact/maven-metadata-github.xml.sha1
/home/jenkins/.m2/repository/com/my/org/myArtifact/resolver-status.properties
/home/jenkins/.m2/repository/com/my/org/myArtifact/1.0.2:
_remote.repositories
myArtifact-1.0.2.jar
myArtifact-1.0.2.jar.sha1
myArtifact-1.0.2.pom
myArtifact-1.0.2.pom.sha1