0

in ivy file, the dynamic version is "latest.integration" and when i run makepom, that keyword gets straight copied into pom's version tag, which fails on resolution as maven doesn't recognize "latest.integration"

when i change the ivy to specify a version number and run makepom, the version number will carry into pom, but that assumes it's a release.

how do i run makepom to convert latest.integration to the correct "{version}-SNAPSHOT" on both the artifact version, and its dependencies (which needs to be smart to tell the internal dependencies also need -SNAPSHOT suffix while the third-party dependencies do not)?

Example

original ivy.xml has a dependency

<dependencies>
    <dependency name="some-api" rev="latest.integration"/>
<dependencies>

delivered ivy.xml converts dynamic version

<dependencies>
    <dependency name="some-api" rev="8.1.00" revConstraint="latest.integration"/>
<dependencies>

makepom converts this dependency to

<dependencies>
  <dependency>
    <groupId>some.group</groupId>
    <artifactId>some-api</artifactId>
    <version>8.1.00</version>
  <dependency>
<dependencies>

This resulting pom would be fine when some-api-8.1.00 is released; but we have NOT released it, so the the artifact is in the integration repo, and the dependency needs to be declared as

    <version>8.1.00-SNAPSHOT</version>

In other words, I would like makepom to automatically append the "-SNAPSHOT" where it needs to be.

thx

Scott Chang
  • 301
  • 4
  • 11
  • The deliver task in ivy will resolve dynamic dependencies. See related answer: http://stackoverflow.com/questions/9426011/convert-ivy-xml-to-pom-xml/9429286#9429286 – Mark O'Connor Apr 26 '16 at 21:27
  • the deliver task resolves ivy.xml (with dynamic revision) to another ivy.xml (with specific revision); the question is how do you take either and turn into a pom with snapshot revision? – Scott Chang May 02 '16 at 21:03
  • The link I attached generates a POM file using the makepoms task. – Mark O'Connor May 03 '16 at 07:12
  • the link describes using makepom, but it didn't explain the part about how to distinguish a snapshot dependency vs release in the resulting pom, which is what i'm trying to find out. edited my question with specific example. thx – Scott Chang May 04 '16 at 22:17
  • Sounds like the issue is with the deliver task that is used to resolve the latest revision (makepom merely creates the file). Are you also using ivy to publish the snapshot? I have seen problems in the past where the Maven repo client is expected to update the repo metadata... which might explain the incorrect resolution. See: http://stackoverflow.com/questions/15771776/publishing-ivy-snapshots-with-maven-metadata/15797166#15797166 At the end of the day I think to support snapshots properly you may need a Maven client. After all Snapshots is a Maven concept. – Mark O'Connor May 06 '16 at 16:42
  • See also the following link http://stackoverflow.com/questions/14445268/whats-wrong-with-this-ivy-changingpattern-snapshot-configuration/14445694#14445694 Apologies for the opinionated posting but I no longer use Snapshots in my CI process. – Mark O'Connor May 06 '16 at 16:43

0 Answers0