The key software components of this question are Ant with Ivy 2.4.0,
Jenkins, and Sonatype Nexus 3.14.  The classifier attribute is being used
to build different OS artifacts (name = baz, e:classifier="el5.x86_66" )
via different Jenkins jobs (i.e. different Jenkins build IDs).  The Jenkins
jobs via Ivy publishes the artifacts to the Nexus repository manager for
use by subsequent Jenkins jobs.  The artifact version number (i.e.
10.25.15.7) includes the Jenkins build number which will be different for
each build for each OS type.  (That is just how the project wanted the
version number).

The issue is that when the subsequent Jenkins job execute that are
dependent on the "baz" artifact, Ivy is find the latest version without
taking into account the classifier using a pattern matcher for the revision
number to support concurrent release version in work and find the latest
version of an artifact.  When Ivy attempts to download the artifact
including the classifier attribute, the artifact is not found because the
latest version only includes one of the artifacts based on the classifier.

Example of published artifacts with classifier:

   - foo/bar/10.25.15.6/baz-10.25.15.6-el5.x86_64.tgz
   - foo/bar/10.25.15.7/baz-10.25.15.7-*el5*.x86_64.tgz
   - foo/bar/10.25.15.16/baz-10.25.15.16-el6.x86_64.tgz
   - foo/bar/10.25.15.17/baz-10.25.15.17-*el6*.x86_64.tgz


In the ivy XML for the dependency, the classifier is being added to the
artifact element.

   - Centos 5 Build

<dependency org="foo" name="bar" rev="]10.25,10.25.16[">
  <artifact name="baz" type="tgz" e:classifier="el5.x86_64/></dependency>


   -

   Centos 6 Build


<dependency org="foo" name="bar" rev="[10.25,10.25.16[">
  <artifact name="baz" type="tgz" e:classifier="el6.x86_64/></dependency>

When the Centos 5 Jenkins job executes, Ivy chooses version
10.25.15.17 which was for
the Centos 6 build not the Centos 5 version, 10.25.15.7.

The resolvers for Nexus are ibiblio which the maven 2 compatibility
set to true and the check
modified attribute is also set to true.

Do you have any suggestions for getting the desired version and classifier?

Thanks,

Andrew

Reply via email to