Skip to content
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

fix: compute unique key for artifact #20551

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Conversation

mcollovati
Copy link
Collaborator

@mcollovati mcollovati commented Nov 26, 2024

Computes a unique key for maven artifacts when collecting dependencies for the Flow maven plugin isolated classloader.

fixes #20555

Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.
Copy link

github-actions bot commented Nov 26, 2024

Test Results

1 158 files  ± 0  1 158 suites  ±0   1h 39m 43s ⏱️ + 8m 7s
7 514 tests ± 0  7 461 ✅ ± 0  53 💤 ±0  0 ❌ ±0 
7 874 runs  +12  7 812 ✅ +12  62 💤 ±0  0 ❌ ±0 

Results for commit e889a11. ± Comparison against base commit 9c1e56c.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch should fix the reported issue, LGTM.

Just a question: should we also add version and scope to the artifact's key mapper?
I don't know the whole context of this feature, maybe the version is handled already in some other place.

@mcollovati
Copy link
Collaborator Author

mcollovati commented Nov 27, 2024

Just a question: should we also add version and scope to the artifact's key mapper?

Key mapper is used to identify artifacts that are defined as dependencies for both project and Flow maven plugin. If there are duplicates, we choose the project dependency.
So, version and scope should not be considered; otherwise we will not be able to detect duplicates.
And in the same project, it is an error to define the same dependency twice with a different version or a different scope.

Also, Maven DefaultArtifact.getId() does not consider scope. It is composed by concatenating getDependencyConflictId() with getBaseVersion(), and getDependencyConflictId() is basically groupId:artifactId:type[:classifier]

@ZheSun88 ZheSun88 merged commit 9b9baf1 into main Nov 27, 2024
25 of 26 checks passed
@ZheSun88 ZheSun88 deleted the fix/maven-plugin-classloader branch November 27, 2024 13:02
vaadin-bot pushed a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot pushed a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot pushed a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
vaadin-bot added a commit that referenced this pull request Nov 27, 2024
Computes a unique key for maven artifacts when collecting dependencies
for the Flow maven plugin isolated classloader.

Co-authored-by: Marco Collovati <marco@vaadin.com>
Co-authored-by: Mikhail Shabarov <61410877+mshabarov@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

project failed with Duplicated key on 24.5.6 (flow 24.5.7)
4 participants