Previously, DevTools assumed that the TCCL was a URLClassLoader
when trying to determine the URLs that it should examine to determine
the locations that should be watched for triggering a restart. This
fails on Java 9 as the TCCL is not a URLClassLoader.
This commit updates the logic that determines the changeable URLs to
fall back to examining the JVM's class path when the TCCL is not a
URLClassLoader, typically because the application is running on Java
9. This fall back isn't a direct equivalent of the behaviour on Java 8
as the class path of the TCCL and the class path with which the JVM
was launched may not be the same. However, I consider the fix to be
reasonable for two reasons:
1. In reality, the class path of the TCCL and the class path with
which the JVM was launched are the same.
2. There appears to be now to get the URLs on the class path of the
TCCL on Java 9. There is a URLClassPath field, however Java 9's
access restrictions prevent us from using it even if we resort to
reflection.
Closes gh-10454
This commit fixes Javadoc generation when building with Java 9. It
upgrades the Javadoc plugin to a version that is Java 9 compatible
(3.0.0-M1) and reworks DevTools to remove usage of @PostConstruct.
The latter change is necessary as @PostConstruct is not visible by
default when building with Java 9 and, therefore its usage causes
Javadoc generation to fail.
Closes gh-10029
Previously, when DevTools encountered a jar with a Class-Path manifest
attribute that referenced non-existent files, it would log one
message per entry in the attribute that did not exist. While useful
information, this has proven to be too verbose.
This commit aims to strike a better balances by logging a single
message for an entire jar. The message is a single line that
includes the path to the jar with the faulty Class-Path manifest
attribute and the paths of all of the files that do not exist that are
referenced by the attribute.
Closes gh-10111
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
Prior to this commit, custom `ProtocolResolvers` set on the
`ApplicationContext` were lost when Devtools is used as the customized
`ResourceLoader` did not copy any customization made to the default
resource loader.
This commit makes sure to copy any `ProtocolResolver` set on the context.
Closes gh-9331