jhipster / generator-jhipster-quarkus

Quarkus blueprint for JHipster
https://www.jhipster.tech/blueprints/quarkus/
Apache License 2.0
141 stars 56 forks source link

Upgrade to Quarkus 3 #285

Closed mraible closed 1 year ago

mraible commented 1 year ago

https://quarkus.io/blog/quarkus-3-0-final-released/

mraible commented 1 year ago

I changed the version and did a find/replace on javax with jakarta. Then, I did npm link and created a new project. There's lots of debug warnings by default, which doesn't seem necessary, unless they only happen when using npm link.

➜  quarkus jhipster -d --blueprints quarkus
INFO! Using bundled JHipster
INFO! No custom sharedOptions found within blueprint: generator-jhipster-quarkus at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster-quarkus
INFO! No custom commands found within blueprint: generator-jhipster-quarkus at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster-quarkus
INFO! Debug logging is on
DEBUG!  cmd: lazyBuildCommand app
(node:56942) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./lib/util/" in the "exports" field module resolution of the package at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/yeoman-environment/package.json.
Update this package.json to use a subpath pattern like "./lib/util/*".
(Use `node --trace-deprecation ...` to show where the warning was created)
DEBUG!  cmd: action

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v7.9.3

DEBUG! Found blueprint generator-jhipster-quarkus and app with namespace jhipster-quarkus:app
     info Using blueprint generator-jhipster-quarkus for app subgenerator
(node:56942) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./generators/" in the "exports" field module resolution of the package at /Users/mraible/dev/generator-jhipster-quarkus/node_modules/generator-jhipster/package.json.
Update this package.json to use a subpath pattern like "./generators/*".
(node:56942) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./lib/util/" in the "exports" field module resolution of the package at /Users/mraible/dev/generator-jhipster-quarkus/node_modules/generator-jhipster/node_modules/yeoman-environment/package.json.
Update this package.json to use a subpath pattern like "./lib/util/*".

             ██████╗  ██╗   ██╗  █████╗  ██████╗  ██╗  ██╗ ██╗   ██╗ ███████╗
            ██╔═══██╗ ██║   ██║ ██╔══██╗ ██╔══██╗ ██║ ██╔╝ ██║   ██║ ██╔════╝
            ██║   ██║ ██║   ██║ ███████║ ██████╔╝ █████╔╝  ██║   ██║ ███████╗
            ██║▄▄ ██║ ██║   ██║ ██╔══██║ ██╔══██╗ ██╔═██╗  ██║   ██║ ╚════██║
            ╚██████╔╝ ╚██████╔╝ ██║  ██║ ██║  ██║ ██║  ██╗ ╚██████╔╝ ███████║
             ╚══▀▀═╝   ╚═════╝  ╚═╝  ╚═╝ ╚═╝  ╚═╝ ╚═╝  ╚═╝  ╚═════╝  ╚══════╝
                            https://www.jhipster.tech - https://quarkus.io

Welcome to JHipster Quarkus v2.0.0
Application files will be generated in folder: /Users/mraible/Downloads/quarkus
 _______________________________________________________________________________________________________________

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

? What is the base name of your application? jakarta
DEBUG! Found blueprint generator-jhipster-quarkus and common with namespace jhipster-quarkus:common
     info Using blueprint generator-jhipster-quarkus for common subgenerator
DEBUG! Found blueprint generator-jhipster-quarkus and server with namespace jhipster-quarkus:server
     info Using blueprint generator-jhipster-quarkus for server subgenerator
DEBUG! Found blueprint generator-jhipster-quarkus and client with namespace jhipster-quarkus:client
     info Using blueprint generator-jhipster-quarkus for client subgenerator
DEBUG! No blueprint found for blueprint generator-jhipster-quarkus and languages with namespace jhipster-quarkus:languages subgenerator: falling back to default generator
? What is your default Java package name? com.mycompany.myapp
? 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 disk-based persistence
? Do you want to use the Quarkus cache abstraction? Yes, with the Caffeine implementation (local cache, for a single
node)
? Do you want to use Hibernate 2nd level cache? Yes
? Would you like to use Maven or Gradle for building the backend? Maven
? Which *Framework* would you like to use for the client? Angular
? Do you want to generate the admin UI? Yes
? Would you like to use a Bootswatch theme (https://bootswatch.com/)? Default JHipster
? Would you like to enable internationalization support? Yes
? Please choose the native language of the application English
? Please choose additional languages to install
? Besides Junit, which testing frameworks would you like to use?
DEBUG! Time taken to write files: 6ms
DEBUG! Time taken to write files: 1ms
DEBUG! Multiples templates were found for file README.md.jhi, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/common/templates/README.md.jhi",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/common/templates/README.md.jhi"
]
DEBUG! Time taken to write files: 7ms
DEBUG! Time taken to write files: 58ms
DEBUG! Time taken to write files: 20ms
DEBUG! Multiples templates were found for file src/main/webapp/app/admin/health/health.module.ts, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/client/templates/angular/src/main/webapp/app/admin/health/health.module.ts",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/client/templates/angular/src/main/webapp/app/admin/health/health.module.ts"
]
DEBUG! Multiples templates were found for file src/main/webapp/app/admin/health/health.component.ts, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.ts",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.ts"
]
DEBUG! Multiples templates were found for file src/main/webapp/app/admin/health/health.component.html, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.html",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.html"
]
DEBUG! Multiples templates were found for file src/main/webapp/app/admin/health/health.model.ts, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/client/templates/angular/src/main/webapp/app/admin/health/health.model.ts",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/client/templates/angular/src/main/webapp/app/admin/health/health.model.ts"
]
DEBUG! Multiples templates were found for file src/main/webapp/app/admin/health/health.component.spec.ts, using the first
templates: [
  "/Users/mraible/dev/generator-jhipster-quarkus/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts",
  "/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts"
]
DEBUG! Time taken to write files: 120ms
DEBUG! Time taken to write files: 127ms
DEBUG! Time taken to write files: 1ms

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

DEBUG! Error:
Error: /Users/mraible/Downloads/quarkus/src/test/java/com/mycompany/myapp/service/MailServiceIT.java doesn't exist
    at EditionInterface.module.exports [as read] (/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/mem-fs-editor/lib/actions/read.js:12:11)
    at Object.replaceContent (/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/utils.js:112:36)
    at module.exports.updateLanguagesInLanguageMailServiceIT (/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/generator-base-private.js:213:21)
    at module.exports.write (/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/generators/languages/index.js:298:16)
    at Object.<anonymous> (/Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1091:23)
    at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:49:25
    at new Promise (<anonymous>)
    at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/run-async/index.js:26:19
    at /Users/mraible/.nvm/versions/node/v16.20.0/lib/node_modules/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1092:9
    at new Promise (<anonymous>)
mraible commented 1 year ago

I created the app with jhipster -d --blueprints quarkus and only got a few compile errors:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/ConstraintViolationExceptionMapper.java:[24,14] cannot access javax.ws.rs.ext.ExceptionMapper
  class file for javax.ws.rs.ext.ExceptionMapper not found
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/BadRequestAlertException.java:[25,17] cannot access javax.ws.rs.core.Response
  class file for javax.ws.rs.core.Response not found
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/ConstraintViolationExceptionMapper.java:[36,13] no suitable method found for withStatus(jakarta.ws.rs.core.Response.Status)
    method com.tietoevry.quarkus.resteasy.problem.HttpProblem.Builder.withStatus(javax.ws.rs.core.Response.StatusType) is not applicable
      (argument mismatch; jakarta.ws.rs.core.Response.Status cannot be converted to javax.ws.rs.core.Response.StatusType)
    method com.tietoevry.quarkus.resteasy.problem.HttpProblem.Builder.withStatus(int) is not applicable
      (argument mismatch; jakarta.ws.rs.core.Response.Status cannot be converted to int)
[INFO] 3 errors
[INFO] -------------------------------------------------------------

Not sure how to solve these.

lwitkowski commented 1 year ago

I created the app with jhipster -d --blueprints quarkus and only got a few compile errors:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/ConstraintViolationExceptionMapper.java:[24,14] cannot access javax.ws.rs.ext.ExceptionMapper
  class file for javax.ws.rs.ext.ExceptionMapper not found
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/BadRequestAlertException.java:[25,17] cannot access javax.ws.rs.core.Response
  class file for javax.ws.rs.core.Response not found
[ERROR] /Users/mraible/Downloads/quarkus/src/main/java/com/mycompany/myapp/web/rest/errors/ConstraintViolationExceptionMapper.java:[36,13] no suitable method found for withStatus(jakarta.ws.rs.core.Response.Status)
    method com.tietoevry.quarkus.resteasy.problem.HttpProblem.Builder.withStatus(javax.ws.rs.core.Response.StatusType) is not applicable
      (argument mismatch; jakarta.ws.rs.core.Response.Status cannot be converted to javax.ws.rs.core.Response.StatusType)
    method com.tietoevry.quarkus.resteasy.problem.HttpProblem.Builder.withStatus(int) is not applicable
      (argument mismatch; jakarta.ws.rs.core.Response.Status cannot be converted to int)
[INFO] 3 errors
[INFO] -------------------------------------------------------------

Not sure how to solve these.

quarkus-resteasy-problem extension is not part of quarkiverse (yet), so it needs to be bumped explicitly as well. There's a 3.0.0 available already - can you try it?

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

mraible commented 1 year ago

I fixed the compile errors, and a new app starts successfully. However, when you go to http://localhost:8080, it shows the following in the browser.

Screenshot 2023-04-26 at 3 36 06 PM
vishal423 commented 1 year ago

I fixed the compile errors, and a new app starts successfully. However, when you go to http://localhost:8080, it shows the following in the browser.

Screenshot 2023-04-26 at 3 36 06 PM

I don't see this issue in the e2e tests executed as part of CI. Try executing clean goal to rebuild the frontend assets to fix the issue.

Pipeline fails in the native image build stage.

mraible commented 1 year ago

@vishal423 I tried creating a brand new app from scratch, and this error still happens when you first start it. If I run mvn clean and try again, it still happens. I tried using HTTPie too.

Screenshot 2023-06-14 at 12 03 26 PM
jpayneau commented 1 year ago

I also tried like you and i have the same message. But while running using mvnw compile quarkus:dev it's working. It's also working after compiling the jar in prod mode and run it with java -jar

mraible commented 1 year ago

Added a bug bounty to try and get this fixed. /cc @vishal423

vishal423 commented 1 year ago

looking into it...

vishal423 commented 1 year ago

@mraible, pipeline seems to be running now except sonar cloud violation. I didn't dig deep into the violation, however, the docker file syntax was taken from the Quarkus. I also tried to change permissions with --chmod, however that doesn't seems to work. Could you please take a look when you can?

mraible commented 1 year ago

I've never configured SonarCloud with GitHub actions, but I've seen a lot of PRs related to Sonar from @qmonmert. Quentin, do you have time to investigate?

qmonmert commented 1 year ago

@mraible I fixed a lot of sonar issues but I've never configured SonarCloud with GitHub actions too :/

mraible commented 1 year ago

Upon closer investigation, it seems to be related to the Docker files that Quarkus provides rather than the GitHub Actions configuration. Can we ignore them?

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

vishal423 commented 1 year ago

@mraible, we should be good on this PR. gradle native build failure is intermittent on CI and not reproducible locally.

vishal423 commented 11 months ago

@pascalgrimaud bounty claimed https://opencollective.com/generator-jhipster/expenses/173666

pascalgrimaud commented 11 months ago

@vishal423 : approved