我正在努力让ivy:buildnumber
为我的版本publish
目标工作,并且收到了一个奇怪的错误。
我的publish
目标:
<target name="publish" depends="package">
<ivy:buildnumber resolver="default-resolver" organisation="myorg" module="myapp" revision="0.2" />
<ivy:publish resolver="default-resolver" pubrevision="${ivy.new.revision}" overwrite="true" update="true">
<artifacts pattern="gen/dist/pub/[artifact].[ext]" />
</ivy:publish>
</target>
我得到的错误:
publish:
[ivy:buildnumber] :: loading settings :: url = jar:file:/home/myuser/sandbox/dsi/workbench/eclipse/4.2/eclipse/plugins/org.apache.ivy.eclipse.ant_2.3.0.final_20130110142753/ivy.jar!/org/apache/ivy/core/settings/ivysettings.xml
BUILD FAILED
/home/myuser/sandbox/dsi/workbench/eclipse/workspace/myapp/build/build-core.xml:289: Unknown resolver: default-resolver
问题是,我的常春藤设置文件不在org/apache/ivy/core/settings/ivysettings.xml
。我的常春藤设置文件位于~/ivy/ivy-settings.xml
。
所以我想某种程度上我没有正确配置ivy:buildnumber
,所以它默认为Ivy随附的常春藤设置文件。由于我的default-resolver
未在发货的设置文件中定义,因此无法找到要发布的解析器。
有什么想法吗?提前谢谢!
更新:
我的<ivy:settings>
目标:
<target name="setup-ivy">
<ivy:settings url="file:///home/myuser/ivy/ivy-settings.xml"/>
</target>
我的ivy-settings.xml
:
<ivysettings>
<properties file="ivy-settings.properties"/>
<settings defaultResolver="default-resolver"/>
<latest-strategies>
<latest-lexico/>
</latest-strategies>
<credentials host="${ivy.repo.root}" realm="${ivy.std.repo.realm}" username="${ivy.std.repo.username}" password="${ivy.std.repo.password}"/>
<resolvers>
<chain name="default-resolver" returnFirst="true">
<url name="std-repo">
<ivy pattern="${ivy.repo.root}/${ivy.module.pattern}"/>
<artifact pattern="${ivy.repo.root}/${ivy.artifact.pattern}"/>
</url>
</chain>
</resolvers>
<modules>
<module organisation="myorg" name="*" resolver="default-resolver"/>
</modules>
</ivysettings>