When a Ivy project depends a maven project (using assembly plugin), there will be problems. For example:
Maven project: Suppose the maven project will deploy 2 snapshot packages: for exmaple, one is my-app-1.0.0-20130504.000602-1.jar and the other is my-app-1.0.0-20130504.001348-1-myzip.zip. The pom.xml is shown below.
<modelVersion>4.0.0</modelVersion> <groupId>com.mycompany.app</groupId> <artifactId>my-app</artifactId> <packaging>jar</packaging> <version>1.0.0-SNAPSHOT</version> <... ...> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.2.1</version> <configuration> <descriptors> <descriptor>src/main/assembly.xml</descriptor> </descriptors> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-deploy-plugin</artifactId> <version>2.7</version> <configuration> <groupId>${project.groupId}</groupId> <artifactId>${project.artifactId}</artifactId> <version>${project.version}</version> <packaging>zip</packaging> <file>my-app-1.01-myzip.zip</file> </configuration> </plugin> </plugins> </build> </project>
The Ivy project
The Ivy project depends on the 2 artifacts published by above maven project. The ivy.xml is shown below:
<configurations> <conf name="get-maven" /> </configurations> <dependencies> <dependency org="com.mycompany.app" name="my-app" rev="1.0.0-SNAPSHOT" changing="true" conf="get-maven->default"> <artifact name="my-app" ext="jar" type="jar"></artifact> <artifact name="my-app" ext="zip" type="zip" m:classifier="myzip"></artifact> </dependency> </dependencies>
Issues: Each time when the maven project deploy new snapshot to the artifactory server, the ivy project can retrieve the latest my-app-xxx.jar from the artifacory server but it can't retrieve the latest my-app-xxx-myzip.zip (ivy can't get to know that the zip is updated and just retrieve the zip from local cache). What I have to do is to delete the local cache, and run the ivy project again.
I did some investigation, and found the ivy task "convertpom" didn't convert the app-xxx-myzip.zip from pom to ivy, and only 1 artifact (the my-app-xxx.jar) can be found in the converted ivy.xml. Not sure if this is the root cause.
Can anyone help on this? How can I get the lastet snapshots for both artifacts in ivy project?
Regards, Alben