You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Charles Oliver Nutter (JIRA)" <ji...@apache.org> on 2016/03/11 22:44:48 UTC

[jira] [Commented] (MRELEASE-161) If there is more than one artifact with the same artifactId in dependencyManagement only the first one is updated

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

Charles Oliver Nutter commented on MRELEASE-161:
------------------------------------------------

I came up with a different solution...perhaps because this bug has been out there for 9 years and the codebase has changed: https://gist.github.com/headius/2671350c4f0ad6788c0a

>From what I could tell, the main issue was that CheckDependencySnapshotsPhase only used groupId:artifactId as a key for which dependency artifacts to update. This causes:

* Only the first artifact of a given groupId:artifactId will get updated.
* Artifacts that differ by components other than groupId and artifactId use the same groupId:artifactId key. This affects artifacts with non-null type, classifier (my issue), etc.

This is not a complete patch. I was only testing classifier, and while I got it to recognize the native and non-native artifacts as different elements, for some reason it doesn't completely process the file and still prompts during the test. I'm missing some detail.

With that detail fixed, the remaining work is that it needs to form a key that represents ALL of an artifact's state except the version number.


> If there is more than one artifact with the same artifactId in dependencyManagement only the first one is updated
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: MRELEASE-161
>                 URL: https://issues.apache.org/jira/browse/MRELEASE-161
>             Project: Maven Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.0-beta-4
>         Environment: Maven 2.0.4 under windows
>            Reporter: Sébastien Cesbron
>         Attachments: MRELEASE-161.patch, multipleArtifacts.patch, release-test.zip
>
>
> I have a multi module project. When I do release:prepare, the release plugin update the version tag of all my submodules in the dependencyManagement section.
> For the same module I have declared two artifacts like this :
> {code:xml}
> <dependency>
>   <groupId>com.bla</groupId>
>   <artifactId>blabla</artifactId>
>   <version>1.0-SNAPSHOT</version>
>   <type>test-jar</type>
>   <scope>test</scope>
> </dependency>
> <dependency>
>   <groupId>com.bla</groupId>
>   <artifactId>blabla</artifactId>
>   <version>1.0-SNAPSHOT</version>
> </dependency>
> {code}
> In this case, the release plugin only update the first dependency.
> This is due to element search in the "updateDomVersion" method of the AbstractRewritePomsPhase class. I've attached a patch to solve the problem. I don't know if this is the right  way to do. I change all the artifacts in the same pass. I don't take car of different type/classifier



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)