我正在使用 aether-ant 来解决 pom.xml 文件中的依赖关系。在我的 jenkins master 上运行脚本时,工件的路径如下所示:
stomp pl: C:\m2\be\mips\stomp-windows\1.0-SNAPSHOT\stomp-windows-1.0-SNAPSHOT.pl
但是,在 Windows 从站上运行它时,它看起来像:
stomp pl: C:\Windows\system32\config\systemprofile\.m2\repository\be\mips\stomp-windows\1.0-SNAPSHOT\stomp-windows-1.0-SNAPSHOT.pl
在 jenkins master 和 jenkins windows slave 上,maven settings.xml 文件被拾取,所有工件都下载到 C:\m2 ......但由于某种原因,在 Windows slave 上,路径不是指向 C:\m2...
路径 C:\Windows\system32\config\systemprofile 甚至都不存在。
这是我的 ant 构建脚本的片段:
<!-- Read in the pom file. -->
<artifact:pom if:true="${windows}" id="pomId" file="pom-windows.xml" />
<artifact:pom if:true="${linux}" id="pomId" file="pom-linux.xml" />
<!-- Add -->
<artifact:remoterepos id="all">
<artifact:remoterepo refid="central"/>
<!-- Define our remote nexus repo. -->
<!-- Updates always forces aether to look for a new remote version. -->
<artifact:remoterepo id="nexusRepo"
url="${env.nexusRepoUrl}/${nexusSnapshotsRepoName}"
updates="always">
<snapshots enabled="true" />
</artifact:remoterepo>
</artifact:remoterepos>
<!-- Resolve the dependencies from the pom file. -->
<artifact:resolve>
<artifact:dependencies pomRef="pomId"/>
<artifact:remoterepos refid="all"/>
<!--
For some reason, suddenly, on the Windows Slave,
the nexus.dep properties point to an unexisting folder....
-->
<artifact:properties prefix="nexus.dep."/>
</artifact:resolve>
github 上的 aether-ant 项目可以在https://github.com/eclipse/aether-ant找到
我搜索了一下,发现一些条目说一些 Windows 注册表条目可能指向错误的目录......我不知道这是否与这个问题有关。