Skip to content

Commit

Permalink
Merge pull request #25602 from mshima/drop-jhipster-bom
Browse files Browse the repository at this point in the history
Drop jhipster-dependencies.
  • Loading branch information
DanielFran authored Mar 22, 2024
2 parents 305d849 + dbaee9b commit 7bb5694
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 42 deletions.
21 changes: 21 additions & 0 deletions generators/app/__snapshots__/generator.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ exports[`generator - app with default config should match snapshot 1`] = `
"common-custom-user-data-gradle-plugin": "'COMMON-CUSTOM-USER-DATA-GRADLE-PLUGIN-VERSION'",
"commons-beanutils": "'COMMONS-BEANUTILS-VERSION'",
"cucumber-bom": "'CUCUMBER-BOM-VERSION'",
"feign-reactor-bom": "'FEIGN-REACTOR-BOM-VERSION'",
"frontend-maven-plugin": "'FRONTEND-MAVEN-PLUGIN-VERSION'",
"gatling": "'GATLING-VERSION'",
"gatling-gradle": "'GATLING-GRADLE-VERSION'",
Expand All @@ -490,6 +491,7 @@ exports[`generator - app with default config should match snapshot 1`] = `
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
"maven-antrun-plugin": "'MAVEN-ANTRUN-PLUGIN-VERSION'",
"maven-checkstyle-plugin": "'MAVEN-CHECKSTYLE-PLUGIN-VERSION'",
Expand All @@ -505,6 +507,8 @@ exports[`generator - app with default config should match snapshot 1`] = `
"maven-war-plugin": "'MAVEN-WAR-PLUGIN-VERSION'",
"micrometer-context-propagation": "'MICROMETER-CONTEXT-PROPAGATION-VERSION'",
"modernizer-maven-plugin": "'MODERNIZER-MAVEN-PLUGIN-VERSION'",
"mongock-bom": "'MONGOCK-BOM-VERSION'",
"neo4j-migrations-spring-boot-starter": "'NEO-4-J-MIGRATIONS-SPRING-BOOT-STARTER-VERSION'",
"node-gradle": "'NODE-GRADLE-VERSION'",
"nohttp-checkstyle": "'NOHTTP-CHECKSTYLE-VERSION'",
"openapi-generator-maven-plugin": "'OPENAPI-GENERATOR-MAVEN-PLUGIN-VERSION'",
Expand All @@ -515,6 +519,9 @@ exports[`generator - app with default config should match snapshot 1`] = `
"spotless-gradle-plugin": "'SPOTLESS-GRADLE-PLUGIN-VERSION'",
"spotless-maven-plugin": "'SPOTLESS-MAVEN-PLUGIN-VERSION'",
"spring-boot": "'SPRING-BOOT-VERSION'",
"spring-cloud-dependencies": "'SPRING-CLOUD-DEPENDENCIES-VERSION'",
"spring-dependency-management": "'SPRING-DEPENDENCY-MANAGEMENT-VERSION'",
"springdoc": "'SPRINGDOC-VERSION'",
"testng": "'TESTNG-VERSION'",
"typesafe": "'TYPESAFE-VERSION'",
"xmemcached": "'XMEMCACHED-VERSION'",
Expand Down Expand Up @@ -1042,6 +1049,7 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"common-custom-user-data-gradle-plugin": "'COMMON-CUSTOM-USER-DATA-GRADLE-PLUGIN-VERSION'",
"commons-beanutils": "'COMMONS-BEANUTILS-VERSION'",
"cucumber-bom": "'CUCUMBER-BOM-VERSION'",
"feign-reactor-bom": "'FEIGN-REACTOR-BOM-VERSION'",
"frontend-maven-plugin": "'FRONTEND-MAVEN-PLUGIN-VERSION'",
"gatling": "'GATLING-VERSION'",
"gatling-gradle": "'GATLING-GRADLE-VERSION'",
Expand All @@ -1057,6 +1065,7 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
"maven-antrun-plugin": "'MAVEN-ANTRUN-PLUGIN-VERSION'",
"maven-checkstyle-plugin": "'MAVEN-CHECKSTYLE-PLUGIN-VERSION'",
Expand All @@ -1072,6 +1081,8 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"maven-war-plugin": "'MAVEN-WAR-PLUGIN-VERSION'",
"micrometer-context-propagation": "'MICROMETER-CONTEXT-PROPAGATION-VERSION'",
"modernizer-maven-plugin": "'MODERNIZER-MAVEN-PLUGIN-VERSION'",
"mongock-bom": "'MONGOCK-BOM-VERSION'",
"neo4j-migrations-spring-boot-starter": "'NEO-4-J-MIGRATIONS-SPRING-BOOT-STARTER-VERSION'",
"node-gradle": "'NODE-GRADLE-VERSION'",
"nohttp-checkstyle": "'NOHTTP-CHECKSTYLE-VERSION'",
"openapi-generator-maven-plugin": "'OPENAPI-GENERATOR-MAVEN-PLUGIN-VERSION'",
Expand All @@ -1081,6 +1092,9 @@ exports[`generator - app with gateway should match snapshot 1`] = `
"spotless-gradle-plugin": "'SPOTLESS-GRADLE-PLUGIN-VERSION'",
"spotless-maven-plugin": "'SPOTLESS-MAVEN-PLUGIN-VERSION'",
"spring-boot": "'SPRING-BOOT-VERSION'",
"spring-cloud-dependencies": "'SPRING-CLOUD-DEPENDENCIES-VERSION'",
"spring-dependency-management": "'SPRING-DEPENDENCY-MANAGEMENT-VERSION'",
"springdoc": "'SPRINGDOC-VERSION'",
"testng": "'TESTNG-VERSION'",
},
"javaPackageSrcDir": "src/main/java/com/mycompany/myapp/",
Expand Down Expand Up @@ -1605,6 +1619,7 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"common-custom-user-data-gradle-plugin": "'COMMON-CUSTOM-USER-DATA-GRADLE-PLUGIN-VERSION'",
"commons-beanutils": "'COMMONS-BEANUTILS-VERSION'",
"cucumber-bom": "'CUCUMBER-BOM-VERSION'",
"feign-reactor-bom": "'FEIGN-REACTOR-BOM-VERSION'",
"frontend-maven-plugin": "'FRONTEND-MAVEN-PLUGIN-VERSION'",
"gatling": "'GATLING-VERSION'",
"gatling-gradle": "'GATLING-GRADLE-VERSION'",
Expand All @@ -1622,6 +1637,7 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"jhipster-dependabot": "'JHIPSTER-DEPENDABOT-VERSION'",
"jib-maven-plugin": "'JIB-MAVEN-PLUGIN-VERSION'",
"lifecycle-mapping": "'LIFECYCLE-MAPPING-VERSION'",
"lz4-java": "'LZ-4-JAVA-VERSION'",
"mapstruct": "'MAPSTRUCT-VERSION'",
"maven-antrun-plugin": "'MAVEN-ANTRUN-PLUGIN-VERSION'",
"maven-checkstyle-plugin": "'MAVEN-CHECKSTYLE-PLUGIN-VERSION'",
Expand All @@ -1637,6 +1653,8 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"maven-war-plugin": "'MAVEN-WAR-PLUGIN-VERSION'",
"micrometer-context-propagation": "'MICROMETER-CONTEXT-PROPAGATION-VERSION'",
"modernizer-maven-plugin": "'MODERNIZER-MAVEN-PLUGIN-VERSION'",
"mongock-bom": "'MONGOCK-BOM-VERSION'",
"neo4j-migrations-spring-boot-starter": "'NEO-4-J-MIGRATIONS-SPRING-BOOT-STARTER-VERSION'",
"node-gradle": "'NODE-GRADLE-VERSION'",
"nohttp-checkstyle": "'NOHTTP-CHECKSTYLE-VERSION'",
"openapi-generator-maven-plugin": "'OPENAPI-GENERATOR-MAVEN-PLUGIN-VERSION'",
Expand All @@ -1647,6 +1665,9 @@ exports[`generator - app with microservice should match snapshot 1`] = `
"spotless-gradle-plugin": "'SPOTLESS-GRADLE-PLUGIN-VERSION'",
"spotless-maven-plugin": "'SPOTLESS-MAVEN-PLUGIN-VERSION'",
"spring-boot": "'SPRING-BOOT-VERSION'",
"spring-cloud-dependencies": "'SPRING-CLOUD-DEPENDENCIES-VERSION'",
"spring-dependency-management": "'SPRING-DEPENDENCY-MANAGEMENT-VERSION'",
"springdoc": "'SPRINGDOC-VERSION'",
"testng": "'TESTNG-VERSION'",
"typesafe": "'TYPESAFE-VERSION'",
"xmemcached": "'XMEMCACHED-VERSION'",
Expand Down
15 changes: 15 additions & 0 deletions generators/server/resources/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
[libraries]
spring-cloud-dependencies = { module = 'org.springframework.cloud:spring-cloud-dependencies', version = '2023.0.0' }

springdoc = { module = 'org.springdoc:springdoc-openapi-starter-webmvc-api', version = '2.4.0' }

feign-reactor-bom = { module = 'com.playtika.reactivefeign:feign-reactor-bom', version = '4.0.3' }

# Cucumber
testng = { module = 'org.testng:testng', version = '7.9.0' }
cucumber-bom = { module = 'io.cucumber:cucumber-bom', version = '7.15.0' }

mongock-bom = { module = 'io.mongock:mongock-bom', version = '5.4.0' }

neo4j-migrations-spring-boot-starter = { module = 'eu.michael-simons.neo4j:neo4j-migrations-spring-boot-starter', version = '2.9.2' }

# Cassandra
lz4-java = { module = 'org.lz4:lz4-java', version = '1.8.0' }

[plugins]
spring-dependency-management = { id = 'io.spring.dependency-management', version = '1.1.4' }

gradle-git-properties = { id = 'com.gorylenko.gradle-git-properties', version = '2.4.1' }

node-gradle = { id = 'com.github.node-gradle.node', version = '7.0.1' }
Expand Down
12 changes: 0 additions & 12 deletions generators/server/templates/build.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -160,22 +160,10 @@ repositories {
}

dependencies {
// Allows unversioned annotationProcessor
annotationProcessor platform(libs.jhipster.dependencies)

implementation "com.fasterxml.jackson.datatype:jackson-datatype-hppc"
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"
<%_ if (authenticationTypeOauth2) { _%>
implementation "com.github.ben-manes.caffeine:caffeine"
<%_ } _%>
<%_ if ((applicationTypeMicroservice || applicationTypeGateway) && reactive) { _%>
implementation "com.playtika.reactivefeign:feign-reactor-cloud"
<%_ } _%>
<%_ if ((applicationTypeMicroservice || applicationTypeGateway) && reactive) { _%>
implementation "com.playtika.reactivefeign:feign-reactor-spring-configuration"
<%_ } _%>
<%_ if ((applicationTypeMicroservice || applicationTypeGateway) && reactive) { _%>
implementation "com.playtika.reactivefeign:feign-reactor-webclient"
<%_ } _%>
testImplementation("com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}") {
exclude group: "org.slf4j", module: "slf4j-api"
Expand Down
2 changes: 1 addition & 1 deletion generators/server/templates/gradle/profile_dev.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ configurations {
}
dependencies {
compileOnly "org.springframework.boot:spring-boot-devtools"
developmentOnly "org.springframework.boot:spring-boot-devtools"
<%_ if (devDatabaseTypeH2Any && !reactive) { _%>
implementation "com.h2database:h2"
<%_ } _%>
Expand Down
23 changes: 7 additions & 16 deletions generators/server/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version><%- javaDependencies['spring-boot'] %></version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId><%= packageName %></groupId>
<artifactId><%= dasherizedBaseName %></artifactId>
<version><%= projectVersion %></version>
Expand Down Expand Up @@ -98,7 +105,6 @@
<properties-maven-plugin.version><%- javaDependencies['properties-maven-plugin'] %></properties-maven-plugin.version>
<sonar-maven-plugin.version><%- javaDependencies['sonar-maven-plugin'] %></sonar-maven-plugin.version>
<spotless-maven-plugin.version><%- javaDependencies['spotless-maven-plugin'] %></spotless-maven-plugin.version>
<spring-boot.version><%- javaDependencies['spring-boot'] %></spring-boot.version>
</properties>

<dependencies>
Expand All @@ -115,20 +121,6 @@
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<%_ } _%>
<%_ if ((applicationTypeMicroservice || applicationTypeGateway) && reactive) { _%>
<dependency>
<groupId>com.playtika.reactivefeign</groupId>
<artifactId>feign-reactor-cloud</artifactId>
</dependency>
<dependency>
<groupId>com.playtika.reactivefeign</groupId>
<artifactId>feign-reactor-spring-configuration</artifactId>
</dependency>
<dependency>
<groupId>com.playtika.reactivefeign</groupId>
<artifactId>feign-reactor-webclient</artifactId>
</dependency>
<%_ } _%>
<dependency>
<groupId>com.tngtech.archunit</groupId>
Expand Down Expand Up @@ -826,7 +818,6 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<executions>
<execution>
<goals>
Expand Down
47 changes: 38 additions & 9 deletions generators/spring-boot/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,20 +410,43 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) {
get postWriting() {
return this.asPostWritingTaskGroup({
addJHipsterBomDependencies({ application, source }) {
const { applicationTypeGateway, applicationTypeMicroservice, javaDependencies, jhipsterDependenciesVersion, messageBrokerAny } =
application;
const { serviceDiscoveryAny } = application as any;

source.addJavaDependencies?.([
{
groupId: 'tech.jhipster',
artifactId: 'jhipster-dependencies',
version: application.jhipsterDependenciesVersion!,
type: 'pom',
scope: 'import',
},
{ groupId: 'tech.jhipster', artifactId: 'jhipster-framework' },
{ groupId: 'tech.jhipster', artifactId: 'jhipster-framework', version: jhipsterDependenciesVersion! },
]);

if (applicationTypeGateway || applicationTypeMicroservice || serviceDiscoveryAny || messageBrokerAny) {
source.addJavaDependencies?.([
{
groupId: 'org.springframework.cloud',
artifactId: 'spring-cloud-dependencies',
type: 'pom',
scope: 'import',
version: javaDependencies!['spring-cloud-dependencies'],
},
]);
}
},
addSpringdoc({ application, source }) {
const springdocDependency = `springdoc-openapi-starter-${application.reactive ? 'webflux' : 'webmvc'}-api`;
source.addJavaDependencies?.([{ groupId: 'org.springdoc', artifactId: springdocDependency }]);
source.addJavaDependencies?.([
{ groupId: 'org.springdoc', artifactId: springdocDependency, version: application.javaDependencies!.springdoc },
]);
},
addFeignReactor({ application, source }) {
const { applicationTypeGateway, applicationTypeMicroservice, javaDependencies, reactive } = application;
if ((applicationTypeMicroservice || applicationTypeGateway) && reactive) {
const groupId = 'com.playtika.reactivefeign';
source.addJavaDependencies?.([
{ groupId, artifactId: 'feign-reactor-bom', type: 'pom', scope: 'import', version: javaDependencies!['feign-reactor-bom'] },
{ groupId, artifactId: 'feign-reactor-cloud' },
{ groupId, artifactId: 'feign-reactor-spring-configuration' },
{ groupId, artifactId: 'feign-reactor-webclient' },
]);
}
},
addSpringSnapshotRepository({ application, source }) {
if (application.buildToolMaven) {
Expand Down Expand Up @@ -459,6 +482,12 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) {
version: application.javaDependencies!['spring-boot'],
addToBuild: true,
},
{
pluginName: 'spring-dependency-management',
id: 'io.spring.dependency-management',
version: application.javaDependencies!['spring-dependency-management'],
addToBuild: true,
},
]);
}
},
Expand Down
4 changes: 2 additions & 2 deletions generators/spring-data-cassandra/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ export default class CassandraGenerator extends BaseApplicationGenerator {
});
},
addDependencies({ application, source }) {
const { reactive } = application;
const { reactive, javaDependencies } = application;

const cassandraStarter = reactive ? 'spring-boot-starter-data-cassandra-reactive' : 'spring-boot-starter-data-cassandra';
source.addJavaDependencies?.([
{ groupId: 'com.datastax.oss', artifactId: 'java-driver-mapper-runtime' },
{ groupId: 'commons-codec', artifactId: 'commons-codec' },
{ groupId: 'org.springframework.boot', artifactId: cassandraStarter },
{ groupId: 'org.lz4', artifactId: 'lz4-java' },
{ groupId: 'org.lz4', artifactId: 'lz4-java', version: javaDependencies['lz4-java'] },
{ scope: 'test', groupId: 'org.testcontainers', artifactId: 'junit-jupiter' },
{ scope: 'test', groupId: 'org.testcontainers', artifactId: 'testcontainers' },
{ scope: 'test', groupId: 'org.testcontainers', artifactId: 'cassandra' },
Expand Down
3 changes: 2 additions & 1 deletion generators/spring-data-mongodb/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ export default class MongoDBGenerator extends BaseApplicationGenerator {
});
},
addDependencies({ application, source }) {
const { reactive } = application;
const { reactive, javaDependencies } = application;
source.addJavaDependencies?.([
{ groupId: 'io.mongock', artifactId: 'mongock-bom', type: 'pom', version: javaDependencies['mongock-bom'], scope: 'import' },
{ groupId: 'io.mongock', artifactId: 'mongock-springboot-v3' },
{ groupId: 'org.springframework.boot', artifactId: `spring-boot-starter-data-mongodb${reactive ? '-reactive' : ''}` },
{ groupId: 'io.mongock', artifactId: reactive ? 'mongodb-reactive-driver' : 'mongodb-springdata-v4-driver' },
Expand Down
8 changes: 7 additions & 1 deletion generators/spring-data-neo4j/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ export default class Neo4jGenerator extends BaseApplicationGenerator {
{ scope: 'test', groupId: 'org.testcontainers', artifactId: 'neo4j' },
]);
if (!application.databaseMigrationLiquibase) {
source.addJavaDependencies?.([{ groupId: 'eu.michael-simons.neo4j', artifactId: 'neo4j-migrations-spring-boot-starter' }]);
source.addJavaDependencies?.([
{
groupId: 'eu.michael-simons.neo4j',
artifactId: 'neo4j-migrations-spring-boot-starter',
version: application.javaDependencies!['neo4j-migrations-spring-boot-starter'],
},
]);
}
},
});
Expand Down

0 comments on commit 7bb5694

Please sign in to comment.