-
Notifications
You must be signed in to change notification settings - Fork 41.2k
fix: add groupId before version number #29437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @dratler, this always adds the groupid. I didn't provide this solution as it changes the status quo. Adding a configuration option (as mentioned in the issue) would involve patching through the option from the plugin into the For me personally this solution is perfectly ok - but I didn't spend time to think of implications of very long group/artifact-name combinations or other possible clashes. |
…dress Classifier()
Hi @u3r , |
assertThat(this.libraryCaptor.getAllValues().get(1).getName()).isEqualTo("g2-artifact-1.0.jar"); | ||
assertThat(this.libraryCaptor.getAllValues().get(0).getName()).isEqualTo(this.libraryCaptor.getAllValues().get(1).getName()); | ||
assertThat(this.libraryCaptor.getAllValues().get(0).getName()).isEqualTo("g1-artifact-g1-1.0-cl-1.jar"); | ||
assertThat(this.libraryCaptor.getAllValues().get(1).getName()).isEqualTo("g1-artifact-g1-1.0-cl-1.jar"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this the thing to avoid? According to the test name?
So shouldn't
a) the input to these tests have at least one differing field so the resulting filenames are different or
b) throw an error as packaging two artifacts with identical coordinates seem fishy or
c) (least likely, considering (b) ) Add something to discern the files?
Can anyone official and familiar with the specific semantic of the plugin chime in, what expected output for Artifacts with identical coordinates should be or where this is filtered/addressed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maven doesn't allow multiple dependencies with identical coordinates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will be working on :
- Duplicate Entry
- Entry with diffrent Art id
- Entry with diffrent Group Ip
- Entry with diffrent Version Number
So all scenarios needs to be checked
@@ -164,12 +164,15 @@ private boolean isLocal(Artifact artifact) { | |||
|
|||
private String getFileName(Artifact artifact) { | |||
StringBuilder sb = new StringBuilder(); | |||
sb.append(artifact.getArtifactId()).append("-").append(artifact.getBaseVersion()); | |||
sb.append(artifact.getArtifactId()).append("-").append(artifact.getGroupId()).append("-") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than doing this here, I think it would be better to reuse the existing logic that prepends the group ID when a duplicate is detected. A configuration option should be added so that, when enabled, the group ID is always prepended irrespective of whether or not a duplicate has been detected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @wilkinsona ,
method doWithLibraries
it is using method getDuplicates
and it's using getFileName
and on loop for every file \ Artifacts we are using that method this is why I thought we can fix only at method getFileName
how can I inject that opinion ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @wilkinsona ,
do you think that getDuplicates
should return Artifices and then it can be better compare ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's anything to compare. The file name already contains the artifact ID, version, and any classifier. Maven guarantees that within a group, each combination of artifact ID, version, and classifier will be unique. Therefore, prepending the group ID is sufficient to avoid a duplicate entry name.
How's it going, @dratler? |
Thanks for you efforts here, @dratler. Given the lack of progress in the last few weeks and my comment on #29390, I think we need to take a step back and think some more about exactly what we want to do here. Thanks anyway. |
No description provided.