Commit Graph

576 Commits (500a3df6e941e43a98850617bae23de29179216b)

Author SHA1 Message Date
Dave Syer e97b703a20 Additionally make package method public 8 years ago
Dave Syer f62abade90 Make DependencyResolutionContext empty by default
It's more useful as a building block for other tools that way,
and it's easy to add the spring boot dependencies using public
methods.
8 years ago
Phillip Webb d818a09ed8 Polish 8 years ago
Stephane Nicoll 2d75cc79c0 Polish contribution
Closes gh-6367
8 years ago
Henri Kerola d07f689446 "spring war" should copy resources to WEB-INF/classes
Closes gh-6351
8 years ago
Andy Wilkinson cd45ce9104 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson 1bb5dc205d Update samples to use Artemis in place of HornetQ
Closes gh-7057
8 years ago
Andy Wilkinson 6fb44b2410 Fix TestCommandIntegrationTests after removal of deprecated test support
See gh-6971
See gh-6973
8 years ago
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 8 years ago
Spring Buildmaster 7e9ed5e1a7 Next Development Version 8 years ago
Andy Wilkinson 472117299e Add some integration tests for the CLI’s quiet mode
See gh-6918
8 years ago
Phillip Webb 7299976d12 Fix banner property used in "quiet" mode
Fixes gh-6918
8 years ago
Dave Syer b5294a48b2 Use context class loader instead of one-off for command location
This works, and feels like the right thing to do, since there is no
guarantee that extensions won't in turn use ServiceLoader for things
that we haven't yet anticipated.

Fixes gh-6829. Cc @wilkinsona in case he has an opinion.
8 years ago
Johnny Lim 4b9f6869f0 Polish
Closes gh-6817
8 years ago
Andy Wilkinson 270530c4fd Fix class loading problems when CLI extensions are installed
Previously, CLI extensions where installed into the CLI's lib
directory which meant that they were on the class path of the app
class loader. Following the change to an executable jar's packaging,
this meant that they could not see classes in the CLI and a
ClassNotFoundException would result.

This commit updates the CLI to install extensions into lib/ext and
load commands using a new ClassLoader that has all of the jars in
lib/ext on its class path and that uses the launch class loader as
its parent.

Closes gh-6615
8 years ago
nagarajasr 0996615ac3 Apply sytem properties on HttpClient
Closes gh-6600
8 years ago
Stephane Nicoll 81094e4b23 Merge branch '1.3.x' 8 years ago
Stephane Nicoll f186008d1f Fix Groovy version in INSTALL.txt
This commit uses maven filtering to set the Groovy version rather than an
hard-coded value that can be easily outdated.

Closes gh-6530
8 years ago
Spring Buildmaster 334baaeffd Next development version 8 years ago
Spring Buildmaster a89ef5df6e Next Development Version 8 years ago
Spring Buildmaster 2216369348 Next Development Version 8 years ago
Andy Wilkinson c24c5aeb3b Upgrade to Maven Assembly Plugin 2.6
Closes gh-6291
9 years ago
Andy Wilkinson 92bb24e365 Avoid synchronizing on this and use an internal monitor instead
Where possible, code that previously synchronized on this (or on the
class in the case of static methods) has been updated to use an
internal monitor object instead. This allows the locking model that's
employed to be an implementation detail rather than part of the
class's API.

Classes that override a synchronized method continue to declare
the overriding method as synchronized. This ensures that locking
is consistent across the superclass and its subclass.

Closes gh-6262
9 years ago
Phillip Webb 99c6194e17 Don't use MockitoJUnitRunner
Replace `@RunWith(MockitoJUnitRunner.class)` with direct Mockito
initialization since the running doesn't support parallel test
execution.
9 years ago
Vedran Pavic a1ac934bee Ignore special variable related JVM output in CommandLineInvoker
Closes gh-5883
9 years ago
Spring Buildmaster 819a9574a6 Next Development Version 9 years ago
Andy Wilkinson 38ad420810 Merge branch '1.3.x' 9 years ago
Andy Wilkinson d77d3ff236 Use a SHA256 checksum in the Homebrew formula
Closes gh-5885
9 years ago
Spring Buildmaster 376bbe68d8 Next Development Version 9 years ago
Phillip Webb 609cb52cd4 Move to relocated web classes
Refactor code to move from recently deprecated classes.

Closes gh-5822
9 years ago
Stephane Nicoll 93c495f69a Remove pid file
This shouldn't have been committed.
9 years ago
Phillip Webb 2679a6f0c6 Polish 9 years ago
Johnny Lim b914b4aa52 Remove the second parameter of substring() if possible
Closes gh-5720
9 years ago
Jakub Narloch 64989ae192 Replacing StringBuffer with lock-free StringBuilder
Closes gh-5727
9 years ago
Andy Wilkinson 0c78b2fd3d Handle fully-qualified Windows paths correctly in the CLI
Previously, the CLI would always use the class loader to try to locate
a source file. This was contrary to the SourceOptions javadoc which
states that the class loader is “used to try and load files that are
not found in the local filesystem”. This provide to be problematic on
Windows when a fully-qualified source file was supplied. The driver
letter colon slash (e.g. c:/) at the start of the path is considered
invalid for a class path resource by URLClassPath.Loader resulting in an
IllegalArgumentException being thrown.

A workaround for this URLClassPath behaviour was added in a71c9b5d. It
was removed as part of reworking LaunchedURLClassLoader to use a
conventional delegation model in 87fe0b2a. It was then reinstated in
cc140b2c. This work around is undesirable as it causes
LaunchedURLClassLoader’s behaviour to diverge from URLClassLoader’s
behaviour (this is contrary to the comments in the test added in
a71c9b5d which incorrectly tests the two class loader with different
class paths. If the two class loaders are created with the same class
path then their behaviour is the same).

This commit updates SourceOptions to make its behaviour match its
javadoc so that a search of the class path is only performed if the
filename doesn’t exist on the filesystem. Furthermore, when running on
Windows, if the filename is an absolute path no further searching is
performed as the path cannot reliably be used to search the class path
due to the behaviour of URLClassPath.Loader when given a path that
is an absolute file path on Windows. This ensures that the user is
presented with an error message indicating that the file could not be
found.

Closes gh-5650
9 years ago
Phillip Webb 6d23ce2ada Polish 9 years ago
Phillip Webb 893a6c32f3 Upgrade to checkstyle 6.17
Fixes gh-5547
9 years ago
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
9 years ago
Phillip Webb 2f815a907a Migrate existing tests from deprecated package
Update the existing tests to use the relocated `spring-boot-test`
classes. Restructuring was achieved using the following command:

find . -type f -name '*.java' -exec sed -i '' \
-e s/org.springframework.boot.test.ConfigFileApplicationContextInitializer/\
org.springframework.boot.test.context.ConfigFileApplicationContextInitializer/g \
-e s/org.springframework.boot.test.EnvironmentTestUtils/\
org.springframework.boot.test.util.EnvironmentTestUtils/g \
-e s/org.springframework.boot.test.IntegrationTest/\
org.springframework.boot.test.context.IntegrationTest/g \
-e s/org.springframework.boot.test.IntegrationTestPropertiesListener/\
org.springframework.boot.test.context.IntegrationTestPropertiesListener/g \
-e s/org.springframework.boot.test.OutputCapture/\
org.springframework.boot.test.rule.OutputCapture/g \
-e s/org.springframework.boot.test.SpringApplicationConfiguration/\
org.springframework.boot.test.context.SpringApplicationConfiguration/g \
-e s/org.springframework.boot.test.SpringApplicationContextLoader/\
org.springframework.boot.test.context.SpringApplicationContextLoader/g \
-e s/org.springframework.boot.test.SpringBootMockServletContext/\
org.springframework.boot.test.mock.web.SpringBootMockServletContext/g \
-e s/org.springframework.boot.test.TestRestTemplate/\
org.springframework.boot.test.web.client.TestRestTemplate/g \
-e s/org.springframework.boot.test.WebIntegrationTest/\
org.springframework.boot.test.context.web.WebIntegrationTest/g {} \;

See gh-5293
9 years ago
Phillip Webb 644ae2c21a Merge branch '1.3.x' 9 years ago
Phillip Webb 5e722dae6a Polish 9 years ago
Dave Syer 120a39a689 Merge branch '1.3.x' 9 years ago
Dave Syer baf7dda05a Accumulate state in a local variable, not a field in the instance
State is accumulating unnecessarily in AST tranformation instances.
We can fix the ones we have implemented so far just by using a
local variable and passing it into the methods where it is used.
All the methods are private so this change is safe in a point release.

Fixes gh-5283
9 years ago
Dave Syer 0dd3531f77 Fix apostrophe 9 years ago
Spring Buildmaster 225d877ab9 Next Development Version 9 years ago
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 9 years ago
Phillip Webb 89b7704977 Extract spring-boot-test.jar
Relocate the `org.springframework.boot.test` package from the
`spring-boot.jar` to `spring-boot-test.jar`.

Fixes gh-5184
9 years ago
Andy Wilkinson 87fe0b2ade Use a conventional delegation model in LaunchedURLClassLoader
When an application is run as an executable archive with nested jars,
the application's own classes need to be able to load classes from
within the nested jars. This means that the application's classes need
to be loaded by the same class loader as is used for the nested jars.
When an application is launched with java -jar the contents of the
jar are on the class path of the app class loader, which is the
parent of the LaunchedURLClassLoader that is used to load classes
from within the nested jars. If the root of the jar includes the
application's classes, they would be loaded by the app class loader
and, therefore, would not be able to load classes from within the
nested jars.

Previously, this problem was resolved by LaunchedURLClassLoader being
created with a copy of all of the app class laoder's URLs and by
using an unconventional delegation model that caused it to skip its
parent (the app class loader) and jump straight to its root class
loader. This ensured that the LaunchedURLClassLoader would load both
the application's own classes and those from within any nested jars.
Unfortunately, this unusual delegation model has proved to be
problematic. We have seen and worked around some problems with Java
Agents (see gh-4911 and gh-863), but there are others (see gh-4868)
that cannot be made to work with the current delegation model.

This commit reworks LaunchedURLClassLoader to use a conventional
delegate model with the app class loader as its parent. With this
change in place, the application's own classes need to be hidden
from the app class loader via some other means. This is now achieved
by packaging application classes in BOOT-INF/classes (and, for
symmetry, nested jars are now packaged in BOOT-INF/lib). Both the
JarLauncher and the PropertiesLauncher (which supports the executable
jar layout) have been updated to look for classes and nested jars in
these new locations.

Closes gh-4897
Fixes gh-4868
9 years ago
Phillip Webb 962a598531 Use AssertJ in spring-boot-cli
See gh-5083
9 years ago
Phillip Webb f276ff4bd0 Polish 9 years ago