Previously, querying the artifact's extension in
SinglePublishedArtifact would result in eager creation of the task
that creates the artifact. Typically, this is the bootWar task.
Instead of querying the extension, this commit reworks
SinglePublishedArtifact and its callers to call separate methods for
jar and war artifacts so that the extension check is no longer
required.
Tests have been added to ensure that running help does not trigger
any unexpected task creation. The tests' assertions tolerate some
variation in behavior that depend on the version of Gradle and
whether the configuration cache is enabled.
Closes gh-30211
- Adds a new @DisableOnOs annotation, which is inspired from JUnit5s
@DisableOnOs annotation. This new annotation supports the architecture
and is repeatable
Closes gh-30082
The changes for gh-28562 attempted to align the Gradle plugin's
handling of META-INF with the Maven plugin's behavior. Unfortunately,
they want too far, applying the handling to both jar and war files
when the Maven plugin only applies it to jar files.
This commit reworks the changes so that they only apply to jar files.
Closes gh-30026
Previously, all integral numbers were parsed as integers. This
caused two problems:
1. Compilation would fail if the default value for a long wasn't a
valid integer.
2. The default value for a byte or short could be out of range,
resulting in the generation of invalid metadata and an error
that could have been caught at compile time not being caught
until runtime.
This commit updates the parsing of all numeric values to use the
parse method of the target primitive type. For example,
Short.parseShort(String) is now used to parse a short.
Fixes gh-30020
Previously, the classpath of bootJar, bootWar, and bootRun was
configured directly as a FileCollection derived from the main source
set's runtime classpath. This direct configuration meant that
subsequent changes to the main source set's runtime classpath may not
have been picked up.
This commit changes the configuration of the classpath to use a
Callable. This indirection allows subsequent changes to the main
source set's runtime classpath to be picked up as long as they
occur before Gradle calls the callable.
Closes gh-29672
Update `launch.script` so that the `run_user` variable is only set when
the user actually exists. Prior to this commit, if the jar file was
owned by a non-existing user the startup script could fail.
Fixes gh-29370
Previously, when writing a repackaged jar, an attempt to write all of
an entry's parent directories would always be made, irrespective of
whether or not the entry itself had already been written. This was
inefficient as, due to the way that the jar is written, once an entry
itself has been written, we know that all of its parent directories
will also have been written.
This commit updates the jar writer so that no attempt is made to
write parent directory entries if the entry itself has already been
written.
Fixes gh-29175