This commit clarifies how we intend the spring-boot:repackage goal to
be used. As it operates on the source jar (or war) that must be
effectively up-to-date to produce an accurate result, the package phase
must have run.
Contrary to build-image that was designed to be used on the command-line
by forking a package lifecycle first, repackage does not do that. This
commit also clarifies that by providing a more focused error message.
Closes gh-22317
Previously, if a classifier was set and build-image was executed from
the command-line, the build will fail as the plugin was unable to find
the original jar. This is because it relies on the attached artifacts
of the project, and those are not set when package has run as part of
a forked lifecycle.
This commit makes sure that the backup file is found by convention
first, the same way it is done for the target file.
Closes gh-26721
This commit updates the Maven Plugin to tolerate projects that are using
the module path on the JVM and targeting native images with AOT.
Previously, the plugin compiled AOT sources directly to target/classes
and the presence of a module-info there is enough to trigger a
compilation on the module path.
With this change we now compile in a separate directory that contains
the generated AOT classes (typically CGLIB proxies). These are copied to
target/classes once compilation completes already.
The integration test also uses our parent, rather than relying on what
Maven provides. That's because older Maven versions provide a default
compiler plugin version that did not handle the module path correctly.
Closes gh-33383
The use of method references requires the referenced method to be
present even if it isn't called. This made it impossible for Gradle
to remove the deprecated methods as it would break our plugin.
By switching the lambdas, the methods only have to be present when
they're called which will only happen with Gradle 8.2 and earlier.
Closes gh-41599
Add ElementType.RECORD_COMPONENT to NestedConfigurationProperty and
implement isMarkedAsNested for RecordParameterPropertyDescriptor.
This will allow nested records to be properly harvested for their
properties.
See gh-41251
Previously, the mavenOptional was added to every published module but it
was only used by spring-boot-maven-plugin. This commit reduces its scope
so that it only affects the Maven plugin. It also reworks the
implementation to reuse the existing optional configuration rather than
declaring a new mavenOptional configuration. Lastly, publication of
Gradle Module Metadata (GMM) has been disabled for
spring-boot-maven-plugin. This is seen as preferable to publishing the
metadata – which isn't really needed as it does not contain any useful
additional information – and having to suppress warnings about
incomplete mapping of GMM to pom metadata.
Closes gh-41263