jhipster / jhipster-kotlin

Kotlin based JHipster
https://khipster.dev
Apache License 2.0
449 stars 95 forks source link

CacheConfiguration.kt is not generated correctly #211

Closed spotlesscoder closed 4 years ago

spotlesscoder commented 4 years ago

Overview of the issue

I tried to generate a new microservices application with jhipster-kotlin. It cannot be built.

See the log:

INFO! Using JHipster version installed globally
INFO! Running default command
INFO! Executing jhipster:app
INFO! Options: blueprints: kotlin, from-cli: true

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝

                            https://www.jhipster.tech

Welcome to JHipster v6.4.1
Application files will be generated in folder: /home/user/gitrepos/khsdev
 _______________________________________________________________________________________________________________

  Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/
  If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster
 _______________________________________________________________________________________________________________

 ______________________________________________________________________________

  JHipster update available: 6.6.0 (current: 6.4.1)

  Run npm install -g generator-jhipster to update.

 ______________________________________________________________________________

? Which *type* of application would you like to create? Microservice application
? What is the base name of your application? khsdev
     info Using blueprint generator-jhipster-kotlin for server subgenerator
? As you are running in a microservice architecture, on which port would like your server to run? It should be unique to avoid port conflicts. 8081
? What is your default Java package name? org.codingspiderfox
? Which service discovery server do you want to use? JHipster Registry (uses Eureka, provides Spring Cloud Config support and monitoring dashboards)
? Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
? Which *type* of database would you like to use? SQL (H2, MySQL, MariaDB, PostgreSQL, Oracle, MSSQL)
? Which *production* database would you like to use? PostgreSQL
? Which *development* database would you like to use? H2 with in-memory persistence
? Do you want to use the Spring cache abstraction? [BETA] Yes, with the Infinispan implementation (hybrid cache, for multiple nodes)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Gradle
? Which other technologies would you like to use? Search engine using Elasticsearch, Asynchronous messages using Apache Kafka, API first development using OpenAPI-generator
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install German
? Besides JUnit and Jest, which testing frameworks would you like to use? Cucumber
? Would you like to install other generators from the JHipster Marketplace? Yes
? Which other modules would you like to use? (generator-jhipster-nav-element-2.2.0) A generator to scaffold a new page (and the corresponding navigation menu) in a JHipster project., (generator-jhipster-docker-2.5.0) Additional Docker supp
ort: Docker Hub, Local SMTP Server, NGinx, (generator-jhipster-swagger-cli-3.0.1) JHipster module to generate swagger client code from a swagger definition

Installing languages: en, de for server
Git repository initialized.

KeyStore 'src/main/resources/config/tls/keystore.p12' generated successfully.

Unable to find src/test/java/undefined/service/MailServiceIT.java or missing required jhipster-needle. LANGUAGE constant not updated with languages: en,de since block was not found. Check if you have enabled translation support.

   create .prettierrc
   create .prettierignore
   create src/main/jib/entrypoint.sh
   create build.gradle
   create settings.gradle
   create gradle.properties
   create gradle/sonar.gradle
   create gradle/docker.gradle
   create gradle/profile_dev.gradle
   create gradle/profile_prod.gradle
   create gradle/war.gradle
   create gradle/zipkin.gradle
   create gradlew
   create gradlew.bat
   create gradle/wrapper/gradle-wrapper.jar
   create gradle/wrapper/gradle-wrapper.properties
   create gradle/swagger.gradle
   create gradle/kotlin.gradle
   create src/main/resources/banner.txt
   create src/main/resources/.h2.server.properties
   create src/main/resources/templates/error.html
   create src/main/resources/logback-spring.xml
   create src/main/resources/i18n/messages.properties
   create src/main/resources/config/liquibase/changelog/00000000000000_initial_schema.xml
   create src/main/resources/config/liquibase/master.xml
   create src/main/kotlin/org/codingspiderfox/security/SpringSecurityAuditorAware.kt
   create src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt
   create src/main/kotlin/org/codingspiderfox/security/AuthoritiesConstants.kt
   create src/test/kotlin/org/codingspiderfox/security/SecurityUtilsUnitTest.kt
   create src/main/kotlin/org/codingspiderfox/security/jwt/TokenProvider.kt
   create src/main/kotlin/org/codingspiderfox/security/jwt/JWTFilter.kt
   create src/main/kotlin/org/codingspiderfox/security/jwt/JWTConfigurer.kt
   create src/main/kotlin/org/codingspiderfox/config/SecurityConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/FeignConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/client/UserFeignClientInterceptor.kt
   create src/main/resources/static/index.html
   create src/main/kotlin/org/codingspiderfox/KhsdevApp.kt
   create src/main/kotlin/org/codingspiderfox/ApplicationWebXml.kt
   create src/test/kotlin/org/codingspiderfox/ArchTest.kt
   create src/main/kotlin/org/codingspiderfox/aop/logging/LoggingAspect.kt
   create src/main/kotlin/org/codingspiderfox/config/DefaultProfileUtil.kt
   create src/main/kotlin/org/codingspiderfox/config/AsyncConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/DateTimeFormatConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/LoggingConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/ApplicationProperties.kt
   create src/main/kotlin/org/codingspiderfox/config/JacksonConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/LocaleConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/LoggingAspectConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/WebConfigurer.kt
   create src/main/kotlin/org/codingspiderfox/config/Constants.kt
   create src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/CacheFactoryConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/CloudDatabaseConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/DatabaseConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/audit/AuditEventConverter.kt
   create src/main/kotlin/org/codingspiderfox/config/LiquibaseConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/config/ElasticsearchConfiguration.kt
   create src/main/kotlin/org/codingspiderfox/domain/AbstractAuditingEntity.kt
   create src/main/kotlin/org/codingspiderfox/domain/PersistentAuditEvent.kt
   create src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaConsumer.kt
   create src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt
   create src/main/kotlin/org/codingspiderfox/config/KafkaProperties.kt
   create src/main/kotlin/org/codingspiderfox/web/rest/errors/BadRequestAlertException.kt
   create src/main/kotlin/org/codingspiderfox/web/rest/errors/ErrorConstants.kt
   create src/main/kotlin/org/codingspiderfox/web/rest/errors/ExceptionTranslator.kt
   create src/main/kotlin/org/codingspiderfox/web/rest/errors/FieldErrorVM.kt
   create src/main/kotlin/org/codingspiderfox/web/rest/KhsdevKafkaResource.kt
   create src/test/kotlin/org/codingspiderfox/web/rest/TestUtil.kt
   create src/test/kotlin/org/codingspiderfox/web/rest/errors/ExceptionTranslatorIT.kt
   create src/test/kotlin/org/codingspiderfox/web/rest/errors/ExceptionTranslatorTestController.kt
   create src/test/kotlin/org/codingspiderfox/config/timezone/HibernateTimeZoneIT.kt
   create src/test/kotlin/org/codingspiderfox/repository/timezone/DateTimeWrapper.kt
   create src/test/kotlin/org/codingspiderfox/repository/timezone/DateTimeWrapperRepository.kt
   create src/test/resources/logback.xml
   create src/test/kotlin/org/codingspiderfox/config/WebConfigurerTest.kt
   create src/test/kotlin/org/codingspiderfox/config/WebConfigurerTestController.kt
   create src/test/kotlin/org/codingspiderfox/cucumber/CucumberIT.kt
   create src/test/kotlin/org/codingspiderfox/cucumber/stepdefs/StepDefs.kt
   create src/test/kotlin/org/codingspiderfox/cucumber/CucumberContextConfiguration.kt
   create src/test/features/gitkeep
   create src/test/kotlin/org/codingspiderfox/web/rest/KhsdevKafkaResourceIT.kt
   create src/test/kotlin/org/codingspiderfox/security/jwt/TokenProviderTest.kt
   create src/test/kotlin/org/codingspiderfox/security/jwt/JWTFilterTest.kt
   create .gitignore
   create .gitattributes
   create .editorconfig
   create sonar-project.properties
   create src/main/resources/i18n/messages_en.properties
   create src/test/resources/i18n/messages_en.properties
   create src/main/resources/i18n/messages_de.properties
   create src/test/resources/i18n/messages_de.properties
   create package.json
   create src/main/docker/app.yml
   create src/main/docker/sonar.yml
   create src/main/docker/monitoring.yml
   create src/main/docker/prometheus/prometheus.yml
   create src/main/docker/grafana/provisioning/dashboards/dashboard.yml
   create src/main/docker/grafana/provisioning/dashboards/JVM.json
   create src/main/docker/grafana/provisioning/datasources/datasource.yml
   create src/main/docker/postgresql.yml
   create src/main/docker/elasticsearch.yml
   create src/main/docker/kafka.yml
   create src/main/docker/central-server-config/README.md
   create src/main/docker/jhipster-registry.yml
   create src/main/docker/central-server-config/docker-config/application.yml
   create src/main/docker/central-server-config/localhost-config/application.yml
   create src/main/docker/swagger-editor.yml
   create detekt-config.yml
   create src/main/resources/swagger/api.yml
   create src/main/resources/config/application.yml
   create src/main/resources/config/application-dev.yml
   create src/main/resources/config/application-tls.yml
   create src/main/resources/config/application-prod.yml
   create src/main/resources/config/bootstrap.yml
   create src/main/resources/config/bootstrap-prod.yml
   create src/test/resources/config/application.yml
   create src/test/resources/config/bootstrap.yml
   create README.md

Installing generator-jhipster@6.4.1 locally using npm
     info Running ktlint...
Starting a Gradle Daemon, 1 busy and 1 incompatible Daemons could not be reused, use --status for details
> Task :ktlintKotlinScriptFormat NO-SOURCE

> Task :ktlintMainSourceSetFormat
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt:185:42: Not a valid Kotlin file (expecting an element) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:59:54: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:61:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:65:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:14:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:16:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:18:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:28:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:37:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
"plain" report written to /home/user/gitrepos/khsdev/build/reports/ktlint/ktlintMainSourceSetFormat.txt

> Task :ktlintTestSourceSetFormat
> Task :ktlintFormat

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.6.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 30s
2 actionable tasks: 2 executed
     info Finished formatting Kotlin files in : 31321ms
npm WARN deprecated cross-spawn-async@2.2.5: cross-spawn no longer requires a build toolchain, use it instead

> core-js@3.6.1 postinstall /home/user/gitrepos/khsdev/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> spawn-sync@1.0.15 postinstall /home/user/gitrepos/khsdev/node_modules/spawn-sync
> node postinstall

> yo@3.1.0 postinstall /home/user/gitrepos/khsdev/node_modules/yo
> yodoctor

Yeoman Doctor
Running sanity checks on your system

✔ No .bowerrc file in home directory
✔ Global configuration file is valid
✔ NODE_PATH matches the npm root
✔ No .yo-rc.json file in home directory
✔ Node.js version
✔ npm version
✖ yo version

Your yo version is outdated.

Upgrade to the latest version by running:
npm install -g yo@latest

Found potential issues on your machine :(
npm notice created a lockfile as package-lock.json. You should commit this file.
added 1003 packages from 513 contributors and audited 37987 packages in 41.011s

10 packages are looking for funding
  run `npm fund` for details

found 10 vulnerabilities (7 low, 1 moderate, 1 high, 1 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Application successfully committed to Git from /home/user/gitrepos/khsdev.

If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Server application generated successfully.

Run your Spring Boot application:
./gradlew
INFO! Congratulations, JHipster execution is complete!
 user@host  ~/gitrepos/khsdev   master  ./gradlew

> Task :ktlintMainSourceSetFormat
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt:185:42: Not a valid Kotlin file (expecting an element) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:60:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:62:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/security/SecurityUtils.kt:66:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:14:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:16:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:18:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:27:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
/home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/service/KhsdevKafkaProducer.kt:36:1: Unexpected indentation (2) (it should be 4) (cannot be auto-corrected)
"plain" report written to /home/user/gitrepos/khsdev/build/reports/ktlint/ktlintMainSourceSetFormat.txt

> Task :kaptGenerateStubsKotlin
e: /home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt: (185, 42): Expecting an element
e: /home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt: (185, 58): Expecting an element
e: /home/user/gitrepos/khsdev/src/main/kotlin/org/codingspiderfox/config/CacheConfiguration.kt: (185, 61): Expecting an expression
sendilkumarn commented 4 years ago

Thanks for reporting the issue. This will be fixed in the next release. Currently the master has the fix.

spotlesscoder commented 4 years ago

Nice!

How can I install the new version from the master branch on my computer?

sendilkumarn commented 4 years ago

Use the latest 1.4.0 version. This should be automatically fixed. Feel free to re-open the issue, if you are facing it again. Thanks :)

spotlesscoder commented 4 years ago

Thanks How can I check the installed version or upgrade?

spotlesscoder commented 4 years ago

Ping

sendilkumarn commented 4 years ago

upgrade

npm I -g generator-jhipster-kotlin