You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "William Price (JIRA)" <ji...@apache.org> on 2012/06/23 00:27:42 UTC

[jira] [Comment Edited] (IVY-1221) ivy won't resolve updated maven SNAPSHOT artifacts with classifiers from local repo

    [ https://issues.apache.org/jira/browse/IVY-1221?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13399677#comment-13399677 ] 

William Price edited comment on IVY-1221 at 6/22/12 10:25 PM:
--------------------------------------------------------------

Here's a (sanitized) example:

We have an artifact that publishes POM metadata to the repository; it provides a JAR *and* a ZIP containing some extra resources.  It is declared in ivy.xml as:

<dependency org="foo" name="bar" rev="1.0-SNAPSHOT">
  <artifact name="bar" type="jar"/>
  <artifact name="bar" type="zip"/>
</dependency>

And we observed the behavior described above; the JAR would be updated when a new snapshot was published, but the ZIP content was NOT updated.  This was observed by looking at timestamps inside the Ivy cache directory.  The order of the <artifact> tags did not matter.  Similar behavior was observed for artifact dependencies using m:classifier attributes.

The Ant -debug output confirmed that Ivy was only deleting the JAR file:

[ivy:resolve] foo#bar;1.0-SNAPSHOT has changed: deleting old artifacts
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\jars\bar-1.0-SNAPSHOT.jar
[ivy:resolve] 	checking foo#bar;1.0-SNAPSHOT from myRepo against [none]

After patching Ivy to make the behavior change mentioned above, we see that *all* the artifacts are correctly cleaned:

[ivy:resolve] foo#bar;1.0-SNAPSHOT has changed: deleting old artifacts
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\jars\bar-1.0-SNAPSHOT.jar
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\zips\bar-1.0-SNAPSHOT.zip
[ivy:resolve] 	checking foo#bar;1.0-SNAPSHOT from myRepo against [none]

                
      was (Author: wrprice):
    Here's a (sanitized) example:

We have an artifact that publishes POM metadata to the repository; it provides a JAR *and* a ZIP containing some extra resources.  It is declared in ivy.xml as:

<dependency org="foo" name="bar" rev="1.0-SNAPSHOT">
  <artifact name="bar" type="jar"/>
  <artifact name="bar" type="zip"/>
</dependency>

And we observed the behavior described above; the JAR would be updated when a new snapshot was published, but the ZIP content was NOT updated.  This was observed by looking at timestamps inside the Ivy cache directory.  The order of the <artifact> tags did not matter.  Similar behavior was observed for artifact dependencies using m:classifier attributes.

The Ant -debug output confirmed that Ivy was only deleting the JAR file:

[ivy:resolve] foo#bar;1.0-SNAPSHOT has changed: deleting old artifacts
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\jars\bar-1.0-SNAPSHOT.jar
[ivy:resolve] 	checking com.prosrm.pricing#analytics;3.22-SNAPSHOT from myRepo against [none]

After patching Ivy to make the behavior change mentioned above, we see that *all* the artifacts are correctly cleaned:

[ivy:resolve] foo#bar;1.0-SNAPSHOT has changed: deleting old artifacts
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\jars\bar-1.0-SNAPSHOT.jar
[ivy:resolve] deleting c:\dev\env\.ivy2\cache\foo\bar\zips\bar-1.0-SNAPSHOT.zip
[ivy:resolve] 	checking com.prosrm.pricing#analytics;3.22-SNAPSHOT from myRepo against [none]

                  
> ivy won't resolve updated maven SNAPSHOT artifacts with classifiers from local repo
> -----------------------------------------------------------------------------------
>
>                 Key: IVY-1221
>                 URL: https://issues.apache.org/jira/browse/IVY-1221
>             Project: Ivy
>          Issue Type: Bug
>          Components: Maven Compatibility
>    Affects Versions: 2.2.0-RC1
>         Environment: Mac OS X 10.6, Ant 1.7.1, Maven 2.2.1
>            Reporter: Nick Bonatsakis
>
> The situation I'm running into is as follows: I have a maven project that produces two artifacts foo-SNAPSHOT.jar and foo-SNAPSHOT-tests.jar. When I resolve these via ivy, they are both pulled properly initially, however with the following ivysettings ibiblio, only the foo-SNAPSHOTS.jar is getting updated on resolve after re-installing via maven.
> <ibiblio name="local_m2_repo" 
>                  m2compatible="true"
>                  usepoms="true"
>                  changingPattern=".*-SNAPSHOT.*"
>                  changingMatcher="regexp"
>                  checkmodified="true"
>                  root="${localm2repo.url}"/>
> I started out trying the pattern ".*-SNAPSHOT" which I would have expected to pick up the tests jar, but tried this in the hopes of getting it to work, which of course it did not. This doesn't seem to be a retrieve issue either, the modified date of the foo-SNAPSHOT.jar in the local ivy cache is being updated while foo-SNAPSHOT-test.jar is not. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira