openshift-labs / starter-guides

Getting Started with OpenShift for Developers workshop
https://openshift-labs.github.io/starter-guides-html/
Apache License 2.0
136 stars 147 forks source link

Pipeline step fails on Maven error #213

Open ktatro-rh opened 1 year ago

ktatro-rh commented 1 year ago

On the pipeline build step, everyone in our workshop experienced the following error during the workshop:

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project nationalparks: Fatal error compiling: invalid target release: 11 -> [Help 1]

open-sudo commented 1 year ago

The PVC doesn't bind. It stays indefinitely in PENDING state.

ktatro-rh commented 1 year ago

I did some looking at some other user namespaces, it looks like the PVC was correctly bound in the namespaces, but the pipeline still failed. Here is the full output from the build-and-test log:

[INFO] Changes detected - recompiling the module! [INFO] Compiling 11 source files to /workspace/source/target/classes [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.205 s [INFO] Finished at: 2023-04-20T20:30:15Z [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project nationalparks: Fatal error compiling: invalid target release: 11 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

naveenkendyala commented 1 year ago

+1 to this error (the pvc is binding). Do we have any work arounds for this?

naveenkendyala commented 1 year ago

Solution : Looks like the issue is with the maven image in the pipeline build-and-test step. The image is defaulting to "gcr.io/cloud-builders/mvn" which will pull the latest and may not have the java 11.

Changing the image tag to a previous one (the one below worked) solved the problem: gcr.io/cloud-builders/mvn@sha256:8e7d8d214e2c007f8b4737beb393c941bb9a11600eeedfc0c2bcec3dc8d11e06

naveenkendyala commented 1 year ago

Update : The fix seems to have been applied. The workshop uses Maven 3.9.1 that was released a few days ago. I did another run and the step is successful. This can be closed !