forge / springboot-addon

SpringBoot Addon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a starter to an existing project

cmoulliard opened this issue · comments

The command spring-boot-new-project allows to create a new project but not to add to an existing project starters.
That could be interesting to check if start.spring.io offers this opportunity or if we should find our own way to add such starters/artifacts and import pom file within the dependenciesManagement section

Not sure how start.spring.io could help on this, I think this could be done simply with the DependencyFacet. We retrieve the list of deps from start.spring.io (or the cached one) and for each dep/starter selected we check if there is an entry in the bom section as well, like :

  "boms": {
 ...
       "keycloak": {
            "repositories": [],
            "groupId": "org.keycloak.bom",
            "artifactId": "keycloak-adapter-bom",
            "version": "3.1.0.Final"
        }
...
 }
...
"keycloak": {
            "bom": "keycloak",
            "groupId": "org.keycloak",
            "scope": "compile",
            "artifactId": "keycloak-spring-boot-starter"
        },
...

bom entry can then be added using dependencyFacet.addManagedDependency()