Search code examples
javaivymq

Use local Ivy resolution with vendor jars


I have vendor jars from IBM (4 jars starting with com.ibm.mq*) I am trying to just publish them to my local ivy cache to use in several projects.

IVY.XML

<ivy-module version="2.0">
  <info organisation="com.ibm" module="com.ibm.mq" />
  <publications>
    <artifact name="com.ibm.mq" type="jar" ext="jar"/>
    <artifact name="com.ibm.mq" type="javadoc" ext="jar"/>
    <artifact name="com.ibm.mq" type="source" ext="jar"/>
    <artifact name="com.ibm.mq.commonservices" type="jar" ext="jar"/>
    <artifact name="com.ibm.mq.commonservices" type="javadoc" ext="jar"/>
    <artifact name="com.ibm.mq.commonservices" type="source" ext="jar"/>
    <artifact name="com.ibm.mq.headers" type="jar" ext="jar"/>
    <artifact name="com.ibm.mq.headers" type="javadoc" ext="jar"/>
    <artifact name="com.ibm.mq.headers" type="source" ext="jar"/>
    <artifact name="com.ibm.mq.jmqi" type="jar" ext="jar"/>
    <artifact name="com.ibm.mq.jmqi" type="javadoc" ext="jar"/>
    <artifact name="com.ibm.mq.jmqi" type="source" ext="jar"/>
  </publications>
  <dependencies>
  </dependencies>
</ivy-module>

And my jars are named:

laptop: ls jars |  sed 's/^/    /' 
com.ibm.mq-7.5.0.2.jar
com.ibm.mq.commonservices-7.5.0.2.jar
com.ibm.mq.headers-7.5.0.2.jar
com.ibm.mq.jmqi-7.5.0.2.jar

But the publish fails with:

Buildfile: C:\Users\alan\Workspace-Eclipse\IBM-MQ\build.xml

publish:
[ivy:resolve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
[ivy:resolve] :: loading settings :: url = jar:file:/C:/Users/alan/.ant/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
[ivy:resolve] :: resolving dependencies :: com.ibm#com.ibm.mq;working@DTC26009BA481FC
[ivy:resolve]       confs: [default]
[ivy:resolve] :: resolution report :: resolve 52ms :: artifacts dl 0ms
    ---------------------------------------------------------------------
    |                  |            modules            ||   artifacts   |
    |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    |      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
    ---------------------------------------------------------------------
[ivy:publish] :: publishing :: com.ibm#com.ibm.mq

BUILD FAILED
C:\Users\jurgenaw\Workspace-Eclipse\IBM-MQ\build.xml:4: impossible to publish artifacts for com.ibm#com.ibm.mq;working@DTC26009BA481FC: java.io.IOException: missing artifact com.ibm#mq;7.5.0.2!mq.jar
    at org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:225)

my build.xml file:

<project name="localrepository" default="publish" xmlns:ivy="antlib:org.apache.ivy.ant">
  <target name="publish" description="Publish ibm.mq jars into LOCAL repository">
    <ivy:resolve/>
    <ivy:publish pubrevision="7.5.0.2" status="release" resolver="local" overwrite="true" >
      <!-- artifacts pattern="[artifact]-[type].[ext]"/ -->
      <artifacts pattern="[type]s/[artifact]-[revision].[ext]" />
    </ivy:publish>
  </target>
  <target name="cleancache" description="removes home/user/.ivy2 !">
    <ivy:cleancache />
  </target>
  <target name="resolve" description="resolve">
    <ivy:resolve />
  </target>
  <target name="report" description="dependancy report">
    <ivy:report organisation="com.ibm" module="com.ibm.mq" />
  </target>
</project>

Solution

  • Alternatively you could use a filesystem resolver and avoid the need to publish the jars.