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

Generated Micronaut 2.5 Gradle-based project fails when compiled with JDK16 #757

Closed
sdedic opened this issue Apr 30, 2021 · 0 comments
Closed
Labels
type: bug Something isn't working
Milestone

Comments

@sdedic
Copy link

sdedic commented Apr 30, 2021

Description

A project generated by Micronaut Starter:

  • Micronaut 2.5.0
  • Java version: 16
  • Lanugage: Java
  • Build: Gradle
    fails to build on JDK 16 with the following exception:
groovy.lang.MissingPropertyException: No such property: count for class: com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer
        at groovy.lang.MetaClassImpl.invokeStaticMissingProperty(MetaClassImpl.java:1019)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1963)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:1938)
        at groovy.lang.MetaClassImpl.getProperty(MetaClassImpl.java:3870)
        at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:197)
        at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.getProperty(ScriptBytecodeAdapter.java:468)
        at com.github.jengelman.gradle.plugins.shadow.transformers.ServiceFileTransformer$ServiceStream.propertyMissing(ServiceFileTransformer.groovy)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Steps to Reproduce

  1. Create a new demo project using Micronaut.io web, or
  2. Use the attached ZIP (a project generated by me)
  3. ensure JDK16 is on PATH and JAVA_HOME
  4. run ./gradlew build

demo.zip

Expected Behaviour

The project builds :-)

Actual Behaviour

Build fails, with groovy.lang.MissingPropertyException

Environment Information

  • Operating System: Linux Ubuntu 19.04
  • Micronaut Version: 2.5.0
  • JDK Version: Oracle JDK 16

Example Application

See attached ZIP

Analysis / details

The bug is caused by an obsolete version of com.github.johnrengelman.shadow plugin configured by the web wizard. The configured version is 6.1.0, that suffers from GROOVY-9292. The issue was fixed in Shadow#655 and was released in Shadow plugin release 7.0. This release however requires Gradle 7.0.

Please upgrade the dependency in the rocker template. I'd do that myself, but that would tie Micronaut-starter tp Gradle 7.0, which does not seem as a good idea, since the gradle-wrapper.properties template in master still declares gradle-6.7 (?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants