-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Regression: Main-Class attribute always added to jar manifest when using application plugin #13057
Comments
Thanks for the report. This is indeed a change that was done as part of the Java Module System support. And it probably should not have been done in a minor. Looking at options to handle this, will update on this issue. |
Note that a workaround is available by doing:
|
Thanks for looking into this. Does this mean it is an intended change? |
No, it wasn't an intended change. |
This will be reverted for 6.4.1 and become an intended change in Gradle 7.0 as per #13125 |
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. |
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: