Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.
Closes gh-7316
Update Gradle archive tasks to ensure that `META-INF/` and
`META-INF/MANIFEST.MF` remain as the first entries of the archive.
Prior to this commit, rewritten archives would violate the implicit
specification of `JarInputStream` that these entries should be first.
Fixes gh-16698
This commit replaces the default Asciidoctor styling with
Spring specific styling.
First, we need to unzip the contents of the Spring Asciidoctor
documentation resources provided by the
`io.spring.docsresources:spring-docs-resources` distribution zip. This
is done in a `/target/refdocs` folder. We then copy all files from
`src/main/asciidoc` to the same location, and then launch the generation
process.
See gh-16327
This commit removes the need for the Kotlin plugin tests to continue
to set the plugin classpath in each test build script. This is
achieved by adding the jars files containing the Kotlin plugin and
its dependencies to the runner's plugin classpath in the same way as
was already done for the dependency management plugin.
Closes gh-14680
Previously, each test build script used a property to configure its
classpath. This commit simplifies the tests by setting the classpath
once on the GradleRunner, thereby removing the need for it to be set in
each test script. It also allows, and, in fact, requires, the use of
the plugins block to apply the Boot plugin under test.
Unfortunately, this doesn't work for the tests for the reaction to the
Kotlin plugin. See the comments in the GradleBuild class and in each
KotlingPluginActionIntegrationTests build script.
See gh-14680
Previously, only the permissions for the scripts in bin/ were set. The
permissions for the files in lib/ were not explicity set, leaving them
with the same permissions as the source files in Gradle's cache. This
has proven to be a little brittle when building in certain
environments, leading to test failures. It also assumes that the
file permissions in Gradle's cache will be appropriate for entries in
a distribution archive. That may not always be a reasonable assumption
to make.
To avoid the above-described problems, this commit updates the copy
spec that's used to add files to lib/ in the archive so that each
file uses 0644 for its permissions.
Closes gh-14158
Due to gradle/gradle#5510, using a lambda for a task action breaks
up-to-date checks in certain circumstances.
This commit updates JavaPluginAction to use an inner-class in place
of a lambda for the action that it adds to JavaCompile tasks. A test
has not been added as it does not appear to be possible to reproduce
it with a TestKit-based test.
Closes gh-14054
Upgrading the JDK 9-based build to use JDK 9.0.4 has revealed that
Gradle 4.0.x doesn't work with it as it fails to parse the 9.0.4
version number.
This commit disables building the Gradle plugin on Java 9 (as we
had already done for Java 10) until we decide what to do
(see gh-12333).
Previously, the JDK 10 build would fail as we build the plugin using
Gradle 4.0.x (the lowest version of Gradle that we support) and
Gradle 4.0.x doesn't work with Java 10.
Upgrading to Gradle 4.1, which appears to work with Java 10, was
considered but rejected for now as it introduces the risk that we
inadvertently use an API that's new in 4.1 and break our 4.0 support.
This commit goes for the extreme option and disables building the
Gradle Plugin when building with JDK.
See gh-12028
Previously, if the project's group, name, or version changed the
BuildInfo task would still be considered up-to-date as the values of
the project's properties were not reflected in the fields of the
BuildInfo instance.
This commit updates BuildInfo to copy the value of the project's
property to the corresponding BuildInfo field when the property is
read using its getter method on BuildInfo.
Closes gh-12266
Previously, the ordering of the entries in an archive produced by
BootJar was different to the ordering of the entries in an archive
produced by BootWar. The latter placed application classes before
any nested jars, whereas the former was the other way around.
This commit updates BootJar to use the same ordering as BootWar and
adds tests to verify that the ordering is the following:
1. Loader classes
2. Application classes (BOOT-INF/classes or WEB-INF/classes)
3. Nested jars (BOOT-INF/lib or WEB-INF/lib)
4. Provided nested jars in a war (WEB-INF/lib-provided)
The tests also verify that the position of a library is not affected
by it requiring unpacking.
See gh-11695
See gh-11696
Stop running apply-plugin tests as part of the build since during a
release the version number will change and the jar will not be
available.
Fixes gh-11857
Update a couple of the `spring-boot-gradle-plugin` sample gradle flies
so that they include the running classpath. The additional lines are
contained within a tag which is ultimately filtered from the final
documentation.
Fixes gh-11857
This commit removes the use of the incubating PropertyState and
Provider API that was introduced in Gradle 4.0 and deprecated in
Gradle 4.3. A not-deprecated-but-still-incubating replacement was
introduced in Gradle 4.3. The short life of PropertyState and Provider
has made me wary of using an incubating Gradle API in our public API
as it may not be stable for long. Therefore, this commit does not move
to the replacement as it is incubating. Instead, it falls back to
using Gradle's convention mapping. This is internal API, but its use
is not part of our public API and I perceive the risk of using it to
be lower than using the deprecated and/or incubating API alternatives.
Closes gh-11640
The Gradle plugin integration tests find their Gradle build scripts
using a naming convention of ${ClassName}-${methodName}.gradle. This
convention led to two gradle scripts with filenames that were long
enough to causes problems on Windows.
This commit renames two test methods to reduce the length of their
names and, therefore, the names of their corresponding Gradle script
files.
Closes gh-10868
Previously, the configuration metadata annotation processor relied
upon an additional metadata file have been copied to an output
location. When building with Gradle, it's the processResources task
that performs this copy and there is no guarantee that it will have
run before the compileJava task unless an explicit dependency betwee
the two tasks has been configured. If a project is built using
Gradle's parallel build support, the likelihood of this required
ordering not occurring increases.
This commit updates the configuration metadata annotation processor to
consider a new annotation processor option when looking for the
additional config metadata file. The Gradle plugin has been updated
to provide this option as a compiler argument. The option is only
provided when the annotation processor is found on the compilation
classpath to avoid a warning from javac's annotation processing about
the use of an option that is not supported by any of the available
annotation processors.
Closes gh-9755
This commit introduces a new mainClassName property on the springBoot
DSL provided by the Gradle plugin. It can be used to explicitly
configure the mainClassName of the default bootRun, bootJar, and
bootWar tasks in a single place. Previously, the only mechanism
provided to do so was the mainClassName property that's only available
when the application plugin has been applied.
Closes gh-10623
Previously, BootRun used the main property to configure the name of
the main class to run while BootJar and BootWar used the mainClass
property. Both were different to the application plugin which provides
a mainClassName project property.
This commit updates BootRun, BootJar, and BootWar to change the name
of the property used to configure the name of the main class to be
mainClassName. This makes the three Boot-specific tasks consistent
with each other, and also aligns them with Gradle's own application
plugin.
Closes gh-10622
Travis is terminating builds as they are producing too much logging.
A major contributor to the volume of logging is the Gradle plugin's
build. This commit switches off debug logging for the build and
enables test event logging. This considerably reduces the volume of
logging that is produced while still providing some insight into the
build's tests.
Move projects to better reflect the way that Spring Boot is released.
The following projects are under `spring-boot-project`:
- `spring-boot`
- `spring-boot-autoconfigure`
- `spring-boot-tools`
- `spring-boot-starters`
- `spring-boot-actuator`
- `spring-boot-actuator-autoconfigure`
- `spring-boot-test`
- `spring-boot-test-autoconfigure`
- `spring-boot-devtools`
- `spring-boot-cli`
- `spring-boot-docs`
See gh-9316