i am using Apache Ant with Ivy to publish artifacts to Artifactory-Server. The way i do this is to generate a pom-File from ivy.xml. However with different names for modules and artifacts. If i retrieve the artifacts from server only the artifacts with the same names are downloaded.
ivy.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="com.ibm" module="db2_driver" revision="4.19.26"/>
<publications>
<artifact name="db2jcc4_license_cisuz" type="jar" conf="default" ext="jar" />
<artifact name="db2jcc4" type="jar" conf="default" ext="jar" />
<artifact name="db2_driver" type="pom" conf="default" ext="pom" />
</publications>
</ivy-module>
build.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project name="IVY_TEST" default="ivypom" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<property file="build.properties" /> <!- defines ${artifact.path} -->
<target name="ivypom" >
<ivy:makepom ivyfile="${artifact.path}/ivy.xml" pomfile="${artifact.path}/db2_driver.pom" >
<mapping conf="*" scope="*" />
</ivy:makepom>
<ivy:publish resolver="main" module="[ivy.module]" revision="4.19.26" organisation="[ivy.organisation]" overwrite="true">
<artifacts pattern="${artifact.path}/[artifact].[ext]" />
</ivy:publish>
</target>
</project>
The Upload is succesfully...
That's the result (Artifactory Browser):
- db2_driver
- 4.14.22
- 4.19.26
- db2_driver-4.19.26.pom
- db2jcc4-4.19.26.jar
- db2jcc4_license_cisuz-4.19.26.jar
- ivy-4.19.26.xml
generated pom-File:
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibm</groupId>
<artifactId>db2_driver</artifactId>
<packaging>pom</packaging>
<version>4.19.26</version>
Now I want to use the driver.
The needed ivy.xml for the application:
<?xml version="1.0" encoding="ISO-8859-1"?>
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="de.xxx" module="main_steuerprogramm" revision="1.0.0"/>
<configurations>
<conf name="default" description="Standard Konfiguration" />
</configurations>
<dependencies>
<dependency org="com.ibm" name="db2_driver" rev="4.19.26"/>
</dependencies>
</ivy-module>
But it don't work. How can I retrieve the jars?
There are three good answers...
But in my case the name of the artifacts are different to module name. That's the difficulty.
Please help.