Commit Graph

548 Commits (b75e196de07dbdcaf19dfec21fe4c85a5925c975)

Author SHA1 Message Date
Phillip Webb e0030094e2 Fix missing jar entry certificates
Ensure that the source jar entry is closed before reading
certificates and code signers from the entry.

gh-19041
4 years ago
Phillip Webb 4138e59c33 Fix potential JarFileEntries ClassCastException
Update `JarFileEntries` so that the interface is obtained rather than
the concrete implementation. This allows `JarEntry` values to be used
without causing a ClassCastException.

Closes gh-19041
4 years ago
Phillip Webb 895ff9c72d Merge pull request #19041 from mathieufortin01
* pr/19041:
  Polish 'Fix signed jar performance issues'
  Fix signed jar performance issues
  Ignore Visual Studio Code Files

Closes gh-19041
4 years ago
Phillip Webb c6a9696dd1 Polish 'Fix signed jar performance issues'
Update the performance improvements to push certificate loading
and storage into the `JarFileEntries` class. This allows us to
keep certificates without needing to cache all entry data. We
now also keep certificates and code signers in a dedicated class
which is set whenever the full jar stream as been read, even if
the contained values are `null`. The logic that assumes META-INF
entries are not signed has been removed in favor of delegating to
the streamed entry results.

See gh-19041
4 years ago
mathieufortin01 4d053e15d8 Fix signed jar performance issues
Update Spring Boot nested JarFile support to improve the performance of
signed jars. Prior to this commit, `certificates` and `codeSigners`
were read by streaming the entire jar whenever the existing values
were `null`. Unfortunately, the contract for `getCertificates` and
get `getCodeSigners` states that `null` is a valid return value. This
meant that full jar streaming would occur whenever either method was
called on an entry that had no result. The problem was further
exacerbated by the fact that entries might not be cached.

See gh-19041
4 years ago
Nelson Osacky 0494007893 Disable extra scans for full profile.
The extra scans were not disabled for the full profile, only the
regular profile.

See gh-22550
4 years ago
Nelson Osacky e41a53cf85 Add Gradle Enterprise Extension
This adds build caching and build scans.

The changes required disabling scans when using the maven invoker
plugin in order to not cause duplicate build scans when invoking other
maven builds. There is also an empty `.mvn` folder in the
spring-boot-starters project to prevent duplicate build scans as well
since there is no way to pass properties to the maven-javadoc-plugin.

The checkstyle plugin was causing a cache miss with the
`propertyExpansion` because it contains an absolute path. The absolute
path is now ignored and instead the files are added as inputs to the
checkstyle plugin. This only enables the local build cache. The remote
cache is not yet enabled.

On my local machine:

./mvnw clean install build times go from about 30 minutes to about 10 minutes.
./mvnw clean install -Pfull build times go from about 60 minutes to about 13 minutes.

See gh-22089
4 years ago
Andy Wilkinson 179d2c79d6 Avoid trivialising what the reader's learning about
Closes gh-22408
4 years ago
Andy Wilkinson 020a47ba3e Document support for Gradle 5
Closes gh-15358
5 years ago
Phillip Webb 50e9674631 Backport "Attempt to prevent JarFiles from being left open"
Update `JarFile` so that `super.close()` is called early so that the
file is not left open. Since we re-implement `JarFile` methods to work
directly on the underlying `RandomAccessDataFile`, it should be safe
to close immediately.

Closes gh-21177
5 years ago
Phillip Webb b3d33754a5 Remove outdated FIXMEs from tests
Closes gh-19782
5 years ago
Phillip Webb c85918b8b3 Create new JarFile instance for URL connections
Update `JarURLConnection` to ensure that when connections are opened
a new copy of the JarFile is provided.

Prior to this commit, a single `JarFile` instance was shared which meant
that it could be accidental closed if accessed via
`JarURLConnection.getJarFile()`. If the underlying jar file is closed
then it's possible for a `NoClassDefFoundError` to be thrown if running
on JDK 11 with an active `SecurityManager`.

Closes gh-17796
5 years ago
Andy Wilkinson c8907d46b4 Fix up-to-date checking of build info properties
Closes gh-20135
5 years ago
Andy Wilkinson b6a408ae77 Upgrade to Spring Asciidoctor Extensions 0.4.0.RELEASE
Closes gh-20041
5 years ago
dreis2211 db2bacc62a Fix Gradle plugin documentation links
See gh-19961
5 years ago
Andy Wilkinson ebebe09a9d Fix file handle leak in JarFileTests
The JarFile was not being closed which linked a file handle and caused
a test failure on Windows.

The local variable has been renamed as, when declared in a
try-with-resources, Checkstyle was confused by the shadowing of the
jarFile field and required references to jarFile within the try-block
the be prefixed with this.

See gh-19595
5 years ago
Madhura Bhave f375277026 Merge pull request #19595 from nosan
* pr/19595:
  Polish "Limit ChronoField values to their range"
  Limit ChronoField values to their range

Closes gh-19595
5 years ago
Madhura Bhave 91e459a5d4 Polish "Limit ChronoField values to their range"
See gh-19595
5 years ago
Dmytro Nosan 9bc68b9877 Limit ChronoField values to their range
See gh-19595
5 years ago
Phillip Webb 9bd49562fe Update copyright year of changed files 5 years ago
Andy Wilkinson 617ebaf3c0 Isolate Gradle Plugin build from other Gradle configuration
Closes gh-19656
5 years ago
Andy Wilkinson bdffa860d9 Increase startup timeout for Docker containers
Closes gh-19569
5 years ago
Andy Wilkinson d46406fcb9 Remove loading of non-existent properties file from antlib
Fixes gh-19552
5 years ago
Stephane Nicoll 5dc6491807 Clarify documentation of repackage mojo's attach property
Closes gh-19021
5 years ago
Phillip Webb accd830dd5 Update copyright header of changed files 5 years ago
Andy Wilkinson 5765cfe010 Allow 5 seconds for child to handle SIGINT before destroying it
Previously, when RunProcess handled a SIGINT it would immediately
attempt to destroy the process that it had run. This created a race
condition between the SIGINT being handled by the child process
and RunProcess destroying the child. The exact behavior of destroy
is implementation dependent and it may result in forcible termination
of the process where shutdown hooks are not called. This is what
happens on Windows. The exit code in such a case is 1 which prevents
anything from waiting for the process to complete from detecting
that it ended as a result of a SIGINT, leaving it with no choice but
to report an error. This is what happens with mvn spring-boot:run
with a forked process on Windows and results in the build failing.

This commit updates RunProcess to allow the child process to handle
the SIGINT itself, waiting for up to five seconds for that to happen
before the process is then destroyed. Given this time, the child
process exits with 130 which RunMojo already handles correctly as
indicating that the process died due to SIGINT and the build completes
with success as a result.

Fixes gh-18936
5 years ago
Andy Wilkinson 59bc3c5602 Prevent recursive config props from causing a stack overflow
Previously, when the configuration properties annotation processor
encountered a property that was the same as an outer type that had
already been processed, it would fail with a stack overflow error.

This commit introduces the use of a stack to track the types that
have been processed. Types that have been seen before are skipped,
thereby preventing a failure from occurring. We do not fail upon
encountering a recursive type to allow metadata generation to
complete. At runtime, the recursive property will not cause a problem
if it is not bound.

Fixes gh-18365
5 years ago
dreis2211 8955d5c1b5 Test the Gradle Plugin against Gradle 5.6.4
See gh-18845
5 years ago
dreis2211 d17f11dbe1 Test the Gradle Plugin against Gradle 5.6.3
See gh-18648
5 years ago
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
5 years ago
dreis2211 417bfc4c87 Fix comment position in ZipHeaderPeekInputStreamTests
See gh-18445
5 years ago
Andy Wilkinson 7b1e10ed00 Use one sentence per line in Actuator and Gradle plugin doc source
Closes gh-18185
5 years ago
Andy Wilkinson 795c2f225f Support getComment() on a nested JarFile
Previously, calling getComment() on a nested jar file would result
in the outer jar file's comment being returned.

This commit updates the loader's JarFile to read the file's comment
from the central directory end record and return it from getComment().

Fixes gh-18128
5 years ago
dreis2211 ae30515e5e Test the Gradle Plugin against Gradle 5.6.2
See gh-18164
5 years ago
Andy Wilkinson 29080b87ec Protect autoconfigure module against slow starting test containers 5 years ago
Andy Wilkinson abba4fa9c9 Include exception's message in message printed by AP
Fixes gh-17974
5 years ago
Andy Wilkinson edcaee375f Consider @Deprecated on field when determining property's deprecation
Fixes gh-17550
5 years ago
dreis2211 26a22fa523 Test the Gradle Plugin against Gradle 5.6.1
See gh-17984

Closes gh-17984
5 years ago
Andy Wilkinson ab87b2a39b Polish 5 years ago
dreis2211 56940fca97 Test the Gradle Plugin against Gradle 5.6
See gh-17876
5 years ago
Madhura Bhave 541d3c4853 Fix typo 5 years ago
Stephane Nicoll 0c560795fd Harmonize settings.gradle documentation in Gradle getting started guide
See gh-17736
5 years ago
Dave Syer e7b0450a7f Add missing repositories to snapshot configuration
See gh-17736
5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Phillip Webb 30b5ba87ae Merge branch '2.0.x' into 2.1.x 5 years ago
dreis2211 e9203a280c Test the Gradle Plugin against Gradle 5.5.1
See gh-17496
5 years ago
Andy Wilkinson 7553b60e68 Test the Gradle Plugin against Gradle 5.5
Closes gh-17428
5 years ago
Andy Wilkinson 4083c721f2 Fix URL normalization when replacing /./ with /
Previously, a regular expression of /./ was used to replace /./ with
/.  The '.'' in the expression matches any single character so the
replacement was more broadly applicable than it should have been. For
example, /a/ would be replaced with /.

This commit uses Pattern.LITERAL to compile the regular expression
from the CURRENT_DIR (/./) contant. This allows the constant to be
used to check for occurances of /./ in the string before attempting
replacement, while also ensuring that the '.' is treated literally.

Closes gh-17341
5 years ago
Andy Wilkinson f4e7b80651 Merge branch '2.0.x' into 2.1.x
See gh-17361
5 years ago