Skip to content

Commit

Permalink
feat(generators): add dependencyManagement to init generator (#382)
Browse files Browse the repository at this point in the history
Co-authored-by: khalilou88 <[email protected]>
  • Loading branch information
khalilou88 and khalilou88 authored Aug 15, 2023
1 parent 9d797fe commit 824963c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
<version><%= parentProjectVersion %></version>
<packaging>pom</packaging>

<% if(dependencyManagement === 'spring-boot-parent-pom') { -%>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version><%= springBootVersion %></version>
<relativePath/>
</parent>
<% } -%>
<% if(dependencyManagement === 'micronaut-parent-pom') { -%>
<parent>
<groupId>io.micronaut.platform</groupId>
<artifactId>micronaut-parent</artifactId>
<version><%= micronautVersion %></version>
</parent>
<% } -%>

<properties>
<java.version><%= javaVersion %></java.version>
<kotlin.version><%= kotlinVersion %></kotlin.version>
Expand All @@ -17,4 +33,7 @@
<ktlint.version><%= ktlintVersion %></ktlint.version>
</properties>




</project>
4 changes: 4 additions & 0 deletions packages/nx-maven/src/generators/init/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@ export interface NxMavenGeneratorSchema {
groupId: string;
parentProjectName: string;
parentProjectVersion: string;
dependencyManagement:
| 'bom'
| 'spring-boot-parent-pom'
| 'micronaut-parent-pom';
}
26 changes: 25 additions & 1 deletion packages/nx-maven/src/generators/init/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,36 @@
"description": "Version of the project to generate",
"alias": "v",
"x-prompt": "What project version would you like to use?"
},
"dependencyManagement": {
"description": "Dependency Management",
"type": "string",
"default": "bom",
"x-prompt": {
"message": "How to handle dependency management?",
"type": "list",
"items": [
{
"value": "bom",
"label": "use bom"
},
{
"value": "spring-boot-parent-pom",
"label": "use spring boot parent pom"
},
{
"value": "micronaut-parent-pom",
"label": "use micronaut parent pom"
}
]
}
}
},
"required": [
"javaVersion",
"groupId",
"parentProjectName",
"parentProjectVersion"
"parentProjectVersion",
"dependencyManagement"
]
}

0 comments on commit 824963c

Please sign in to comment.