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

Handle java dependencies in the new module mechanism #1787

Closed
DamnClin opened this issue May 19, 2022 · 3 comments · Fixed by #1859
Closed

Handle java dependencies in the new module mechanism #1787

DamnClin opened this issue May 19, 2022 · 3 comments · Fixed by #1859
Labels
area: enhancement 🔧 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ generator: internal $500 https://www.jhipster.tech/bug-bounties/

Comments

@DamnClin
Copy link
Collaborator

We started the modules mechanism (#1768) with just context and files, we now need to handle java dependencies, here's an API idea:

JHipsterDependency optionalTestPom = dependency()
    .groupId("group.id")
    .artifactId("artifact-id")
    .versionSlug("version-slug")
    .optional()
    .scope(DependencyScope.TEST)
    .type(DependencyType.POM)
    .build()

moduleForProject(new JHipsterProjectFolder(FileUtils.tmpDirForTest()))
.javaDependencies()
  .add(optionalTestPom)
  .add(groupId("org.springframework.boot"), artifactId("spring-boot"))
  .add(groupId("org.springframework.cloud"), artifactId("spring-cloud-dependencies"), versionSlug("spring-cloud"))
  .and()
.build()

This give us 3 ways of adding a dependency:

  • A way with all available options (and a builder);
  • A way to add dependencies without versions (just group id and artifact id);
  • A way to add group id, artifact id and version slug.

The version slug is used to get the version from src/main/resources/generator/dependencies/pom.xml to keep the current update behavior but reduce the complexity for module creators

@pascalgrimaud pascalgrimaud added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels May 27, 2022
@pascalgrimaud
Copy link
Member

adding a bounty on this ticket:

  • it's a lot of work
  • it will manage add / update dependencies, to this part is awesome

@DamnClin
Copy link
Collaborator Author

@pascalgrimaud
Copy link
Member

@DamnClin : approved

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 $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants