`odo dev` no longer working with `java-quarkus` starter projects - E2E tests broken
/kind bug /area testing
What versions of software are you using?
Operating System: Fedora 36
Output of odo version:
odo v3.0.0-rc2 (f78096d26)
Server: https://10.10.10.105:6443
Kubernetes: v1.24.6
How did you run odo exactly?
- Using the
communitystarter project:
odo init --name my-quarkus-app --devfile java-quarkus --starter community
odo dev
- Using the
redhat-productstarter project:
odo init --name my-quarkus-rh-app --devfile java-quarkus --starter redhat-product
odo dev
Actual behavior
Build of the project inside the container created by odo dev used to work before, but it is no longer working now, because of the following error:
tools: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project code-with-quarkus:
Fatal error compiling: error: release version 17 not supported -> [Help 1]
This is because code.quarkus.io is defaulting the Java version to 17 for generated projects, unless told otherwise. The problem is that the Devfile does not specify an explicit Java version, and the container component is using a Java 11 image: registry.access.redhat.com/ubi8/openjdk-11
This breaks the following E2E test: https://github.com/redhat-developer/odo/blob/main/tests/e2escenarios/e2e_devfile_test.go#L75
Expected behavior
Those starter projects should work as before, so users can quickly play with odo and quarkus :-)
Workaround (for users)
2 solutions:
- either change the
maven.compiler.releaseproperty to 11 in thepom.xmlfile - or change the container component image to a Java 17 image, like:
maven:3-eclipse-temurin-17-alpineorregistry.access.redhat.com/ubi8/openjdk-17
Workaround (for our E2E tests)
None so far. The Devfile Stack for java-quarkus should either :
- define a Java 17 image explicitly in the container component (with the risk that this issue will reproduce again when Quarkus switches to the next LTS version of Java - not until at least 2029, that said)
- or, to be safe, explicitly specify a Java version in the starter project download URL; this version should be compatible with the container component image: https://github.com/devfile/registry/blob/main/stacks/java-quarkus/devfile.yaml#L12-L18
Any logs, error output, etc?
"odo logs" output
...
tools: [INFO] ------------------------------------------------------------------------
tools: [INFO] Total time: 2.513 s
tools: [INFO] Finished at: 2022-09-30T09:55:51Z
tools: [INFO] ------------------------------------------------------------------------
tools: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project code-with-quarkus: Fatal error compiling: error: release version 17 not supported -> [Help 1]
tools: [ERROR]
tools: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
tools: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
tools: [ERROR]
tools: [ERROR] For more information about the errors and possible solutions, please read the following articles:
tools: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
tools: [INFO] Scanning for projects...
tools: [INFO]
tools: [INFO] ---------------------< org.acme:code-with-quarkus >---------------------
tools: [INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
tools: [INFO] --------------------------------[ jar ]---------------------------------
tools: [INFO]
tools: [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ code-with-quarkus ---
tools: [INFO] Using 'UTF-8' encoding to copy filtered resources.
tools: [INFO] Copying 2 resources
tools: [INFO]
tools: [INFO] --- quarkus-maven-plugin:2.13.0.Final:generate-code (default) @ code-with-quarkus ---
tools: [INFO]
tools: [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ code-with-quarkus ---
tools: [INFO] Changes detected - recompiling the module!
tools: [INFO] Compiling 2 source files to /projects/target/classes
tools: [INFO] ------------------------------------------------------------------------
tools: [INFO] BUILD FAILURE
tools: [INFO] ------------------------------------------------------------------------
tools: [INFO] Total time: 2.932 s
tools: [INFO] Finished at: 2022-09-30T09:56:05Z
tools: [INFO] ------------------------------------------------------------------------
tools: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project code-with-quarkus: Fatal error compiling: error: release version 17 not supported -> [Help 1]
tools: [ERROR]
tools: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
tools: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
tools: [ERROR]
tools: [ERROR] For more information about the errors and possible solutions, please read the following articles:
tools: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
tools: [INFO] Scanning for projects...
Just saw this issue reported on the Devfile registry side: https://github.com/devfile/api/issues/949
So this issue should be fixed by the related PR: https://github.com/devfile/registry/pull/131
devfile in registry was fixed https://github.com/devfile/registry/pull/131
this should be now in staging
devfile in registry was fixed devfile/registry#131
this should be now in staging
Thanks for the information.
@anandrkskd Can you please revert the changes done in #6184 when you get a chance? Thanks.
/assign anandrkskd