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

Could org.mapstruct.examples.kotlin:mapstruct-examples-kotlin:1.0.0-SNAPSHOT drop off redundant dependencies? #134

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Celebrate-future
Copy link

image
Hi! I found the pom file of project org.mapstruct.examples.kotlin:mapstruct-examples-kotlin:1.0.0-SNAPSHOT introduced 10 dependencies. However, among them, 3 libraries (30%) are not used by your project. I list the redundant dependencies below (labelled as red ones in the figure):

Redundant dependencies

org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.5.10:compile
org.jetbrains.kotlin:kotlin-test-junit:jar:1.5.10:test
org.jetbrains:annotations:jar:13.0:compile


Removing the redundant dependencies can reduce the size of project and prevent potential dependency conflict issues (i.e., multiple versions of the same library). More importantly, As such, I suggest a refactoring operation for org.mapstruct.examples.kotlin:mapstruct-examples-kotlin:1.0.0-SNAPSHOT’s pom file.

As shown in the figure, it is noteworthy that, libraries org.jetbrains.kotlin:kotlin-test::1.5.10:test(130KB) are invoked by the projects. When we remove the redundant dependency org.jetbrains.kotlin:kotlin-test-junit::1.5.10:test, the above org.jetbrains.kotlin:kotlin-test::1.5.10:test(130KB) should be declared as direct dependencies. The attached PR helps resolve the reported problem. It is safe to remove the unused libraries (we considered Java reflection relations when analyzing the dependencies). These changes have passed org.mapstruct.examples.kotlin:mapstruct-examples-kotlin:1.0.0-SNAPSHOT’s maven tests.

Best regards

@filiphr
Copy link
Member

filiphr commented Jul 2, 2022

Thanks for the PR @Celebrate-future. I do not agree that this PR makes sense for the examples. This is an example that is using the recommendations by the Kotlin team and adding the dependencies that a Kotlin project will have.

Adding exclusions like you are suggesting might confuse people and will go in a direction opposite of what Kotlin itself is proposing.

Can you please tell us how you did your analysis? It seems to me like this PR has been created in an automated way. If this is the case, then It is really not fair to Open Source maintainers to do these things.

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.

2 participants