Skip to content

maven cant build spring boot 2.3.4 using Java15 and Groovy anymore - needs newer version of gmavenplus-plugin and groovy #23686

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

Closed
afreller-1wa opened this issue Oct 14, 2020 · 2 comments

Comments

@afreller-1wa
Copy link

afreller-1wa commented Oct 14, 2020

Steps to reproduce:

  • create a demo project from https://start.spring.io/
  • using Maven + Groovy + Spring Boot 2.3.4 + Java15
  • extract and run maven
mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /home/******/.sdkman/candidates/maven/current
Java version: 15, vendor: AdoptOpenJDK, runtime: /opt/owa/java/jdk-15+36
Default locale: en_CA, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-48-generic", arch: "amd64", family: "unix"
$ mvn package
[INFO] Scanning for projects...
[INFO] 
[INFO] --------------------------< com.example:demo >--------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- gmavenplus-plugin:1.8.1:addSources (default) @ demo ---
[INFO] 
[INFO] --- gmavenplus-plugin:1.8.1:addTestSources (default) @ demo ---
[INFO] 
[INFO] --- gmavenplus-plugin:1.8.1:generateStubs (default) @ demo ---
[INFO] Using isolated classloader, without GMavenPlus classpath.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass (file:/home/******/.m2/repository/org/codehaus/groovy/groovy/2.5.13/groovy-2.5.13.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[INFO] Using Groovy 2.5.13 to perform generateStubs.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.071 s
[INFO] Finished at: 2020-10-14T09:12:20-07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.8.1:generateStubs (default) on project demo: **Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.8.1:generateStubs failed: Unrecognized target bytecode: '15'.** -> [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/PluginExecutionException

The issue here is the version of gmavenplus-plugin being 1.8.1 which does not support Java15.

I did update the gmavenplus-plugin to 1.11.0 in the pom which supports Java15.

This time the issue is that the groovy version bundled with spring boot is too old. The plugin needs a groovy version 3.0.3 or higher. See issue below:

[ERROR] Failed to execute goal org.codehaus.gmavenplus:gmavenplus-plugin:1.11.0:generateStubs (default) on project demo: Execution default of goal org.codehaus.gmavenplus:gmavenplus-plugin:1.11.0:generateStubs failed: **Target bytecode 15 requires Groovy 3.0.3 or newer.** -> [Help 1]
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 14, 2020
@wilkinsona
Copy link
Member

Thanks for the report.

Spring Boot doesn't have an opinion about the version of the gamvenplus-plugin that you use, that's coming from start.spring.io via the underlying Initializr library. I've opened spring-io/initializr#1140.

#20119 is tracking an upgrade to Groovy 3. In the meantime you can override the version of Groovy to meet your needs using the groovy.version property.

@snicoll
Copy link
Member

snicoll commented Oct 15, 2020

Thanks @wilkinsona for the follow-up. For the record, start.spring.io has been upgraded to handle that use case out-of-the-box.

@wilkinsona wilkinsona removed the status: waiting-for-triage An issue we've not yet triaged label Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants