Visitar URL original
Fix exception caused by duplicate dependencies in consumer pom by gnodet · Pull Request #11283 · apache/maven · GitHub
Skip to content

Fix exception caused by duplicate dependencies in consumer pom - #11283

Merged
gnodet merged 3 commits into
apache:masterfrom
gnodet:fix/duplicate-dependency-in-consumer-pom
Oct 16, 2025
Merged

gnodet merged 3 commits into
apache:masterfrom
gnodet:fix/duplicate-dependency-in-consumer-pom

Conversation

@gnodet

@gnodet gnodet commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Fixes #11280

if (managementKey == null) {
managementKey = (getGroupId() + ":" + getArtifactId() + ":" + getType() + (getClassifier() != null ? ":" + getClassifier() : "")).intern();
managementKey = (getGroupId() + ":" + getArtifactId() + ":" + getType()
+ (getClassifier() != null && !getClassifier().isEmpty() ? ":" + getClassifier() : "")).intern();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perso I prefer isBlank() since 11+

@gnodet gnodet Oct 16, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not sure though... All the checks are done with isEmpty() in the code, so introducing a isBlank() at one point may lead to inconsistencies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sure, I agree, I just said "my 5 cents"

@gnodet gnodet Oct 16, 2025 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

More checks:

There's a single check for isBlank and I think it's wrong at this point.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

and it was probably me ... 😆

@gnodet gnodet added bug Something isn't working backport-to-4.0.x labels Oct 16, 2025
@wendigo

wendigo commented Oct 16, 2025

Copy link
Copy Markdown

Thanks for fast turnaround @gnodet

@wendigo

wendigo commented Oct 16, 2025

Copy link
Copy Markdown

I tested a build from this branch and now build passes :)

@gnodet
gnodet merged commit 1a02597 into apache:master Oct 16, 2025
@github-actions github-actions Bot added this to the 4.1.0 milestone Oct 16, 2025
gnodet added a commit to gnodet/maven that referenced this pull request Oct 16, 2025
@gnodet

gnodet commented Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
✅ maven-4.0.x

Questions ?

Please refer to the Backport tool documentation

gnodet added a commit that referenced this pull request Oct 16, 2025
@gnodet
gnodet deleted the fix/duplicate-dependency-in-consumer-pom branch October 26, 2026 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven 4.0.0 (latest snapshot) fails to install dependencies (install failed: Duplicate dependency)

3 participants