ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vincent Case <vincent.c...@gmail.com>
Subject Issue Publishing with UrlResolver and later Resolving with IBiblioResolver
Date Wed, 02 Nov 2016 17:36:14 GMT
Problem Overview: My goal is to publish an artifact using the UrlResolver
and then retrieve it using the IBiblioResolver.  However, resolve fails if
the dependency conf mapping is to something other than "->default".   What
I observe is:
1- The ivy:resollve task succeeds if the UrlResolver is used for resolving
as well as publishing.
2- The ivy:resolve task succeeds with the IBiblioResolver only if the conf
mapping is to the "->default" for the published artifact.
3- When the dependency conf mapping is to something other than ->default,
verbose logging indicates that "no ivy file file found for XXX: using
default data"
4- When the "m2compitiblity" settings are the same for publish and resolve,
the failure is always the same, regardless of its setting, and regardless
of the "usepoms" setting.

I have created a trivial example (below) that exhibits the behavior
described above.

Thanks for your help.

=== settings.properties ===
pattern.artifacts.pub=[organization]/[module]/[revision]/[type]s/[artifact].[ext]
pattern.ivy.pub=[organization]/[module]/[revision]/[type]s/[artifact].[ext]

=== settings.xml ===
<ivysettings>
<properties file="settings.properties" override="false" />
<settings defaultResolver="resolver-res" />

<resolvers>
<url name="resolver-pub" m2compatible="false" >
<artifact pattern="${artifactory.url}/${rps.repo.integration}/${pattern.artifacts.pub}"
/>
<ivy      pattern="${artifactory.url}/${rps.repo.integration}/${pattern.ivy.pub}"
/>
</url>
<ibiblio name="resolver-res" m2compatible="true" usepoms="false"
root="${artifactory.url}/${rps.repo.integration}"
pattern="${pattern.artifacts.pub}"
/>
</resolvers>
</ivysettings>


=== ivy.xml for Publish ===
<ivy-module version="2.0">
<info organisation="com.vcase.rps" module="pub"/>

<configurations>
<conf name="compile" visibility="private" />
<conf name="runtime" extends="compile"/>
</configurations>

<publications>
<artifact/>
</publications>
</ivy-module>

=== ivy.xml for Resolving the published artifact ===
<ivy-module version="2.0">
<info organisation="com.vcase.rps" module="res"/>

<configurations>
<conf name="compile" visibility="private" />
<conf name="runtime" extends="compile"/>
</configurations>

<dependencies>
<dependency org="com.vcase.rps" name="pub" rev="latest.integration"
transitive="false" conf="compile->runtime" />
</dependencies>
</ivy-module>

=== Build File ===
<project name="delme" default="resolve" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant" >

<property environment="env" />
<property file="settings.properties" />

<property name="IvyJarFile"
value="c:/dev/apache-ivy-2.4.0/build/artifact/jars/ivy.jar" />
<taskdef
classpath="${IvyJarFile}"
resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
/>

<target name="init" depends="clean" description="Initialize for the build" >
<ivy:configure file="settings.xml"/>
</target>


<target name="publish" depends="init" description="Publish archives">
<ivy:resolve file="ivy-pub.xml" />
<echo file="pub.jar" >file:pub.jar</echo>
<ivy:publish
artifactspattern="${basedir}/${pattern.artifacts.built}"
resolver="resolver-pub"
pubrevision="1.0"
forcedeliver="true"
status="integration"
overwrite="true"
conf="compile,runtime"
/>
</target>


<target name="resolve" depends="init" >
<ivy:resolve file="ivy-res.xml" type="jar" conf="*(public)" />
</target>


<target  name="clean">
<delete dir="c:/Users/vcase/.ivy2" includeemptydirs="true" verbose="true" />
<delete dir="c:/dev/devOpsProject/RpsApp/.ivy-internal-cache"
includeemptydirs="true" />
<delete dir="c:/dev/devOpsProject/RpsApp/.ivy-local-repo"
includeemptydirs="true" />
</target>
</project>



=== Verbose Logging Output ====

[ivy:resolve]           tried http://centos-7:8882/
artifactory/rps-integration/com/vcase/rps/pub/[revision]/jars/pub.jar
[ivy:resolve]   resolver-res: no ivy file found for
com.vcase.rps#pub;latest.integration: using default data
[ivy:resolve]           [1.0] com.vcase.rps#pub
:
:
[ivy:resolve]           :: com.vcase.rps#pub;1.0: configuration not found
in com.vcase.rps#pub;1.0: 'runtime'. It was required from
com.vcase.rps#;working@vcase-PC-new compile


EOM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message