134 Commits

Author SHA1 Message Date
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
dreis2211
c1675c2d5f Use InvocationOnMock.getArgument() where possible
Closes gh-11818
2018-01-29 08:06:00 +01:00
dreis2211
a7663c88d3 Replace casted Mockito.any() calls
Closes gh-11817
2018-01-29 07:50:29 +01:00
Stephane Nicoll
5e26d04c05 Only generate time-to-live property for matching endpoints
This commit makes sure that a "cache.time-to-live" property is not
generated for endpoints that do not have a main read operation (i.e. a
read operation with no parameter or only nullable parameters).

This matches the endpoint feature that provides caching for only such
operation.

Closes gh-11703
2018-01-27 06:11:01 +01:00
Phillip Webb
b234501af3 Polish 2018-01-26 11:39:41 -08:00
Johnny Lim
a46e047c5d Polish
Closes gh-11792
2018-01-26 18:19:44 +01:00
Andy Wilkinson
498f66fcdc Test the Gradle plugin against Gradle 4.5
Closes gh-11768
2018-01-26 15:55:25 +00:00
Phillip Webb
adfb6dc128 Polish 2018-01-25 13:20:29 -08:00
Stephane Nicoll
43bac617d4 Add access to short deprecation reason
Closes gh-11770
2018-01-25 12:47:54 +01:00
igor-suhorukov
093ca0a687 Use EnumMap whenever possible
Replace regular Map instances with EnumMap to reduce memory consumption.

Closes gh-11760
2018-01-24 16:24:47 -08:00
Phillip Webb
ab6ad6aa4b Polish 2018-01-24 16:09:14 -08:00
Andy Wilkinson
1a1a62b744 Protect tests against Cassandra startup failures
On CI, Cassandra running inside the Docker container sometimes fails
to start or the start times out. This has nothing to do with Boot so
we  attempt to protect our tests from the flakiness of the container
by allowing 3 startup attempts.
2018-01-24 21:34:11 +00:00
andrey.onufreyko
b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
2018-01-22 16:35:06 -08:00
dreis2211
b7e663e820 Polish
Closes gh-11724
2018-01-22 15:59:20 -08:00
Phillip Webb
f3379668ac Polish 2018-01-18 23:21:51 -08:00
Phillip Webb
6d93573db0 Merge branch '1.5.x' 2018-01-18 22:03:51 -08:00
Stephane Nicoll
ba6be4f22f Merge branch '1.5.x' 2018-01-18 22:35:32 +01:00
Stephane Nicoll
aa748cb0ef Polish "Use System.lineSeparator()""
Closes gh-11665
2018-01-18 16:45:29 +01:00
Johnny Lim
d8c83af987 Use System.lineSeparator()
See gh-11665
2018-01-18 16:45:09 +01:00
Stephane Nicoll
49b5fe0c29 Polish
As `validation-api` 2 is available by default, this commit adds the
integration test as a regular test case. The integration test is kept to
exercise what happens in a standard project.

See gh-11512
2018-01-18 14:05:24 +01:00
Stephane Nicoll
60f5cf10ba Merge branch '1.5.x' 2018-01-18 13:59:19 +01:00
Andy Wilkinson
54c0cf513b Polish 2018-01-17 19:03:23 +00:00
Stephane Nicoll
d43346d6c2 Polish "Fix potential resource leaks"
Closes gh-11624
2018-01-17 13:56:53 +01:00
igor-suhorukov
5a4238acfc Fix potential resource leaks
See gh-11624
2018-01-17 13:54:50 +01:00
Stephane Nicoll
f8af6c8134 Merge branch '1.5.x' 2018-01-17 13:42:56 +01:00
Andy Wilkinson
ffc99b03dd Remove use of deprecated Gradle API from plugin's public API
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
2018-01-17 12:20:30 +00:00
Andy Wilkinson
5e17fc775c Test the Gradle plugin against Gradle 4.4.1
Closes gh-11654
2018-01-17 11:57:02 +00:00
Andy Wilkinson
2668e41dd5 Make it easier to just use Boot’s dependency management with Gradle
Closes gh-11059
2018-01-17 11:39:59 +00:00
Johnny Lim
77150f8dc9 Polish
Closes gh-11630
2018-01-15 10:20:31 +01:00
Phillip Webb
b078698f20 Update copyright year of changed files 2018-01-09 12:13:27 -08:00
Phillip Webb
85d3f5a180 Fix NPE in test containers
Fix NPE accidentally introduced during refinement.
2018-01-08 22:04:59 -08:00
Phillip Webb
201da97774 Further refine test containers 2018-01-08 16:32:39 -08:00
Andy Wilkinson
996b3ef7f2 Refine test containers 2018-01-08 14:05:05 -08:00
Phillip Webb
87bccb96f1 Merge branch '1.5.x' 2018-01-08 13:17:51 -08:00
Stephane Nicoll
66d58294d5 Merge branch '1.5.x' 2018-01-08 17:46:16 +01:00
Stephane Nicoll
f2d3f51f3f Merge branch '1.5.x' 2018-01-08 16:04:19 +01:00