Commit Graph

1152 Commits

Author SHA1 Message Date
Johnny Lim 6939ff1e65 Polish
Closes gh-9330
2017-05-28 17:46:43 +02:00
Andy Wilkinson 6c3a27dadf Merge branch '1.5.x' 2017-05-23 20:44:46 +01:00
Andy Wilkinson f7127e5522 Ensure that closing a JarFile closes all underlying resources
Closes gh-8871
2017-05-23 20:42:59 +01:00
Andy Wilkinson d5438c299c Polish "Use try-with-resources to close resources automatically"
- Apply code formatting
- Use try-with-resources in many other places that were missed in the
  pull request

Closes gh-8045
2017-05-23 19:38:48 +01:00
Phillip Webb 302f038e84 Polish 2017-05-15 20:35:29 -07:00
Phillip Webb f4444a36b3 Merge branch '1.5.x' 2017-05-15 16:00:28 -07:00
Phillip Webb 74f411faed Formatting 2017-05-15 15:58:30 -07:00
Stephane Nicoll 2e94fd4434 Remove support for Spring Loaded
Closes gh-7978
2017-05-15 14:18:06 +03:00
Stephane Nicoll cdf5f6e0ee Add support for deprecation level in manual metadata
This commit allows to specify a deprecation level to a manual metadata
entry. The purpose of that new attribute is to distinguish cases where
the property is still bound (default) from cases where the property no
longer exists and won't be bound.

This gives the opportunity to IDEs to still show the property as an
error and offer documentation and an action to rename it if a
replacement exists.

Closes gh-9074
2017-05-15 12:39:15 +03:00
Madhura Bhave 53493fdd86 Make detection of nested config more lenient
Closes gh-3454
2017-05-12 08:58:17 -07:00
Stephane Nicoll 1835dd7b94 Merge branch '1.5.x' 2017-05-12 16:50:26 +02:00
Stephane Nicoll 643dea18ee Accommodate with Lombok generation ordering
Previously, if lombok was running before the configuration metadata
annotation processor, duplicated keys were created as both the
getter/setter and the special lombok handling applied.

This commit makes sure to be lenient by removing duplicate metadata
entries. This commit also makes sure to identify the getter of a
nested group if present. That way, the sourceMethod is set consistently
and avoid the creation of a duplicate group.

Closes gh-8886
2017-05-12 16:48:31 +02:00
Andy Wilkinson e4f80e68fc Do not run Gradle plugin's tests when built with -DskipTests
Closes gh-9169
2017-05-12 14:39:47 +01:00
Stephane Nicoll 527c2e7b75 Add support for deprecation level in manual metadata
This commit allows to specify a deprecation level to a manual metadata
entry. The purpose of that new attribute is to distinguish cases where
the property is still bound (default) from cases where the property no
longer exists and won't be bound.

This gives the opportunity to IDEs to still show the property as an
error and offer documentation and an action to rename it if a
replacement exists.

Closes gh-9074
2017-05-11 11:46:06 +02:00
Stephane Nicoll 3547815805 Make sure Maven integration tests use a consistent java version
Closes gh-9149
2017-05-10 17:15:59 +02:00
Stephane Nicoll 5e14383886 Merge branch '1.5.x' 2017-05-09 09:38:47 +02:00
Stephane Nicoll ea4e6fea35 Polish 2017-05-09 09:37:30 +02:00
Stephane Nicoll f8e1345b75 Unify versions used in integration tests
This commit makes sure the integration tests use the same versions as
the one managed by `spring-boot-dependencies` (including Maven plugins).

Closes gh-8947
2017-05-09 09:36:21 +02:00
Johnny Lim 53e5d67cde Polish
Closes gh-9103
2017-05-07 10:32:12 +02:00
Andy Wilkinson 3abd8d3adf Drop support for configuring PropertiesLauncher with application.properties
Closes gh-8464
2017-05-04 17:01:07 +01:00
Stephane Nicoll 7b1fc01733 Fix checkstyle violations 2017-05-03 10:19:00 +02:00
Stephane Nicoll 063d301fd3 Make LayoutType public
Closes gh-9067
2017-05-03 09:15:34 +02:00
Andy Wilkinson 1ee9653f7c Group tasks and provide descriptions for tasks and configurations
Closes gh-8817
2017-04-28 17:40:05 +01:00
Andy Wilkinson 762a13e84f Configure assemble to depend upon bootJar or bootWar
Closes gh-8824
2017-04-28 16:48:48 +01:00
Andy Wilkinson a6d24a3bfc Allow bootWar to package webapp resources in dirs that overlap loader
Previously, the presence of a src/main/webapp/org directory would
cause the execution of BootWar to fail due to an attempt to write
a duplicate org/ entry to the zip output stream.

This commit updates BootZipCopyAction so that FileTreeElements that
match a directory entry created while writing the loader classes are
skipped.

Closes gh-8972
2017-04-21 21:02:15 +01:00
Spring Buildmaster 9768b0a8c2 Next Development Version 2017-04-21 08:32:01 +00:00
Andy Wilkinson ae0700efc1 Try to make RunningDocumentationTests platform independent
Windows seems unable to decide if the temp dir is in System32 or
system32 which breaks the comparison. This commit attempts to appease
the gods of case sensitity by reducing the portion of the path that we
check so that system32 vs System32 doesn't come into it.

See gh-8920
2017-04-20 13:47:58 +01:00
Spring Buildmaster d719d2cbbc Next Development Version 2017-04-20 12:46:19 +00:00
Andy Wilkinson 079b324e21 Make RunningDocumentationTests platform independent
Closes gh-8920
2017-04-20 11:52:32 +01:00
Phillip Webb 81fef71fcb Merge branch '1.5.x' 2017-04-19 22:48:46 -07:00
Dave Syer 14638e67bc Extended PropertiesLauncher class location logic
Update `PropertiesLauncher` so that classes can be loaded outside of
`BOOT-INF/classes`. You can use a subdirectory, or the root directory
of an external jar (but not the parent archive to avoid issues
with agents and awkward delegation models).

Fixes gh-8480
Closes gh-8486
2017-04-19 22:18:12 -07:00
Stephane Nicoll 65986503c1 Fix glitch in doc
Closes gh-8921
2017-04-18 09:36:05 +02:00
Huang YunKun f303ce5ff4 Fix windows build of the Gradle plugin
Use family instead of name to check os system

Closes gh-8907
2017-04-17 15:01:03 +02:00
Andy Wilkinson 0186fb2e84 Fail fast when plugin is used with an unsupported version of Gradle
Closes gh-8820
2017-04-06 09:10:07 +01:00
Andy Wilkinson ab18901ad0 Ensure that entry is completely configured before putting to the stream
Previously, BootZipCopyAction would put the next entry to the stream
and then, in the case of a stored entry, configure its size, CRC32
etc. This had the benefit of being able to copy the entry into the
zip once, capturing its bytes for the calculation of the CRC32 as it
was copied. Unfortunately, while this produced zip files that could
be read by the JVM, other zip tools failed. For example, Go's zip
support that's used by CloudFoundry could not unzip the archive.

This commit updates BootZipCopy action to completely configure the
entry before putting it to the stream. This has the downside of
copying the file twice (once for the CRC32 and once to actually write
it to the zip stream) but this appears to be unavoidable as we have to
produce archives that can be unzipped without problems on all
platforms.

Closes gh-8816
2017-04-05 13:03:03 +01:00
Andy Wilkinson 2f64cdfa98 Include directory entries when copying loader into a Boot archive
See gh-8816
2017-04-05 13:02:57 +01:00
Andy Wilkinson 15d6c9d5c7 Merge pull request #8818 from Johnny Lim
* gh-8818:
  Fix typos in new Gradle plugin
2017-04-05 12:30:25 +01:00
Johnny Lim 8d921d49aa Fix typos in new Gradle plugin
Closes gh-8818
2017-04-05 12:29:52 +01:00
Andy Wilkinson 5bc721f3ad Polish Gradle plugin's documentation 2017-04-05 12:25:47 +01:00
Phillip Webb ad38776de3 Polish 2017-04-04 09:48:10 -07:00
Phillip Webb ddcb5ee328 Polish 2017-04-04 09:36:27 -07:00
Andy Wilkinson 7f5ca24ff9 Make Maven Central available to Gradle plugin's build 2017-04-04 16:47:05 +01:00
Andy Wilkinson 01166381a0 Provide separate documentation (API and reference) for Gradle plugin 2017-04-04 15:33:27 +01:00
Andy Wilkinson d43b1ae3a5 Polish the Gradle plugin's javadoc 2017-04-04 15:33:27 +01:00
Andy Wilkinson 85267def3e Integration test the reaction to the Application plugin being applied 2017-04-04 15:33:27 +01:00
Andy Wilkinson 915c17b955 Integration test the reaction to the Maven plugin being applied 2017-04-04 15:33:27 +01:00
Andy Wilkinson e552975a7a Integration test the reaction to the War plugin being applied 2017-04-04 15:33:27 +01:00
Andy Wilkinson c1f2f8079b Integration test the reaction to the Java plugin being applied 2017-04-04 15:33:27 +01:00
Andy Wilkinson b9b402e3db Rework BuildInfo to separate task and build info properties
Previously, the properties that applied to the BuildInfo task itself
and those that would be written into the build-info.properties file
were all configured on BuildInfo directly. This lack of separation
could be confusing.

This commit rework BuildInfo to separate the task's own properties
from those that are written into the build-info.properties file.

The task has also been updated so that changes to a project's
properties made after the task has been configured are reflected in
the build info properties.
2017-04-04 15:33:27 +01:00
Andy Wilkinson 201ea133e1 Guide users to apply dependency management plugin when resolution fails 2017-04-04 15:33:27 +01:00
Andy Wilkinson 8d55801c4d Restructure the code to enforce separation of plugin logic and tasks 2017-04-04 15:33:27 +01:00
Andy Wilkinson 1dc5c484f0 Use application plugin properties by convention when it is applied
bootRun's main and jvmArgs properties use mainClassName and
applicationDefaultJvmArgs respectively by convention.

bootJar and bootWar's mainClass property uses mainClassName by
convention.
2017-04-04 15:33:27 +01:00
Andy Wilkinson 188c9e0f42 Remove assumptions from BootInfo and move them to the DSL extension 2017-04-04 15:33:27 +01:00
Andy Wilkinson 5708eaf41b Simplify the DSL extension to provide a solid foundation 2017-04-04 15:33:27 +01:00
Andy Wilkinson 8048791ab2 Remove AgentPluginFeatures as they are undocumented
The current implementation is undocumented so it's not clear exactly
what it's intended to do. It also appears to overreach as, for
example, it affects every JavaExec task in a project.

We may need to reinstate something that's somewhat equivalent, but I'd
like to do that armed with more information about the intent of the
functionality and some specific problems that need to be solved.
2017-04-04 15:33:27 +01:00
Andy Wilkinson f440b7b7e3 Move decision about an entry's compression out into BootJar and BootWar 2017-04-04 15:33:27 +01:00
Andy Wilkinson 5bf8f778e2 Don't write the default loader classes when a custom launcher is used 2017-04-04 15:33:27 +01:00
Andy Wilkinson 2b44ad9809 Rework BootRunTask to be more idiomatic and make fewer assumptions 2017-04-04 15:33:27 +01:00
Andy Wilkinson 6e7e42459b Exclude Devtools by default and provide an option to include it 2017-04-04 15:33:27 +01:00
Andy Wilkinson d015714cba Add support for reproducible archives to BootJar and BootWar
Closes gh-8391
2017-04-04 15:33:27 +01:00
Andy Wilkinson bc543ef08a Use a convention mapping for resolving main class from the classpath 2017-04-04 15:33:27 +01:00
Andy Wilkinson d9af21ab7c Create software components for Spring Boot jar and war artifacts
Closes gh-1666
2017-04-04 15:33:27 +01:00
Andy Wilkinson 31febfa383 Create distribution for Boot jar or war when application plugin applied
Closes gh-2622
2017-04-04 15:33:27 +01:00
Andy Wilkinson b4e2044b9e Simplify bootRun main class configuration by reusing MainClassSupplier 2017-04-04 15:33:27 +01:00
Andy Wilkinson f16efb2277 Publish artifacts and, when Maven plugin used, customize upload task
See gh-1666
2017-04-04 15:33:27 +01:00
Andy Wilkinson b1f9123311 React to dependency management plugin rather than always applying it
Previously, the Spring Boot plugin would automatically apply the
dependency management plugin and import the spring-boot-dependencies
bom. This made it very difficult to use Spring Boot's plugin without
also using its dependency management. It also made it difficult to
see where the dependency management was coming from.

This commit updates the Spring Boot plugin so that it no longer
automatically applies the dependency management plugin. Instead, the
plugin now reacts to the dependency management plugin being applied
by importing the spring-boot-dependencies bom. Users that do not
wish to use Spring Boot's dependency management capabilities can now
do so by not applying the dependency management plugin.

Closes gh-3164
2017-04-04 15:33:27 +01:00
Andy Wilkinson 2ce8556976 Introduce bootJar and bootWar tasks for creating fat jars and wars
Previously, the BootRepackage task would take the output of a Jar
or War task and repackage it in a similar manner to Spring Boot's
Maven plugin. This caused several problems in Gradle including
broken up-to-date checks and a lack of configurability. See the issues
referenced below for full details.

This commit replaces BootRepackage with BootJar and BootWar
for building executable jars and wars respectively. BootJar extends
Gradle's standard Jar task and BootWar extends Gradle's standard War
task. This means that terms of configuration, the creation of
executable jars and wars is now as flexible as the creation of
standards jars and wars.

Closes gh-8167
Closes gh-8099
Closes gh-6846
Closes gh-5861
Closes gh-5393
Closes gh-5259
Closes gh-3931
2017-04-04 15:33:27 +01:00
Andy Wilkinson 20fe95b276 React to the Java plugin being applied rather than always applying it 2017-04-04 15:33:27 +01:00
Andy Wilkinson 9b15e6b5a3 Use Gradle, executed by Maven, to build the Gradle plugin 2017-04-04 15:33:27 +01:00
Andy Wilkinson 3ec5041826 Merge branch '1.5.x' 2017-04-04 11:31:43 +01:00
Andy Wilkinson c55bfb00b1 Merge branch '1.4.x' into 1.5.x 2017-04-04 11:31:34 +01:00
Andy Wilkinson 456327260b Fail fast when a Zip64 jar is encountered
Previously, jars (either top-level or nested) in Zip64 format were
treated as normal jar files. This would lead to a failure later on
when an attempt was made to read an entry from the file.

This commit updates the loader to fail fast when it encounters a
Zip64 jar file. Such files are identified by the number of entries
in the central directory end record being 0xFFFF.

Closes gh-8735
2017-04-04 11:31:18 +01:00
Stephane Nicoll ff50331168 Merge branch '1.5.x' 2017-03-28 10:27:31 +02:00
Stephane Nicoll d8e90af3bf Merge branch '1.4.x' into 1.5.x 2017-03-28 10:27:14 +02:00
dreis 1266642aba Fix test assertions
Closes gh-8660
2017-03-28 10:26:25 +02:00
Andy Wilkinson 83df8e47fe Merge branch '1.5.x' 2017-03-24 10:34:02 +00:00
Andy Wilkinson e6cfb4e5fb Improve diagnostics when reading a nested jar throws a runtime exception
Previously, only IOExceptions were caught and wrapped in a new
IOException that included the name of the nested entry that was
being read.

Following this commit, any Exception is caught and wrapped so that the
problematic entry can be identified in more failure scenarios.

Closes gh-8711
2017-03-24 10:32:16 +00:00
Phillip Webb ca5e566deb Fix Configuration processor test tangle
Move `Metadata` test class to fix a package tangle in the test code.

Fixes gh-8613
2017-03-14 13:45:53 -07:00
Andy Wilkinson b35c162593 Raise the minimum supported version of Gradle to 3.4
Closes gh-7922
2017-03-11 09:03:06 +00:00
Phillip Webb d8f827d224 Cleanup and format code 2017-03-06 17:08:09 -08:00
Phillip Webb 425dbc3e52 Update copyright header for edited files 2017-03-06 15:04:07 -08:00
Spring Buildmaster d23fa24340 Next Development Version 2017-03-03 16:18:26 +00:00
Spring Buildmaster 2a83e80a9b Next Development Version 2017-03-03 14:39:21 +00:00
Andy Wilkinson 9c88ba3b90 Merge branch '1.5.x' 2017-03-02 17:30:44 +00:00
Andy Wilkinson 6673d8eebc Polish "Allow loader.path to refer to nested jars"
Closes gh-8334
Closes gh-8465
2017-03-02 17:29:45 +00:00
Dave Syer 3701cce88f Allow loader.path to refer to nested jars
Previously, each entry in loader.path could only refer to a standard
jar file. Refering to such a jar would add all of the classes in
the root of the jar to the class path.

This commit adds support for referencing a directory within a jar file
that contains one or more nested jars. For example:

$ java -jar -Dloader.path='jar:file:./lib.jar/!BOOT-INF/lib' my.jar

This will add all of the classes in all of that jars in the
BOOT-INF/lib directory of lib.jar to the class path.

See gh-8334
2017-03-02 16:49:24 +00:00
Andy Wilkinson b6e8a280fd Merge branch '1.5.x' 2017-03-02 11:22:17 +00:00
Andy Wilkinson b36c8a7c24 Polish "Tighten up PropertiesLauncher's contract"
See gh-8346
Closes gh-7221
2017-03-02 11:19:48 +00:00
Dave Syer e4c807b884 Tighten up PropertiesLauncher's contract
The main changes are:

- Switch to `loader.properties` instead of `application.properties`
- Search for `loader.properties` in `loader.home` as well as in
  the classpath
- Placeholder replacements in MANIFEST.MF (using `loader.properties`
  or system/env vars)

See gh-7221
Closes gh-8346
2017-03-02 11:19:48 +00:00
Phillip Webb 58ac67eb27 Merge branch '1.5.x' 2017-03-02 00:09:56 -08:00
Phillip Webb f1012c104a Polish 2017-03-01 23:29:20 -08:00
Stephane Nicoll 36fb0ed383 Merge branch '1.5.x' 2017-03-01 13:19:18 +01:00
Stephane Nicoll 19b4833c33 Keep order when filtering artifacts
This commit makes sure that the order of dependencies is kept when they
are filtered.

Closes gh-8397
2017-03-01 13:19:05 +01:00
Phillip Webb a4bcd20b64 Merge branch '1.5.x' 2017-02-27 20:43:18 -08:00
Phillip Webb ca1540cefe Update header copyright for changed files 2017-02-27 20:41:18 -08:00
Phillip Webb 5867cd6175 Polish 2017-02-27 20:41:18 -08:00
Phillip Webb 47fd5f4fac Merge branch '1.4.x' into 1.5.x 2017-02-27 14:00:46 -08:00
Phillip Webb 47b00c086c Polish 2017-02-27 13:56:17 -08:00
Andy Wilkinson ff9788c625 Merge branch '1.5.x' 2017-02-16 09:46:26 +00:00
Andy Wilkinson f67dd957b1 Ignore excludeDevtools on extension when it has been set on bootRepackage
Previously, bootRepackage's excludeDevtools property would be
overridden by the springBoot extension's excludeDevtools property.
This prevented devtools from being included by configuring it on the
repackaging task.

This commit corrects the logic so that the setting on the repackaging
task takes priority. It also adds some tests to verify the behaviour.

Closes gh-8308
2017-02-16 09:45:51 +00:00