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

Filter out duplicated dependencies from pom.xml #368

Merged
merged 6 commits into from
May 3, 2022

Conversation

yevhenii-nadtochii
Copy link
Contributor

@yevhenii-nadtochii yevhenii-nadtochii commented Apr 29, 2022

This PR addresses #362.

As described in the issue, sometimes we can't overcome the presence of several versions of the same dependency. pom.xml is generated upon a whole project and doesn't group dependencies by modules. Specific modules override versions dictated by config. And, as a result, several versions of the same dependency leak to pom.xml.

spine-time repository is an example here. Each subproject is configured to use a specific version of protoc from config. The configuration is performed from the root project:

 protoc {
    artifact = Protobuf.compiler
}

Meanwhile, time module applies our mc-java plugin, and not the last version. The plugin overrides the version of protoc, specified by the root. As a result, the module uses its own version.


This PR makes DependencyWriter filter out duplicates by group and name. Only the one, with the newest version, is retained. The duplicates are logged.

Generation of license reports is not changed, since dependencies there are grouped by modules.

@yevhenii-nadtochii yevhenii-nadtochii self-assigned this Apr 29, 2022
@yevhenii-nadtochii yevhenii-nadtochii marked this pull request as ready for review April 29, 2022 15:03
@yevhenii-nadtochii
Copy link
Contributor Author

@armiol @alexander-yevsyukov Please, take a look.

Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

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

Please log some details on the duplicates, as we discussed.

@yevhenii-nadtochii yevhenii-nadtochii requested a review from armiol May 3, 2022 08:28
@yevhenii-nadtochii
Copy link
Contributor Author

@armiol PTAL

@yevhenii-nadtochii yevhenii-nadtochii linked an issue May 3, 2022 that may be closed by this pull request
Copy link
Contributor

@armiol armiol left a comment

Choose a reason for hiding this comment

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

LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Avoid duplicated dependencies in pom.xml
2 participants