You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running gradle assemble in Micronaut project produces 2 jars (helloworld-0.1-all.jar and helloworld-0.1.jar), but only helloworld-0.1-all.jar should have a Main-Class manifest entry
Exception in thread "main" java.lang.NoClassDefFoundError: io/micronaut/runtime/Micronaut
at example.Application.main(Application.java:24)
Caused by: java.lang.ClassNotFoundException: io.micronaut.runtime.Micronaut
Context
This stopped working with version 6.4. I know it works with 6.3.
I am creating a general purpose build pipeline for gradle projects. The pipeline involves installing the latest gradle version onto a clean Ubuntu image and building a gradle application. This build pipeline is used for Google's open sourced buildpacks. In this buildpack, we run gradle assemble then search in build/libs for a single jar with a Main-Class manifest entry to determine which jar to run. When multiple jars have Main-Class manifest entries, we error.
Extract data in jars in build/libs (should be the two listed above)
Notice they both have Main-Class manifest entries in 6.4 (located at META-INF/MANIFEST.MF), but only one has the manifest entry when built with 6.3.
Your Environment
This is running inside a minimal Ubuntu 18.04 image with Java 11 JDK.
Build scan URL: https://gradle.com/s/bkpeawim6ffns
(Have not received email to activate but will when I receive it)
The text was updated successfully, but these errors were encountered:
Is there any way to support JPMS while also ensuring that this regression does not happen in 7.0? This output is odd for anyone working with micronaut.
big-guy
changed the title
Multiple jars with Main-Class Manifest entries in Micronaut Project after 6.4 upgrade
Regression: Main-Class attribute always added to jar manifest when using application plugin
May 15, 2020
Expected Behavior
Running
gradle assemble
in Micronaut project produces 2 jars (helloworld-0.1-all.jar
andhelloworld-0.1.jar
), but onlyhelloworld-0.1-all.jar
should have a Main-Class manifest entryhelloworld-0.1.jar
MANIFEST.MF:helloworld-0.1-all.jar
MANIFEST.MF:Current Behavior
Starting with Gradle 6.4, both jars have Main-Class manifest entries
helloworld-0.1.jar
MANIFEST.MF:helloworld-0.1-all.jar
MANIFEST.MF:Running
java -jar helloworld-0.1.jar
returnsContext
This stopped working with version 6.4. I know it works with 6.3.
I am creating a general purpose build pipeline for gradle projects. The pipeline involves installing the latest gradle version onto a clean Ubuntu image and building a gradle application. This build pipeline is used for Google's open sourced buildpacks. In this buildpack, we run
gradle assemble
then search inbuild/libs
for a single jar with a Main-Class manifest entry to determine which jar to run. When multiple jars have Main-Class manifest entries, we error.Steps to Reproduce
Using this gradle sample: https://github.com/micronaut-projects/micronaut-examples/tree/master/hello-world-java
gradle assemble
with Gradle version 6.4META-INF/MANIFEST.MF
), but only one has the manifest entry when built with 6.3.Your Environment
This is running inside a minimal Ubuntu 18.04 image with Java 11 JDK.
Build scan URL:
https://gradle.com/s/bkpeawim6ffns
(Have not received email to activate but will when I receive it)
The text was updated successfully, but these errors were encountered: