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

Upgrade to Quarkus 3 #285

Merged
merged 13 commits into from Sep 2, 2023
Merged

Upgrade to Quarkus 3 #285

merged 13 commits into from Sep 2, 2023

Conversation

mraible
Copy link
Contributor

@mraible mraible commented Apr 26, 2023

@mraible
Copy link
Contributor Author

mraible commented Apr 26, 2023

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
Copy link
Contributor Author

mraible commented Apr 26, 2023

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.

@@ -117,7 +88,7 @@ Check out [JHipster contributing guide](https://github.com/jhipster/generator-jh

# License

Apache-2.0 © [Daniel Petisme](https://github.com/danielpetisme)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@danielpetisme Is it OK to remove this?

@lwitkowski
Copy link
Contributor

lwitkowski commented Apr 26, 2023

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
Copy link

sonarcloud bot commented Apr 26, 2023

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
Copy link
Contributor Author

mraible commented Apr 26, 2023

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
Copy link
Collaborator

vishal423 commented May 27, 2023

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
Copy link
Contributor Author

mraible commented Jun 14, 2023

@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
Copy link

jpayneau commented Jun 22, 2023

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 mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels Aug 17, 2023
@mraible
Copy link
Contributor Author

mraible commented Aug 17, 2023

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

@vishal423
Copy link
Collaborator

looking into it...

@vishal423
Copy link
Collaborator

@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?

@vishal423 vishal423 marked this pull request as ready for review August 31, 2023 04:32
@mraible
Copy link
Contributor Author

mraible commented Aug 31, 2023

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
Copy link
Contributor

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

@mraible
Copy link
Contributor Author

mraible commented Aug 31, 2023

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
Copy link

sonarcloud bot commented Sep 1, 2023

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
Copy link
Collaborator

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

@mraible mraible merged commit e21c120 into main Sep 2, 2023
11 checks passed
@vishal423 vishal423 deleted the quarkus-3 branch September 2, 2023 05:10
@vishal423
Copy link
Collaborator

@pascalgrimaud
Copy link
Member

@vishal423 : approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants