[jira] [Commented] (MNG-6460) Maven resolves old snapshot jars when an artifact changes from jar to pom deployment

2018-08-25 Thread Karl Heinz Marbaise (JIRA)


[ 
https://issues.apache.org/jira/browse/MNG-6460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16592681#comment-16592681
 ] 

Karl Heinz Marbaise commented on MNG-6460:
--

The first question which is coming into my mind: Why are you using the maven 
dependency-plugin to resolve these dependencies? Why not simply adding it as a 
dependency to your pom file? If this dep is a packaging {{pom}} than you need 
to define {{pom}} as Robert already has written..otherwise the 
default is to expect {{jar}}...

> Maven resolves old snapshot jars when an artifact changes from jar to pom 
> deployment
> 
>
> Key: MNG-6460
> URL: https://issues.apache.org/jira/browse/MNG-6460
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies
>Affects Versions: 3.5.0
>Reporter: Andy Grove
>Priority: Major
>
> I have two projects, A and B.
> A started out as a simple project with single pom with jar packaging.
> B had a dependency on A.
> A was refactored to be multi module where each module has jar packaging. The 
> parent pom now has pom packaging.
> After building A and deploying new artifacts to artifactory, and making 
> changes to B's pom I saw compilation errors with references to to the old A 
> and the new A.
> I eventually realized that B still had a reference to the original artifact 
> from A (which was originally had jar packaging but now has pom packaging).
> Even though the latest snapshot for the parent pom in A was correctly 
> published with pom packaging and no corresponding jar file, the 
> maven-dependency-plugin was resolving the jar file from the previous snapshot 
> release from before the refactor.
> This seems like a bug to me. It should have looked at the pom for the latest 
> snapshot and seen that it had pom packaging and then failed to resolve the 
> jar.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MNG-6460) Maven resolves old snapshot jars when an artifact changes from jar to pom deployment

2018-08-17 Thread Andy Grove (JIRA)


[ 
https://issues.apache.org/jira/browse/MNG-6460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16583959#comment-16583959
 ] 

Andy Grove commented on MNG-6460:
-

[~rfscholte] Thanks for the quick response. Let me have one more attempt at 
explaining (more concisely) what I consider the bug to be, and I will close 
this ticket if this is considered desired behavior.

I have a project with a declared dependency on g: com.acme a: foo v: 
1.2.3-SNAPSHOT. I am using the maven dependency plugin to resolve these 
dependencies. I have not specified the dependency type so I guess I assumed it 
defaulted to "jar".

I am using artifactory and snapshots are stored with timestamps.

Latest deployed snapshot of  com.acme:foo:1.2.3-SNAPSHOT has a pom.xml with pom 
packaging. There are no deployed jar files for this snapshot.

Expected behavior: Compiling my project that depends on this artifact now fails 
with "dependency has no jar" or just fails to resolve the classes.

Actual behavior: The maven dependency plugin ignores the latest snapshot and 
looks for an older snapshot that did have a jar file deployed, despite me using 
`-U` to force the latest snapshot to be used.

 

 

> Maven resolves old snapshot jars when an artifact changes from jar to pom 
> deployment
> 
>
> Key: MNG-6460
> URL: https://issues.apache.org/jira/browse/MNG-6460
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies
>Affects Versions: 3.5.0
>Reporter: Andy Grove
>Priority: Major
>
> I have two projects, A and B.
> A started out as a simple project with single pom with jar packaging.
> B had a dependency on A.
> A was refactored to be multi module where each module has jar packaging. The 
> parent pom now has pom packaging.
> After building A and deploying new artifacts to artifactory, and making 
> changes to B's pom I saw compilation errors with references to to the old A 
> and the new A.
> I eventually realized that B still had a reference to the original artifact 
> from A (which was originally had jar packaging but now has pom packaging).
> Even though the latest snapshot for the parent pom in A was correctly 
> published with pom packaging and no corresponding jar file, the 
> maven-dependency-plugin was resolving the jar file from the previous snapshot 
> release from before the refactor.
> This seems like a bug to me. It should have looked at the pom for the latest 
> snapshot and seen that it had pom packaging and then failed to resolve the 
> jar.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (MNG-6460) Maven resolves old snapshot jars when an artifact changes from jar to pom deployment

2018-08-17 Thread Robert Scholte (JIRA)


[ 
https://issues.apache.org/jira/browse/MNG-6460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16583580#comment-16583580
 ] 

Robert Scholte commented on MNG-6460:
-

Maven doesn't care about the type of dependencies, that's all the 
responsibility of the user. You can even add {{sh}} or 
{{cmd}} as dependencies if they exist.
Maven dependency resolution has 2 phases: collection and resolution, and 
depending on the plugin none, only collection or both are done. Collection will 
only download pom files, since every dependency will have such file. Resolution 
will download the matching artifacts based on the type.
Unless I've misunderstood the issue, I wouldn't call this a bug but "works as 
designed".

> Maven resolves old snapshot jars when an artifact changes from jar to pom 
> deployment
> 
>
> Key: MNG-6460
> URL: https://issues.apache.org/jira/browse/MNG-6460
> Project: Maven
>  Issue Type: Bug
>  Components: Dependencies
>Affects Versions: 3.5.0
>Reporter: Andy Grove
>Priority: Major
>
> I have two projects, A and B.
> A started out as a simple project with single pom with jar packaging.
> B had a dependency on A.
> A was refactored to be multi module where each module has jar packaging. The 
> parent pom now has pom packaging.
> After building A and deploying new artifacts to artifactory, and making 
> changes to B's pom I saw compilation errors with references to to the old A 
> and the new A.
> I eventually realized that B still had a reference to the original artifact 
> from A (which was originally had jar packaging but now has pom packaging).
> Even though the latest snapshot for the parent pom in A was correctly 
> published with pom packaging and no corresponding jar file, the 
> maven-dependency-plugin was resolving the jar file from the previous snapshot 
> release from before the refactor.
> This seems like a bug to me. It should have looked at the pom for the latest 
> snapshot and seen that it had pom packaging and then failed to resolve the 
> jar.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)