Commit Graph

1048 Commits

Author SHA1 Message Date
Andy Wilkinson
629a77c3e2 Remove ASM dependency and use Spring Core's instead
Depending on ASM itself can cause problems as it can clash with other
libraries' dependency on it. This commit updates
spring-boot-loader-tools to depend upon spring-core and use its
repackaged copy of ASM instead. Depending on spring-core also brings
with it the advantage of giving access to its various bits of utility
code.

spring-boot-maven-plugin has been updated to remove its ASM
exclusions as they will no longer clash with the version from
spring-boot-loader-tools

(59483608)
2013-10-24 14:38:22 +01:00
Andy Wilkinson
c0ae78f3ec Isolate Aether in a separate class loader
Prior to this commit, the Aether-based GrapeEngine was loaded in the
same class loader as the rest of Boot. This led to Aether's and its
dependencies' types polluting the application's class path. Most
notably, this caused problems with logging as the logging framework
could be permaturely initialized.

This commit isolates AetherGrapeEngine, Aether and its dependencies
into a separate class loader. This is done by customizing the
packaging of the CLI's jar file with the internal directory housing
all of the types that will be loaded by the separate class loader.
2013-10-22 17:13:20 +01:00
Andy Wilkinson
b0c6d8060c Remove Git plugin from Spring Boot tools
The Git plugin was primarily being used to provide version information
that Boot's maven plugin can add into the MANIFEST.MF of the uber-jars
that it creates under the Spring-Boot-Commit-Id attribute.

This commit removes the Git plugin from Boot's own projects, but
leaves it in the spring-boot-starter-parent for use by Spring
Boot-based applications.

The attribute in the uber-jars' MANIFEST.MF has been replaced with a
Spring-Boot-Version attribute. The value of this attribute is the
implementation version of Repackager class's package.
2013-10-22 15:54:05 +01:00
Phillip Webb
6220aba983 Allow 'java -jar' to work with signed nested jars
Fix RandomAccessJarFile to correctly read certificate information as
jar entries are loaded. This change allows signed nested jars to be
used as JCE providers.
2013-10-17 17:19:51 -07:00
Phillip Webb
5c6dd52e9a Polish 2013-10-17 14:12:42 -07:00
Dave Syer
fede0d1c98 Add profiles to /env 2013-10-16 13:42:13 -04:00
Dave Syer
47cd5dd679 Tooling for PropertiesLauncher in JAR archives
To use PropertiesLauncher instead of JarLauncher in an
executable JAR we have provided tooling support. In Maven
(using the starter parent to default some of the settings):

    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
      <configuration>
        <layout>ZIP</layout>
      </configuration>
    </plugin>

in Gradle:

    apply plugin: "spring-boot"
    springBoot {
        layout = 'ZIP'
      }
    }

[Fixes #58837492] [bs-330] Add tooling for PropertiesLauncher
2013-10-16 08:49:51 -04:00
Dave Syer
ea11dafcbd Extend PropertiesLauncher to load nested archives
PropertiesLauncher can now be used to run an executable jar, and by
default it will pick up nested archives in lib/ (where the Boot
tools puts them). User can provide loader.path (colon-separated)
to change the nested path.

[#58837492] [bs-330] Add tooling for PropertiesLauncher
2013-10-15 11:08:45 -04:00
Dave Syer
d4d9ebcabd Small re-org of PropertiesLauncher 2013-10-15 09:56:52 -04:00
Dave Syer
be1263500d Ensure env vars are consulted for PATH 2013-10-14 16:07:50 -04:00
Dave Syer
281c650251 Add git commit id to MANIFEST in boot tools repackager 2013-10-14 16:06:32 -04:00
Dave Syer
b0c54a6588 Add parent class loader entries if possible
...otherwise you can see cryptic NoClassDefFound errors
because the application class was loaded from the parent
on the file system, but then it doesn't have access to the
child loaders nested jars.
2013-10-14 16:02:04 -04:00
Dave Syer
114b7a5e95 Ensure UPPER_CASE overrides work in PropertiesLauncher 2013-10-14 11:16:40 -04:00
Phillip Webb
35ff983b40 Prevent duplicate resource enumeration form loader
Fix LaunchedURLClassLoader to only enumerate resources from the
rootLoader and the URLs.

Commit cd2c189 (Support javaagent instrumentation with loader) added
a parent classloader and used filtering in the loadClass() method
to ensure classes were loaded from the appropriate location. The change
in parent means that locally packaged resources are found twice, once
from the parent, and once from the self archive URL.

LaunchedURLClassLoader now overrides getResource and getResources to
filter out the parent classloader and instead only add resources from
the root classloader and the URLs.

Issue: #56232870
2013-10-09 11:09:03 -07:00
Phillip Webb
af0d08c998 Polish 2013-10-08 21:17:39 -07:00
Phillip Webb
b772f7c2e4 Polish
Minor formatting and consistent copyright header.
2013-10-08 20:30:45 -07:00
dave noel
a1517de6db Add gradle runJar 2013-10-01 14:57:56 -04:00
Phillip Webb
15bc25dc29 Further re-organization of launcher code 2013-09-24 15:31:24 -07:00
Dave Syer
0e0eb7d3fa Add loader.system (flag to copy properties to System) 2013-09-24 09:23:44 +01:00
Dave Syer
a3af83cf96 Add internal property replacement
E.g. in application.properties (for launcher)

foo: Application
loader.main: my.${foo}
loader.path: etc
2013-09-24 09:15:30 +01:00
Dave Syer
a70d293c87 Re-organize the Launcher code a bit 2013-09-24 08:52:04 +01:00
Phillip Webb
e9fd7c96b8 Loader changes 2013-09-24 08:52:04 +01:00
Dave Syer
053c072155 Add some tests for PropertiesLauncher 2013-09-24 08:52:04 +01:00
Dave Syer
f83fd47184 Add PropertiesLauncher 2013-09-24 08:52:03 +01:00
Phillip Webb
fd9e258d12 Replace 'springsource.org' with 'spring.io'
Replace all references to 'springsource.org' with the new 'spring.io'
domain.
2013-09-23 14:44:59 -07:00
Dave Syer
8a1e39c4dc Remove unused annotation 2013-09-05 17:15:16 -07:00
Phillip Webb
e2b3c03fc4 Refine LaunchedURLClassLoader load order
Refine the loading order of LaunchedURLClassLoader to consider the
root loader before locally bundled classes.

The prevents classes from locally bundled JARs from replacing system
classes.

Issue: #56232870
2013-09-05 17:15:15 -07:00
Phillip Webb
680741fdc8 Fix LaunchedURLClassLoader Java 1.6 compatibility 2013-09-05 17:15:15 -07:00
Phillip Webb
cd2c18965e Support javaagent instrumentation with loader
Update spring-boot-loader to allow `-javaagent` instrumentation when
running from executable jars.

Prior to this commit the `Launcher` skipped the application classloader
and instead used the system classloader as a parent. This was to ensure
that locally packaged classes were always loaded by the classloader
that had access to nested jars.  Unfortunately when using the
`-javaagent` option, it is the application classloader that is modified.

The `Launcher` class now uses the application classloader as parent
and `LaunchedURLClassLoader` has been updated to always search local
URLs before delegating to the parent. This is very similar to the way
that most application servers handle the loading of war files.

Issue: #56232870
2013-09-05 17:15:15 -07:00
Dave Syer
38e565e920 Back to SNAPSHOT for dev 2013-09-05 17:15:15 -07:00
Dave Syer
b634b3bde6 Update to 0.5.0.M2 2013-09-05 17:15:15 -07:00
Phillip Webb
5b7d56895b Provide accurate InputStream.available() results
Provide accurate InputStream.available() results by using the size
attribute of the ZipEntry. This helps improve performance with
CGLib and also fixes issues where libraries expect that a non-zero
result from available() indicates that read() will not return -1.
2013-09-05 17:14:16 -07:00
Biju Kunjummen
29afcb7898 Added an @Execute annotation to RunMojo
Update RunMojo to include an @Execute annotation. Allows the use of
`mvn spring-boot:run` without having to compile/package first. Now a
command like `mvn clean spring-boot:run` works.

The phase for @Execute annotation is along the lines of what is used
for the `jetty:run` plugin.
2013-09-05 17:14:15 -07:00
Phillip Webb
c999541fd3 Set source/target version to 1.6 for int. tests 2013-09-05 17:14:14 -07:00
Phillip Webb
e6d9922cbc Stream maven-invoker-plugin logs 2013-09-05 17:14:14 -07:00
Daniel L. Buchko
7ecb99757b Prevent test failures under Windows
Cleaned up file separators to prevent tests failing on Windows.
2013-09-05 17:14:14 -07:00
Daniel L. Buchko
3c5fa0daa0 Fixed handling of spaces in file paths
Update Launcher to correctly handle spaced in file paths.
2013-09-05 17:14:14 -07:00
Phil Webb
3690ab16ba Fix README.md typo 2013-09-05 17:14:08 -07:00
Phillip Webb
878ff13620 Documentation updates 2013-08-09 15:34:04 -07:00
Phillip Webb
ce5e145afa Add Libraries.NONE static final 2013-08-09 15:33:37 -07:00
Phillip Webb
0b7256e7f9 Fix compile failure on JDK 6 2013-08-09 13:01:39 -07:00
Phillip Webb
cf655945aa Polish 2013-08-09 12:28:54 -07:00
Phillip Webb
e773db2401 Remove unused test resources 2013-08-06 00:22:02 -07:00
Phillip Webb
4e11ae1671 Documentation
Various updates to README.md files.
2013-08-05 22:36:22 -07:00
Phillip Webb
1db22aca5c Rework POM structure
Rework main build POM to be an aggregator pom that does not inherit
from any parent. Introduce new spring-boot-dependencies module to
act as a parent for both spring-boot-starter-parent and
spring-boot-parent.
2013-08-02 21:58:24 -07:00
Dave Syer
413658fbca Change parent for tools poms 2013-08-02 12:14:11 +01:00
Dave Syer
4bb5de02e7 Switch back to SNAPSHOT for dev 2013-08-02 12:00:14 +01:00
Dave Syer
19a880dff6 Move tools modules under spring-boot-tools 2013-08-02 12:00:14 +01:00