Commit Graph

288 Commits

Author SHA1 Message Date
Andy Wilkinson 17f61c1dad Update javadoc of LaunchedURLClassLoader to describe delegation model
Closes gh-3864
2015-10-27 10:09:10 +00:00
Phillip Webb 1e4d974ec0 Merge remote-tracking branch 'local12x/1.2.x' 2015-10-19 12:56:55 -07:00
Phillip Webb a79131f8d2 Organize imports with new settings
See gh-4234
2015-10-19 12:55:44 -07:00
Spring Buildmaster 2b38a861e3 Next Development Version 2015-10-16 05:57:24 -07:00
Andy Wilkinson 30f24eac0a Merge branch '1.2.x' 2015-10-14 16:33:55 +01:00
Andy Wilkinson 7e718cda26 Remove redundant hash from path of unpacked nested library
Closes gh-4124
2015-10-14 16:32:58 +01:00
Phillip Webb 04074fece1 Merge branch '1.2.x' 2015-10-09 13:39:09 -07:00
Phillip Webb 94736719f1 Reformat package-info.java files with Eclipse Mars 2015-10-09 13:32:57 -07:00
Andy Wilkinson 2afb641603 Merge branch '1.2.x' 2015-10-09 15:21:21 +01:00
Andy Wilkinson 04c2bd9c89 Update tests to expect additional entry in test jar
Closes gh-4124
2015-10-09 15:19:50 +01:00
Andy Wilkinson 8948322d7a Merge branch '1.2.x' 2015-10-09 14:59:54 +01:00
Andy Wilkinson 888fa90265 Ensure that JarFileArchive unpacks entries to unique location
Previously, JarFileArchive would always unpack any entries marked for
unpacking to ${java.io.tmpdir}/spring-boot-libs. This could cause
problems if multiple Spring Boot applications were running on the same
host:

- If the apps are run as different users the first application would
  create the spring-boot-libs directory and the second and subsequent
  applications may not have write permissions to that directory
- Multiple apps may overwrite each others unpacked libs. At best this
  will mean one copy of a jar is overwritten with another identical
  copy. At worst the jars may have different contents so that some of
  the contents of the original jar disappear unexpectedly.

This commit updates JarFileArchive to use an application-specific
location when unpacking libs. A directory beneath ${java.io.tmpdir} is
still used but it's now named <jar-file-name>-spring-boot-libs-<uuid>.
A loop, limited to 1000 attempts, is used to avoid problems caused by
the uuid clashing.

Closes gh-4124
2015-10-09 14:59:18 +01:00
Phillip Webb aae38db9af Fix compiler warnings only shown in Eclipse Mars 2015-10-07 23:40:28 -07:00
Phillip Webb c9fb9916b8 Reformat code using Eclipse Mars 2015-10-07 23:37:10 -07:00
Phillip Webb e473364e4e Merge branch '1.2.x' 2015-10-07 23:34:08 -07:00
Phillip Webb 6ab376e2e8 Reformat code use Eclipse Mars 2015-10-07 23:32:31 -07:00
Andy Wilkinson 051ebf3fac Polishing: fix a number of compiler warnings reported by Eclipse 2015-09-22 13:30:07 +01:00
Spring Buildmaster 9409c49c10 Next development version 2015-09-16 09:00:17 -07:00
Phillip Webb 269815dbcf Make LaunchedURLClassLoader constructor public
Restore the public constructor in LaunchedURLClassLoader which was
accidentally removed in commit e07df7e4c6.
2015-09-09 09:20:34 -07:00
Phillip Webb e674d751de Polish Javadoc 2015-09-08 17:01:36 -07:00
Phillip Webb e07df7e4c6 Remove redundant modifiers 2015-09-08 17:01:30 -07:00
Phillip Webb 460ca75fce Polish newline at end of file 2015-09-08 16:05:22 -07:00
Phillip Webb 6e29ee4557 Polish 2015-09-08 16:04:30 -07:00
Phillip Webb 67402405db Reformat code 2015-09-08 14:56:40 -07:00
Phillip Webb 0335053139 Merge branch '1.2.x' 2015-09-08 14:37:16 -07:00
Phillip Webb 15686ed4fd Reformat code 2015-09-08 14:07:06 -07:00
Phillip Webb 690da89c82 Fix warnings 2015-09-05 00:21:09 -07:00
Ilayaperumal Gopinathan 61ac04aa4c Make it easier to subclass Launchers
Change constructors from `package private` to `protected` for subclasses
to use.

Closes gh-3741
2015-09-03 14:40:23 -07:00
Phillip Webb 4aa2fed48b Revert "configure JRE that is different from compiler target level"
This reverts commit 678f36cfef.
2015-09-02 23:44:27 -07:00
Martin Lippert 678f36cfef configure JRE that is different from compiler target level 2015-08-19 17:00:38 +01:00
Phillip Webb 891dd5a0f6 Polish 2015-08-03 11:03:48 -07:00
Andy Wilkinson 4660a3ed4d Merge branch '1.2.x' 2015-08-03 15:50:26 +01:00
Andy Wilkinson d241171fff Use fast exceptions in hasMoreElements in LaunchedURLClassLoader
When nested jars are being used, hasMoreElements requires opening a
connection for an entry in every nested jar. If that entry doesn't
exist, a FileNotFoundException is thrown to indicate that a particular
jar doesn't contain the requested entry. This exception is used to
indicate the lack of an entry and is then swallowed, i.e. its stack
trace is of no importance. This means that the performance of
hasMoreElements can be improved by switching on fast exceptions while
it's being called. When fast exceptions are switched on a general
purpose pre-initialized FileNotFoundException is thrown rather than
creating a new FileNotFoundException instance each time.

In certain situations, the use of fast exceptions as described above
can improve performance fairly significantly. The JRE's default SAAJ
implementation uses META-INF/services-based discovery for _every_
request that's handled by Spring Web Services. Each discovery attempt
results in hasMoreElements being called making its performance
critical to throughput.

See gh-3640
2015-08-03 15:39:56 +01:00
Stephane Nicoll 42e230192f Polish 2015-07-24 07:19:53 +02:00
Dave Syer de02eaa26b Add missing jar (.gitignored) 2015-07-14 12:44:23 +01:00
Dave Syer bfa816f2a3 Maintain classpath order in PropertiesLauncher
I think this is safe, judging by the integration tests, but I'm not
putting it in 1.2.x until we've had some feedback on it. The
integration tests actually had a bug that was masking this problem
because they were merging Properties from the whole classpath instead
of picking the first available resource (which is generally what
we do in Spring Boot applications for application.properties for
instance).

Fixes gh-3048
2015-07-14 10:22:36 +01:00
Stephane Nicoll 97634e85ac Remove unnecessary keyword 2015-07-09 14:33:01 +02:00
Spring Buildmaster 7ce391db4f Next development version 2015-07-01 22:48:01 -07:00
Phillip Webb b1f8a692a8 Merge branch '1.2.x' 2015-07-01 19:30:12 -07:00
Phillip Webb a1b87766a7 Fix PropertiesLauncher javadoc
See gh-3392
2015-07-01 18:09:56 -07:00
Phillip Webb 61fc4f3f12 Polish copyright headers 2015-06-23 10:22:14 -07:00
Phillip Webb f65dfe4bcb Fix javadoc errors and warnings 2015-06-19 14:04:55 -07:00
Phillip Webb 7609c43685 Switch Javadoc <code>...</code> to {@code ...}
Update Javadoc to use the {@code ...} syntax when possible.
2015-06-05 10:10:34 -07:00
Eddú Meléndez baca62a6c0 Fix typos 2015-06-05 16:59:51 +02:00
Spring Buildmaster 5d81c87b43 Next Development Version 2015-06-04 00:49:11 -07:00
Phillip Webb 49c4710f63 Merge branch '1.2.x' 2015-06-02 12:32:46 -07:00
Phillip Webb 968b68c322 Polish 2015-06-02 11:17:16 -07:00
Andy Wilkinson 02859cc2d4 Merge branch '1.2.x' 2015-04-15 17:04:05 +01:00
Andy Wilkinson ebb8d0c55f Read the time of a JarEntryData using MSDOS Date Time format
The format is rather unusual.

The time is 16 bits: 5 bits for the hour, 6 bits for the minutes, and 5
bits for the seconds. 5 bits only allows 32 values (0-31) so the number
must be doubled, meaning that the time is only accurate to the nearest
two seconds. Also, the JDK rounds this down by subtracting one. The
doubling and rounding is performed by shifting one place to the left
and masking off the right-most bit respectively.

The date is 16 bits: 7 bits for the year, 4 bits for the month, and 5
bits for the day. The year is from 1980, i.e. the earliest date that
can be represented is 1980-01-01.

See http://mindprod.com/jgloss/zip.html for more details of the format.

Fixes gh-2826
2015-04-15 17:03:06 +01:00
Phillip Webb 8143d1f36d Apply animal sniffer to entire build
Move animal sniffer configuration out of spring-boot-dependencies to
spring-boot-parent and apply it to all projects.

See gh-716
2015-04-06 19:47:22 -07:00
Spring Buildmaster e03c11dda8 Next development version 2015-03-30 22:56:20 -07:00
Andy Wilkinson 3649a89a03 Use maven-dependency-plugin 2.10 in Loader's integration test projects
Closes gh-2430
2015-03-05 14:07:40 +00:00
Phillip Webb a57a88f5cf Move master to 1.3.0.BUILD-SNAPSHOT 2015-02-26 17:01:02 -08:00
Spring Buildmaster 8f0ad02237 Next development version 2015-02-26 15:26:53 -08:00
Phillip Webb 8e398dc6a7 Polish Javadoc
Update Javadoc to add missing @return and @param elements.
2015-02-03 11:35:06 -08:00
Phillip Webb 0696695e16 Add package javadoc 2015-02-02 17:05:38 -08:00
Phillip Webb 3328c1369f Merge branch '1.1.x'
Conflicts:
	spring-boot/src/main/java/org/springframework/boot/logging/LoggingApplicationListener.java
2015-02-01 20:28:11 -08:00
Phillip Webb 555827cad7 Polish 2015-02-01 20:00:11 -08:00
Andy Wilkinson ca69156afd Merge branch '1.1.x' 2015-01-21 13:20:06 +00:00
Andy Wilkinson bbd2486c04 Run invoker plugin with a single thread to avoid build failures
Running the invoker plugin with multiple threads against an empty
Maven cache results in strange build failures where Maven claims that
it cannot find a jar or pom file for an artifact that it should be
able to find. It would appear that Maven is unable to cope with
concurrent writes to its cache.

This commit removes the usage of multiple threads that was introduced
in 4e907f1.

Fixes gh-2389
2015-01-21 13:19:52 +00:00
Dave Syer 1be12ee945 Merge branch '1.1.x' 2015-01-20 17:38:31 +00:00
Dave Syer 4e907f19ce Carefully add nested archives from JAR in PropertiesLauncher
If user runs an executable archive then it and its lib directory will be
on the classpath. Entries from loader.path take precedence in a way that
should make sense to users (earlier wins like in CLASSPATH env var).

Also added new integration tests to verify the behaviour (big improvement
on the old ones, which probably aought to be beefed up to the same
standard).

Fixes gh-2314
2015-01-20 17:37:49 +00:00
Spring Buildmaster 60725cd8bd Next development version 2015-01-07 23:37:07 -08:00
Phillip Webb 1f775793ee Use Collections.addAll(...) instead of for loops
Replace various for loops which add items to collections with calls
to Collections.addAll(...).

Fixes gh-2277
2015-01-04 11:49:06 -08:00
Spring Buildmaster 63e6a25097 Next development version 2014-12-10 18:06:30 -08:00
Spring Buildmaster 1a788c1741 Next development version 2014-12-10 16:35:50 -08:00
Spring Buildmaster 46b7738334 Next development version 2014-11-11 17:12:24 -08:00
Phillip Webb b947d6001d Polish 2014-11-11 09:47:54 -08:00
Andy Wilkinson ade22c87ec Update WarLauncher to remove the root of the war from the classpath
Previously, WarLauncher included its root on the classpath. It also used
a filtered version of its root archive to hide both the WEB-INF and
META-INF directories. This meant that files in WEB-INF and META-INF
could be found by the classloader (as they were on the classpath) but
could not be read as the filtered archive was hiding them.

This commit updates WarLauncher to remove the root of the war file from
the classpath. It also removes the filtering of the archive, thereby
allowing files in META-INF and WEB-INF to be accessed via the
ServletContext.

Closes gh-1792
2014-11-11 14:42:19 +00:00
Andy Wilkinson b99ffcc170 Merge branch '1.1.x' 2014-11-10 15:43:07 +00:00
Michael Cramer f62664534d Update maven-dependency-plugin to version 2.9
Closes gh-1862
2014-11-10 15:40:42 +00:00
Phillip Webb 2e7aa4685b Polish 2014-10-21 20:34:00 -07:00
Andy Wilkinson 886bbc3b41 Merge branch '1.1.x' 2014-10-15 16:36:11 +01:00
Andy Wilkinson 9a2d654eba Rename test classes so that their tests are run by Maven 2014-10-15 16:35:48 +01:00
Andy Wilkinson 7211571969 Fix some grammar issues in docs
Closes gh-1695
2014-10-13 13:18:24 +01:00
Eric Dahl 16937746a0 Fix some grammar issues in docs 2014-10-13 12:22:14 +01:00
Spring Buildmaster 3e71a21b30 Next development version 2014-10-10 15:19:47 -07:00
Phillip Webb 509c3aef4e Merge branch '1.1.x' 2014-10-09 19:23:57 -07:00
Phillip Webb 6028d92a4e Support Windows UNC paths with fat jars
Update `Launcher` and `JarFile` to correctly deal with Windows UNC
paths.

Fixes gh-1641
2014-10-09 19:06:28 -07:00
Andy Wilkinson 316e5f78f9 Merge branch '1.1.x' 2014-10-01 10:12:19 +01:00
Andy Wilkinson f7d1f968b9 Improve error message when JarFile encounters a compressed nested jar
Closes gh-1643
2014-10-01 10:09:30 +01:00
Spring Buildmaster edb4b7ed7d Next development version 2014-09-25 21:02:37 -07:00
Spring Buildmaster d63e4b4329 Next development version 2014-09-04 12:15:18 -07:00
Dave Syer 399238384f Merge branch '1.1.x' 2014-08-19 14:16:44 +01:00
Dave Syer 8e84151f8f Normalize search path in PropertiesLauncher
* Windows: allow absolute file paths without file:/// prefix
* All: only add nested archives (not directories), so loader.path=lib/*
behaves the same as -classpath=lib/* (except for adding zip files)

Fixes gh-1352
2014-08-19 14:16:10 +01:00
Dave Syer ccfc47091c Fix URL filtering when loading from a directory
The ExplodedArchive would erroneously always attempt to filter
its contents (and thereby shield them from a classloader that wrapped
it) even if they haven't been explicitly provided.

See gh-1352
2014-08-19 14:16:10 +01:00
Phillip Webb 54625cc2a0 Make LaunchedURLClassLoader lock provider static
Fixes gh-1380
2014-08-18 20:08:03 -07:00
Spring Buildmaster 74d0c5185a Next development version 2014-08-07 11:59:17 -07:00
Phillip Webb 4f440fcbb9 Java 7 ClassLoader performance improvements
Use Java 7 `registerAsParallelCapable` and `getClassLoadingLock` methods
when possible. This should improve performance when running on JDK 7+
whilst still remaining JDK 6 compatible.

Closes gh-1284
2014-07-29 14:12:52 -07:00
Stephane Nicoll 249e09d9bc Switch master to 1.2.0.BUILD-SNAPSHOT 2014-07-11 10:44:05 +02:00
Spring Buildmaster 40327e1ae6 Next development version 2014-07-08 02:33:36 -07:00
Phillip Webb fa88c481a5 Remote trailing whitespace 2014-07-02 15:17:14 -07:00
Spring Buildmaster 981669b7c0 Next development version 2014-06-26 14:09:54 -07:00
Phillip Webb 35b26b52f2 Add caching to JarFile.getUrl()
Fixes gh-1178
2014-06-26 11:23:35 -07:00
Phillip Webb 200cd535c2 Revert "Next development version"
This reverts commit 67189477fe.
2014-06-26 11:03:09 -07:00
Spring Buildmaster 67189477fe Next development version 2014-06-26 10:51:35 -07:00
Phillip Webb 9632abf825 Formatting and cleanup 2014-06-26 09:41:15 -07:00
Phillip Webb 7e7733d45d Deal with spaces in file references
Fixes gh-1169
2014-06-25 15:43:07 -07:00
Phillip Webb 7654259f80 Fix JarFile issues when running on Windows
Fix 'fat jar' support for windows to correctly deal with URL and path
slash issues. The root cause of the original problem was caused by JAR
URLs not including a root slash (ie `file:C:/Users` vs `file:/C:/Users`)

Fixes gh-1145
2014-06-25 14:32:31 -07:00
Spring Buildmaster 542f3cbda8 Next development version 2014-06-24 13:53:56 -07:00