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

Properties case style fix #12559

Merged
merged 4 commits into from
Sep 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generators/openapi-client/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ function writeFiles() {
// eslint-disable-next-line no-template-curly-in-string
this.addMavenDependency('org.openapitools', 'jackson-databind-nullable', '${jackson-databind-nullable.version}');
} else if (this.buildTool === 'gradle') {
this.addGradleProperty('jackson_databind_nullable_version', constants.JACKSON_DATABIND_NULLABLE_VERSION);
this.addGradleProperty('jacksonDatabindNullableVersion', constants.JACKSON_DATABIND_NULLABLE_VERSION);
this.addGradleDependency(
'compile',
'org.openapitools',
'jackson-databind-nullable',
// eslint-disable-next-line no-template-curly-in-string
'${jackson_databind_nullable_version}'
'${jacksonDatabindNullableVersion}'
);
}
}
Expand Down
46 changes: 23 additions & 23 deletions generators/server/templates/build.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if (project.hasProperty("gae")) {

dependencyManagement {
imports {
mavenBom "io.github.jhipster:jhipster-dependencies:${jhipster_dependencies_version}"
mavenBom "io.github.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}"
}
}
appengineStage.dependsOn thinResolve
Expand Down Expand Up @@ -236,7 +236,7 @@ gitProperties {
}

checkstyle {
toolVersion '${checkstyle_version}'
toolVersion '${checkstyleVersion}'
configFile file("checkstyle.xml")
checkstyleTest.enabled = false
}
Expand Down Expand Up @@ -277,10 +277,10 @@ repositories {
dependencies {
// import JHipster dependencies BOM
if (!project.hasProperty("gae")) {
implementation platform("io.github.jhipster:jhipster-dependencies:${jhipster_dependencies_version}")
implementation platform("io.github.jhipster:jhipster-dependencies:${jhipsterDependenciesVersion}")
}

// Use ", version: jhipster_dependencies_version, changing: true" if you want
// Use ", version: jhipsterDependenciesVersion, changing: true" if you want
// to use a SNAPSHOT release instead of a stable release
implementation group: "io.github.jhipster", name: "jhipster-framework"<% if (reactive) { %>, {
exclude group: "org.springframework", module: "spring-webmvc"
Expand Down Expand Up @@ -347,7 +347,7 @@ dependencies {
implementation "commons-codec:commons-codec"
<%_ } _%>
<%_ if (enableSwaggerCodegen) { _%>
implementation "org.openapitools:jackson-databind-nullable:${jackson_databind_nullable_version}"
implementation "org.openapitools:jackson-databind-nullable:${jacksonDatabindNullableVersion}"
<%_ } _%>
implementation "javax.transaction:javax.transaction-api"
<%_ if (databaseType === 'cassandra') { _%>
Expand All @@ -360,9 +360,9 @@ dependencies {
<%_ } _%>
<%_ } _%>
<%_ if (cacheProvider === 'caffeine') { _%>
implementation "com.github.ben-manes.caffeine:caffeine:${caffeine_version}"
implementation "com.github.ben-manes.caffeine:jcache:${caffeine_version}"
implementation "com.typesafe:config:${typesafe_config_version}"
implementation "com.github.ben-manes.caffeine:caffeine:${caffeineVersion}"
implementation "com.github.ben-manes.caffeine:jcache:${caffeineVersion}"
implementation "com.typesafe:config:${typesafeConfigVersion}"
<%_ if (enableHibernateCache) { _%>
implementation "org.hibernate:hibernate-jcache"
<%_ } _%>
Expand All @@ -375,7 +375,7 @@ dependencies {
implementation "org.liquibase:liquibase-core"
<%_ if (!reactive) { _%>
liquibaseRuntime "org.liquibase:liquibase-core"
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibase_hibernate5_version}"
liquibaseRuntime "org.liquibase.ext:liquibase-hibernate5:${liquibaseHibernate5Version}"
liquibaseRuntime sourceSets.main.compileClasspath
<%_ } _%>
<%_ } _%>
Expand Down Expand Up @@ -500,7 +500,7 @@ dependencies {
<%_ if (authenticationType === 'uaa') { _%>
implementation "org.springframework.security.oauth:spring-security-oauth2"
implementation "org.springframework.security:spring-security-jwt"
<% if (databaseType === 'sql') { %>implementation<% } else { %>runtimeOnly<% } %> "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
<% if (databaseType === 'sql') { %>implementation<% } else { %>runtimeOnly<% } %> "org.glassfish.jaxb:jaxb-runtime:${jaxbRuntimeVersion}"
<%_ } _%>
<%_ if (databaseType === 'mongodb') { _%>
implementation "com.github.cloudyrock.mongock:mongock-spring-v5"
Expand Down Expand Up @@ -535,7 +535,7 @@ dependencies {
<%_ if (!reactive) { _%>
liquibaseRuntime "org.mariadb.jdbc:mariadb-java-client"
<%_ } else { _%>
implementation "org.mariadb:r2dbc-mariadb:${r2dbc_mariadb_version}"
implementation "org.mariadb:r2dbc-mariadb:${r2dbcMariadbVersion}"
<%_ } _%>
<%_ } _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
Expand All @@ -548,16 +548,16 @@ dependencies {
implementation "io.r2dbc:r2dbc-mssql"
<%_ } _%>
<%_ } _%>
implementation "org.mapstruct:mapstruct:${mapstruct_version}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstruct_version}"
implementation "org.mapstruct:mapstruct:${mapstructVersion}"
annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}"
<%_ if (databaseType === 'sql') { _%>
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernate_version}"
annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxb_runtime_version}"
annotationProcessor "org.hibernate:hibernate-jpamodelgen:${hibernateVersion}"
annotationProcessor "org.glassfish.jaxb:jaxb-runtime:${jaxbRuntimeVersion}"
<%_ } _%>
<%_ if (databaseType === 'cassandra') { _%>
annotationProcessor "com.datastax.oss:java-driver-mapper-processor:${cassandra_driver_version}"
annotationProcessor "com.datastax.oss:java-driver-mapper-processor:${cassandraDriverVersion}"
<%_ } _%>
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${spring_boot_version}"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"
<%_ if (databaseType === 'cassandra') { _%>
testImplementation ("org.cassandraunit:cassandra-unit-spring") {
exclude(group: "org.slf4j")
Expand All @@ -578,11 +578,11 @@ dependencies {
testImplementation "org.springframework.boot:spring-boot-test"
<%_ if (reactive) { _%>
// Temporarily disabled see https://github.com/jhipster/generator-jhipster/issues/11599
// testImplementation "io.projectreactor.tools:blockhound-junit-platform:${blockhound_junit_platform_version}"
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:${junit_platform_launcher_version}'
// testImplementation "io.projectreactor.tools:blockhound-junit-platform:${blockhoundJunitPlatformVersion}"
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:${junitPlatformLauncherVersion}'
<%_ } _%>
testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunit_junit5_version}"
testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunit_junit5_version}"
testImplementation "com.tngtech.archunit:archunit-junit5-api:${archunitJunit5Version}"
testRuntimeOnly "com.tngtech.archunit:archunit-junit5-engine:${archunitJunit5Version}"
<%_ if (databaseType === 'mongodb') { _%>
testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo"
<%_ } _%>
Expand Down Expand Up @@ -639,8 +639,8 @@ wrapper {

if (project.hasProperty("nodeInstall")) {
node {
version = "${node_version}"
npmVersion = "${npm_version}"
version = "${nodeVersion}"
npmVersion = "${npmVersion}"
download = true
}
}
Expand Down
59 changes: 28 additions & 31 deletions generators/server/templates/gradle.properties.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -20,65 +20,62 @@ rootProject.name=<%= dasherizedBaseName %>
profile=dev

# Build properties
node_version=<%= NODE_VERSION %>
npm_version=<%= NPM_VERSION %>
nodeVersion=<%= NODE_VERSION %>
npmVersion=<%= NPM_VERSION %>

# Dependency versions
jhipster_dependencies_version=<%= JHIPSTER_DEPENDENCIES_VERSION %>
jhipsterDependenciesVersion=<%= JHIPSTER_DEPENDENCIES_VERSION %>
# The spring-boot version should match the one managed by
# https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/${jhipster_dependencies_version}
spring_boot_version=<%= SPRING_BOOT_VERSION %>
# https://mvnrepository.com/artifact/io.github.jhipster/jhipster-dependencies/<%= JHIPSTER_DEPENDENCIES_VERSION %>
springBootVersion=<%= SPRING_BOOT_VERSION %>
# The hibernate version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version} -->
hibernate_version=<%= HIBERNATE_VERSION %>
mapstruct_version=1.3.1.Final
archunit_junit5_version=0.14.1
<%_ if (searchEngine === 'elasticsearch') { _%>
log4j2_mock_version=0.0.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I forgot to remove it during the Elasticsearch upgrade: #11683
Could you do me a favour, and also remove it in pom.xml.ejs template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure 🙂

<%_ } _%>
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/<%= SPRING_BOOT_VERSION %> -->
hibernateVersion=<%= HIBERNATE_VERSION %>
mapstructVersion=1.3.1.Final
archunitJunit5Version=0.14.1
<%_ if (enableSwaggerCodegen) { _%>
jackson_databind_nullable_version=<%= JACKSON_DATABIND_NULLABLE_VERSION %>
jacksonDatabindNullableVersion=<%= JACKSON_DATABIND_NULLABLE_VERSION %>
<%_ } _%>
<%_ if (cacheProvider === 'caffeine') { _%>
caffeine_version=2.8.5
typesafe_config_version=1.4.0
caffeineVersion=2.8.5
typesafeConfigVersion=1.4.0
<%_ } _%>
<%_ if (databaseType === 'sql' && !reactive) { _%>
liquibase_hibernate5_version=3.10.2
liquibaseHibernate5Version=3.10.2
liquibaseTaskPrefix=liquibase
<%_ } _%>

<%_ if (reactive) { _%>
blockhound_junit_platform_version=1.0.4.RELEASE
junit_platform_launcher_version=1.6.2
r2dbc_mariadb_version=0.8.2-alpha2
blockhoundJunitPlatformVersion=1.0.4.RELEASE
junitPlatformLauncherVersion=1.6.2
r2dbcMariadbVersion=0.8.2-alpha2
<%_ } _%>

<%_ if (databaseType === 'sql' || authenticationType === 'uaa') { _%>
jaxb_runtime_version=2.3.3
jaxbRuntimeVersion=2.3.3
<%_ } _%>
<%_ if (databaseType === 'cassandra') { _%>
# The cassandra driver version should match the one managed by
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/${spring-boot.version}
cassandra_driver_version=4.6.1
# https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies/<%= SPRING_BOOT_VERSION %>
cassandraDriverVersion=4.6.1
<%_ } _%>

# gradle plugin version
jib_plugin_version=<%= JIB_VERSION %>
git_properties_plugin_version=2.2.3
jibPluginVersion=<%= JIB_VERSION %>
gitPropertiesPluginVersion=2.2.3
<%_ if (!skipClient) { _%>
gradle_node_plugin_version=2.2.4
gradleNodePluginVersion=2.2.4
<%_ } _%>
apt_plugin_version=0.21
aptPluginVersion=0.21
<%_ if (databaseType === 'sql' && !reactive) { _%>
liquibase_plugin_version=2.0.4
liquibasePluginVersion=2.0.4
<%_ } _%>
sonarqube_plugin_version=3.0
sonarqubePluginVersion=3.0
<%_ if (enableSwaggerCodegen) { _%>
openapi_plugin_version=4.3.1
openapiPluginVersion=4.3.1
<%_ } _%>
spring_no_http_plugin_version=0.0.5.RELEASE
checkstyle_version=8.36
springNoHttpPluginVersion=0.0.5.RELEASE
checkstyleVersion=8.36

# jhipster-needle-gradle-property - JHipster will add additional properties here

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 @@ -17,7 +17,7 @@
limitations under the License.
-%>
dependencies {
developmentOnly "org.springframework.boot:spring-boot-devtools:${spring_boot_version}"
developmentOnly "org.springframework.boot:spring-boot-devtools:${springBootVersion}"
<%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%>
implementation "com.h2database:h2"
<%_ } _%>
Expand Down
3 changes: 0 additions & 3 deletions generators/server/templates/pom.xml.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@
<cassandra-driver.version>4.6.1</cassandra-driver.version>
<%_ } _%>
<archunit-junit5.version>0.14.1</archunit-junit5.version>
<%_ if (searchEngine === 'elasticsearch') { _%>
<log4j2-mock.version>0.0.2</log4j2-mock.version>
<%_ } _%>
<mapstruct.version>1.3.1.Final</mapstruct.version>
<%_ if (enableSwaggerCodegen) { _%>
<jackson-databind-nullable.version><%= JACKSON_DATABIND_NULLABLE_VERSION %></jackson-databind-nullable.version>
Expand Down
22 changes: 11 additions & 11 deletions generators/server/templates/settings.gradle.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ pluginManagement {
}
<%_ } _%>
plugins {
id 'org.springframework.boot' version "${spring_boot_version}"
id 'com.google.cloud.tools.jib' version "${jib_plugin_version}"
id 'com.gorylenko.gradle-git-properties' version "${git_properties_plugin_version}"
id 'org.springframework.boot' version "${springBootVersion}"
id 'com.google.cloud.tools.jib' version "${jibPluginVersion}"
id 'com.gorylenko.gradle-git-properties' version "${gitPropertiesPluginVersion}"
<%_ if (enableSwaggerCodegen) { _%>
id "org.openapi.generator" version "${openapi_plugin_version}"
id "org.openapi.generator" version "${openapiPluginVersion}"
<%_ } _%>
<%_ if (!skipClient) { _%>
id 'com.github.node-gradle.node' version "${gradle_node_plugin_version}"
id 'com.github.node-gradle.node' version "${gradleNodePluginVersion}"
<%_ } _%>
<%_ if (databaseType === 'sql' && !reactive) { _%>
id 'org.liquibase.gradle' version "${liquibase_plugin_version}"
id 'org.liquibase.gradle' version "${liquibasePluginVersion}"
<%_ } _%>
id 'org.sonarqube' version "${sonarqube_plugin_version}"
id 'net.ltgt.apt-eclipse' version "${apt_plugin_version}"
id 'net.ltgt.apt-idea' version "${apt_plugin_version}"
id 'net.ltgt.apt' version "${apt_plugin_version}"
id "io.spring.nohttp" version "${spring_no_http_plugin_version}"
id 'org.sonarqube' version "${sonarqubePluginVersion}"
id 'net.ltgt.apt-eclipse' version "${aptPluginVersion}"
id 'net.ltgt.apt-idea' version "${aptPluginVersion}"
id 'net.ltgt.apt' version "${aptPluginVersion}"
id "io.spring.nohttp" version "${springNoHttpPluginVersion}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if [[ -a mvnw ]]; then
cat pom.xml | grep \<jhipster-dependencies.version\>

elif [[ -a gradlew ]]; then
sed -e 's/jhipster_dependencies_version=.*/jhipster_dependencies_version='$JHI_VERSION'/1;' gradle.properties > gradle.properties.sed
sed -e 's/jhipsterDependenciesVersion=.*/jhipsterDependenciesVersion='$JHI_VERSION'/1;' gradle.properties > gradle.properties.sed
mv -f gradle.properties.sed gradle.properties
cat gradle.properties | grep jhipster_dependencies_version=
cat gradle.properties | grep jhipsterDependenciesVersion=

fi
4 changes: 4 additions & 0 deletions test/needle-api/needle-server-gradle.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ describe('needle API server gradle: JHipster server generator with blueprint', (
assert.fileContent('gradle.properties', 'name=value');
});

it('Assert gradle.properties has not snake case properties', () => {
assert.noFileContent('gradle.properties', /^(?!.*#).*_.*$/m); // Not comment and contains underscore
});

it('Assert gradle.properties has the plugin added', () => {
assert.fileContent('build.gradle', 'classpath "group:name:version"');
});
Expand Down