Commit Graph

1207 Commits

Author SHA1 Message Date
Andy Wilkinson 8b53ff454c Merge branch '1.5.x' 2017-07-25 16:54:12 +01:00
Andy Wilkinson e0be40cd94 Polish "Locate additional metadata when using Gradle 4"
Closes gh-9732
2017-07-25 16:48:46 +01:00
Misagh Moayyed 980b83c0d8 Locate additional metadata when using Gradle 4
Closes gh-9758
2017-07-25 16:48:27 +01:00
Emanuel Campolo 2626a3a795 Use lambdas when possible
Replace anonymous inner classes with lambda declarations (when possible
using method references).

See gh-9781
2017-07-25 00:53:38 -07:00
Emanuel Campolo d16af43664 Replace try with try-with-resources
Update existing try/finally/close blocks to use "try with resources"

See gh-9781
2017-07-25 00:53:38 -07:00
Emanuel Campolo 798fe5ed53 Collapse catch clauses
Use multi-catch for exceptions whenever possible.

See gh-9781
2017-07-25 00:53:37 -07:00
Emanuel Campolo 4a189bdee7 Replace Collections.sort() with direct sort call
Replace existing `Collections.sort(...)` calls with `.sort(...)`
directly on the collection instance.

See gh-9781
2017-07-25 00:53:37 -07:00
Emanuel Campolo 04fdec6f8b Replace explicit generics with diamond operator
Where possible, explicit generic declarations to use the Java 8 diamond
operator.

See gh-9781
2017-07-25 00:53:37 -07:00
Phillip Webb c635bf5026 Fix broken Gradle plugin imports
Fix imports that were accidentally broken in commit 3a01f4a6d.
2017-07-25 00:06:39 -07:00
Phillip Webb 3a01f4a6da Polish lambda formatting 2017-07-24 13:18:33 -07:00
Phillip Webb 7b2b8dc4a3 Merge branch '1.5.x' 2017-07-24 13:02:12 -07:00
Phillip Webb 28dad44e2d Be defensive about JUL calls from JAR Handler
Update nested JAR support to only obtain JUL loggers when absolutely
necessary and to defensively deal with failures.

Prior to this commit it was not possible to override
`java.util.logging.manager` to use a nested JAR as the logger
implementation.

Fixes gh-9848
2017-07-24 12:54:24 -07:00
Andy Wilkinson a2f791287f Disable the use of Gradle's daemon when running compatility tests 2017-07-21 09:13:11 +01:00
Andy Wilkinson 1b1c9d06f4 Update Gradle compatibility versions to cover 4.0.1 and 4.1-rc-1
Closes gh-9598
2017-07-21 08:47:32 +01:00
Eddú Meléndez 9910eab47c Update Gradle versions to check compatibility with 3.5.1, 4.0, 4.1 M1
See gh-9598
2017-07-21 08:47:07 +01:00
Phillip Webb 8e3baf3130 Polish 2017-07-11 13:57:21 -07:00
Stephane Nicoll 3ba6954b02 Merge branch '1.5.x' 2017-07-09 14:43:41 +02:00
Stephane Nicoll 11fb792e88 Fix source repository links in maven plugin site
Closes gh-9671
2017-07-09 14:43:32 +02:00
Phillip Webb eb17aa06f9 Merge branch '1.5.x' 2017-07-06 18:38:52 -07:00
Phillip Webb aa57ca7e18 Polish 2017-07-06 16:53:04 -07:00
Andy Wilkinson 216c5c2179 Set executable permission on Gradle-built archives that include launch script
Closes gh-9632
2017-06-29 12:45:58 +01:00
Andy Wilkinson c59214792b Verify that bootJar and bootWar handle duplicates gracefully
Closes gh-9573
2017-06-22 11:45:10 -07:00
Andy Wilkinson f0b7e7cf56 Ensure that fat jars and wars do not corrupt UTF-8 entry names
Previously, both Repackager and the Grade plugin used the JRE's
standard ZipOutputStream when creating a fat jar or war file. This
resulted in entry names that needed UTF-8 encoding to become
corrupted.

This commit updates both to use Commons Compress'
ZipArchiveOutputStream and to configure the stream's encoding and
each entry's Unix mode. This ensures that names are encoded using
UTF-8 and can be read back in correctly by common zip tools.

Closes gh-9405
2017-06-22 11:45:10 -07:00
Stephane Nicoll 235daf839f Merge branch '1.5.x' 2017-06-22 10:49:14 +02:00
Stephane Nicoll d77056639d Add a warning about fully executable archive
Closes gh-9574
2017-06-22 10:49:01 +02:00
Stephane Nicoll e230952dd2 Polish "Add prefix to all properties in maven plugin"
Closes gh-9567
2017-06-22 09:13:44 +02:00
Eddú Meléndez 4510be0f8f Add prefix to all properties in maven plugin
This commit add prefix `spring-boot` to all Mojo's properties.

See gh-9567
2017-06-22 09:13:44 +02:00
Andy Wilkinson e6a3ca5da6 Address deprecation warning that's generated by Gradle 4.x
In Gradle 4.x, SourceSetOutput now has multiple classes directories
and getClassesDir() has been deprecated. This commit introduces the
use of reflection to use getClassesDirs() when it's available rather
than getClassesDir().

Closes gh-9559
2017-06-21 12:52:05 -07:00
Stephane Nicoll cabe59d65a Remove animal sniffer
See gh-9564
2017-06-21 10:10:02 +02:00
Andy Wilkinson 49a62a7c33 Correct the scope of the spring-boot-test-support dependency
Closes gh-9550
2017-06-19 11:36:05 +01:00
Andy Wilkinson 991314c63d Merge branch '1.5.x' 2017-06-16 09:13:42 +01:00
Andy Wilkinson 59122358d3 Clean up and format code 2017-06-16 08:58:14 +01:00
Stephane Nicoll dbabfc224c Add support for Lettuce in RedisTestServer
Previously, RedisTestServer only supported Jedis and would blow up if
only Lettuce was on the classpath. This commit defensively checks which
driver is available and chose the appropriate one, defaulting to Jedis.

Closes gh-9524
2017-06-15 14:42:24 +02:00
Stephane Nicoll 81efd225f9 Merge branch '1.5.x' 2017-06-14 09:30:06 +02:00
Stephane Nicoll acda4f905f Add support for deprecation level
This commit ensures that deprecation level set in manual metadata is
properly merged in the generated one.

Closes gh-9449
2017-06-14 09:28:59 +02:00
Phillip Webb b94bb00fa1 Remove need for attached test-jar artifacts
Remove test-jar artifacts from Maven projects and relocate classes. The
majority of utilities now live in the `spring-boot-testsupport` module.

This update will help us to deploy artifacts using the standard Maven
deploy plugin in the future (which doesn't support the filtering of
individual artifacts).

Fixes gh-9493
2017-06-12 21:11:35 -07:00
Andy Wilkinson 700af8ed00 Merge branch '1.5.x' 2017-06-12 14:25:26 +01:00
Andy Wilkinson 2d3bcae4e1 Make JarURLConnection return entry's length from getContentLengthLong()
Closes gh-9484
2017-06-12 13:46:59 +01:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Phillip Webb 2c7dd9f519 Polish 2017-06-02 16:00:39 -07:00
Andy Wilkinson 7301f9b5e8 Merge branch '1.5.x' 2017-06-01 11:04:42 +01:00
Andy Wilkinson 5c708ae712 Merge branch '1.4.x' into 1.5.x 2017-06-01 11:04:23 +01:00
Andy Wilkinson 5b4f9edc86 Restore original TCCL in PropertiesLauncherTests
Calling launch of PropertiesLauncherTests sets the thread context
class loader to an instance of LaunchedURLClassLoader. To avoid this
class loader being used beyond the scope of the test and launcher
that created it, this commit updates PropertiesLauncherTests to
capture the TCCL before each test and restore it after each test.

Closes gh-9378
2017-06-01 10:58:00 +01:00
Andy Wilkinson 2928a31278 Merge branch '1.5.x' 2017-05-31 23:43:55 +01:00
Andy Wilkinson c22230a418 Try making FilePool static to fix the Mockito problem on Bamboo 2017-05-31 23:24:03 +01:00
Andy Wilkinson 8e2986c86e Fix call to isSpy to be compatible with Mockito 2 2017-05-31 22:10:14 +01:00
Andy Wilkinson b85eed4b58 Polish 2017-05-31 21:59:46 +01:00
Andy Wilkinson bcd34bca6f Merge branch '1.5.x' 2017-05-31 21:50:35 +01:00
Andy Wilkinson e11b7aff08 Ensure that file is released back to pool when seek fails
Closes gh-9370
2017-05-31 21:50:05 +01:00
Andy Wilkinson 4a605f6270 Drop custom software component in favor of just publishing an artifact
Previously, Spring Boot's Gradle plugin provided custom software
components (bootJava and bootWeb) for publishing the artifacts created
by the standard bootJar and bootWar tasks respectively. Providing a
custom software component requires the usage of some of Gradle's
internal APIs and this has now proven to be more trouble than it is
worth.

This commit removes the custom software component and documents how
to publish the artifact created by a BootJar or BootWar task directly
instead.

Closes gh-9153
2017-05-31 14:25:25 +01:00
Andy Wilkinson a685d9ec92 Run Gradle integration tests against multiple versions of Gradle
Closes gh-9365
2017-05-31 12:17:12 +01:00
Andy Wilkinson 5f3462f358 Use ObjectFactory rather than Usages to create Usage on Gradle 4.0
Usages has been removed in Gradle 4.0 and replaced with the use of
a new ObjectFactory API that can be used to create a Usage. This
commit uses reflection to access the ObjectFactory from the Project
and use it to create a Usage when an attempt to use Usages fails.

Closes gh-9364
2017-05-31 12:17:12 +01:00
Stephane Nicoll e8aa3a3a8e Upgrade to Maven War Plugin 3.1.0
Closes gh-9344
2017-05-29 16:16:43 +02:00
Stephane Nicoll 294bcbe962 Merge branch '1.5.x' 2017-05-29 14:56:34 +02:00
Stephane Nicoll 9b2ad6100e Fix reference of custom layout example
Closes gh-9342
2017-05-29 14:56:14 +02:00
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