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

Maven: removeDependency doesn't remove property for version #6977

Closed
4 tasks done
murdos opened this issue Jul 24, 2023 · 3 comments · Fixed by #9921
Closed
4 tasks done

Maven: removeDependency doesn't remove property for version #6977

murdos opened this issue Jul 24, 2023 · 3 comments · Fixed by #9921
Assignees
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal $300 https://www.jhipster.tech/bug-bounties/

Comments

@murdos
Copy link
Contributor

murdos commented Jul 24, 2023

.removeDependency(dependencyId(MOCKITO_GROUP, "mockito-junit-jupiter"))
does not remove <mockito.version>5.4.0</mockito.version> in pom.xml

See https://github.com/jhipster/jhipster-lite-sample-app/blob/0df81108ece4f8838e4236753e006000775b2fb5/pom.xml#L24C6-L24C21

TO-DO: Implement safe removal of versions

  • When removing the dependency manager
  • When removing a direct dependency
  • Profile: When removing the dependency manager
  • Profile: When removing a direct dependency
@pascalgrimaud
Copy link
Member

I wonder if the method removeDependency should remove the version too, or should we add a new method removeVersion?
I'd prefer the 2nd solution, with a new method

@murdos
Copy link
Contributor Author

murdos commented Jul 27, 2023

The

I wonder if the method removeDependency should remove the version too, or should we add a new method removeVersion? I'd prefer the 2nd solution, with a new method

The property is added automatically when a dependency is added. If possible it would be nice the automatically remove the property if it not used anymore. But I will think more about it and see how it would translate it the gradle side too.

@pascalgrimaud pascalgrimaud changed the title Maven: removeDependency doesn't not remove property for version Maven: removeDependency doesn't remove property for version Jul 28, 2023
@DamnClin
Copy link
Collaborator

Not that simple since a version property can be used by multiple dependencies

@renanfranca renanfranca self-assigned this May 23, 2024
@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $300 https://www.jhipster.tech/bug-bounties/ labels Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal $300 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@murdos @renanfranca @pascalgrimaud @DamnClin and others