269 Commits

Author SHA1 Message Date
Andy Wilkinson
3370c23ab9 Skip the Gradle plugin when building with the full profile and JDK 10
See gh-12028
2018-03-02 17:48:27 +00:00
Andy Wilkinson
2b1252e282 Skip the Gradle Plugin when building with JDK 10
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
2018-03-02 17:05:58 +00:00
Andy Wilkinson
4a3e0a231c Test the Gradle plugin against Gradle 4.6
Closes gh-12314
2018-03-02 13:41:28 +00:00
Andy Wilkinson
e4a1fed3b8 Test the Gradle plugin against Gradle 4.6 2018-03-02 13:41:27 +00:00
Andy Wilkinson
188d120c9c Test the Gradle plugin against Gradle 4.5.1
Closes gh-12315
2018-03-02 13:41:27 +00:00
Andy Wilkinson
8d1e69bca4 Polish Gradle plugin's javadoc 2018-02-28 20:22:45 +00:00
Andy Wilkinson
703de64842 Reinstate imports 2018-02-28 20:11:42 +00:00
Phillip Webb
7bc535e4fa Polish 2018-02-28 10:59:26 -08:00
Stephane Nicoll
4180762d6d Polish contribution
Closes gh-12236
2018-02-28 09:01:59 +01:00
igor-suhorukov
56cbc65e7b Polish
See gh-12236
2018-02-28 08:58:46 +01:00
Andy Wilkinson
9640881f38 Fix BuildInfo up-to-date check when group, name, or version changes
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
2018-02-27 21:21:16 +00:00
Phillip Webb
3e4da3cc37 Polish 2018-02-27 12:53:01 -08:00
Andy Wilkinson
fdb9a1ea8f Consider time in BuildInfo up-to-date checks and allow it to be set
Closes gh-12111
Closes gh-12266
2018-02-27 20:09:07 +00:00
Andy Wilkinson
30f79f2fb1 Use application name as convention for distribution's base name
Closes gh-12232
2018-02-27 12:56:50 +00:00
Andy Wilkinson
60ac2e5c09 Reduce the amount of garbage produced by JarFile
Previously, working with a JarFile created a large amount of garbage
that was allocated on the thread local allocation buffer (TLAB).
The TLAB allocations made a significant contribution to GC pressure
and slowed down startup. This commit reduces the amount of garbage
by making a number of changes.

Reading from a RandomAccessDataFile has been reworked to avoid
creating new RandomAccessFile instances. A single RandomAccessFile
is now created for an entire jar file and it is used to read data from
anywhere in that jar file, including entries in nested jar files. To
ensure that reads remain thread-safe, a lock is taken on the
RandomAccessFile that is shared by all RandomAccessDataFile instances
that are provided access to (portions of) the same jar file.

Reading all of the bytes from a RandomAccessData has been reworked to
avoid the use of an InputStream that was created, used to read the
data, and then thrown away. In place of the InputStream-based
mechanism a method has been introduced that returns all of the
RandomAccessData as a byte[]. Building on this change, a method has
also been introduced to read a portion of a RandomAccessData as a
byte[]. This avoids the need to create a new RandomAccessData
subsection where the subsection was only used to read its entire
contents and then thrown away.

Decoding of an MS-DOS datetime has been reworked to use LocalDataTime
rather than GregorianCalendar. The former produces less garbage than
the latter.

Closes gh-12226
2018-02-27 10:48:15 +00:00
Phillip Webb
29c3be3590 Polish 2018-02-26 10:26:02 -08:00
Stephane Nicoll
306c79f0de Merge branch '1.5.x' 2018-02-26 18:03:32 +01:00
igor-suhorukov
98f4692c62 Polish
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.

Closes gh-12211
2018-02-25 10:59:02 +01:00
Stephane Nicoll
2641559231 Polish contribution
Closes gh-12202
2018-02-24 16:10:44 +01:00
dreis2211
e2fb093ccf Polish
See gh-12202
2018-02-24 16:09:38 +01:00
Johnny Lim
d441a8a89a Polish
Closes gh-12205
2018-02-24 11:53:25 +01:00
Andy Wilkinson
85c7ed2746 Merge branch '1.5.x' 2018-02-23 17:15:23 +00:00
Phillip Webb
4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Stephane Nicoll
3fddfee65c Fix default value of endpoint's cache ttl
Closes gh-12173
2018-02-22 13:35:50 +01:00
igor-suhorukov
fe023817c7 Polish static finals
Closes gh-12083
2018-02-19 20:10:58 -08:00
Johnny Lim
88b184ca23 Polish 2018-02-19 20:00:20 -08:00
Andy Wilkinson
e1ab62668f Merge branch '1.5.x' 2018-02-13 15:05:28 +00:00
Andy Wilkinson
5522174e96 Provide package info for all packages included in javadoc 2018-02-08 16:50:37 +00:00
Andy Wilkinson
a09c64e18c Polish 2018-02-08 11:15:36 +00:00
Andy Wilkinson
70c613819d Fix incomplete calls to assertThat 2018-02-08 11:06:54 +00:00
Andy Wilkinson
76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Andy Wilkinson
b4f4dd3fdd Correct location of JDT config files in Gradle plugin 2018-02-08 10:42:50 +00:00
Andy Wilkinson
8b15bbf702 Polish 2018-02-05 16:12:23 +00:00
Andy Wilkinson
76ed52c2f5 Polish "Support nested jar paths in loader.path"
Closes gh-11121
2018-02-05 16:06:07 +00:00
hanyong
9eb8e3d4e3 Support nested jar paths in loader.path
See gh-11121
2018-02-05 16:04:03 +00:00
dreis2211
81459efffa Use HTTPS URLs where applicable 2018-02-02 12:03:12 +00:00
Andy Wilkinson
875091ed85 Polish “Remove or use unused method parameters”
Closes gh-11812
2018-02-02 09:34:19 +00:00
igor-suhorukov
717bd2c580 Remove or use unused method parameters 2018-02-02 09:34:19 +00:00
Phillip Webb
7d5e41f7dc Polish 2018-02-01 10:25:33 -08:00
Andy Wilkinson
1d2b85b2b8 Ensure that TestJarFile uses insertion order for jar's entries
Previously, the order of the entries in a TestJarFile was determined
by the underlying file system rather than by the order in which
they were added. This could lead to unpredicatable ordering and
failures in tests that verify archive entry ordering.

This commit updates TestJarFile to add entries to the archive in
insertion order.

See gh-11695
See gh-11696
2018-02-01 13:07:50 +00:00
Andy Wilkinson
b2dad7f1c4 Rework entry ordering of repackaged archives
Previously, the Repackager would write entries in the following
order:

- Libraries that require unpacking
- Existing entries
    - Application classes
    - WEB-INF/lib jars in a war
- Libraries that do not require unpacking
- Loader classes

Libraries that require unpacking were written before existing entries
so that, when repackaging a war, an entry in WEB-INF/lib would not
get in first and prevent a library with same location from being
unpacked. However, this had the unwanted side-effect of changing
the classpath order when an entry requires unpacking.

This commit reworks the handling of existing entries and libraries
that require unpacking so that existing entries can be written first
while also marking any that match a library that requires unpacking
as requiring unpacking.

Additionally, loader classes are now written first. They are the
first classes in the jar that will be used so it seems to make sense
for them to appear first. This aligns Maven-based repackaging
with the Gradle plugin's behaviour and with the structure documented
in the reference documentation's "The Executable Jar Format" appendix.

The net result of the changes described above is that entries are
now written in the following order:

- Loader classes
- Existing entries
    - Application classes
    - WEB-INF/lib jars in a war marked for unpacking if needed
- Libraries

Closes gh-11695
Closes gh-11696
2018-02-01 11:38:33 +00:00
Johnny Lim
3cead7693d Polish
Closes gh-11871
2018-02-01 08:35:42 +01:00
Andy Wilkinson
8f116f7e6f Align ordering of BootJar and BootWar archive entries
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
2018-01-31 14:38:38 +00:00
Phillip Webb
7c5042d079 Don't run apply-plugin tests
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
2018-01-30 21:45:17 -08:00
Phillip Webb
6dddceacad Always include plugin classpath in sample gradle
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
2018-01-30 20:08:04 -08:00
Phillip Webb
886b39293c Merge branch '1.5.x' 2018-01-30 12:51:45 -08:00
Phillip Webb
187c4d728c Merge branch '1.5.x' 2018-01-30 12:47:30 -08:00
Stephane Nicoll
51c307f643 Merge branch '1.5.x' 2018-01-30 16:43:54 +01:00
Phillip Webb
af50a18da9 Polish 2018-01-29 09:47:03 -08:00
Andy Wilkinson
199088b0c9 Set kotlin.version when Kotlin's Gradle plugin is applied
Closes gh-11711
2018-01-29 10:13:54 +00:00