1304 Commits

Author SHA1 Message Date
Dave Syer
4b2cea7267 Add simple DB aware HealthIndicator 2013-10-23 08:33:47 -04:00
Andy Wilkinson
00a0cab781 Remove remaining git.properties files 2013-10-22 17:26:44 +01:00
Andy Wilkinson
e5e511fd43 Reinstate use of hasMappingForPattern
Use of hasMappingForPattern was commented out during work on the
Aether-based Grape implementation as it was temporarily removed in 
Spring 4's snapshots. It's since been reinstated in the snapshots, so
its use should have been reinstated prior to merging Aether work into
master.
2013-10-22 17:20:37 +01:00
Andy Wilkinson
da748656ba Merge branch 'aether-grab' 2013-10-22 17:13:36 +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
39e8e46e2a Provide an Aether-based Grape Engine
Previously, @Grab annotations would use Ivy to download the
dependencies with some of Ivy's known limitations being worked around
by GrapeEngineCustomizer.

This commit adds a GrapeEngine implementation that uses Aether,
the dependency resolution 'engine' used by Maven and Grails. To ensure
consistent behaviour with a Maven build, the Aether-powered dependency
resolution uses the dependency management configuration from the
spring-boot-starter-parent pom file.
2013-10-22 16:06:53 +01:00
Andy Wilkinson
a28947f276 Move database files into target directory 2013-10-22 15:58:56 +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
c2c01ce645 Update brew install instructions to use tap
Issue: gh-86
2013-10-18 09:55:52 -07: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
43f8a71af4 Ensure JdbcTemplate and DB initializer still work when user supplies DataSource 2013-10-16 13:43:59 -04:00
Dave Syer
f43cf1db61 Stop log4j from moaning on startup 2013-10-16 13:42:51 -04: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
837070d6e9 Tidy up log message (add space) 2013-10-15 16:51:58 -04:00
Dave Syer
acf458b462 Standardize on spring.datasource.* for database config
[Fixes #58921238] [bs-333] spring.database.* and
spring.datasource.* used to configure database
2013-10-15 16:39:59 -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
b7ed5bbc76 Revert "Temporary fix for Spring snapshot changes"
This reverts commit 8a804f61852100f82aa044c21f0ce6cf2d24bf8c.
2013-10-15 10:16:29 -04:00
Dave Syer
d4d9ebcabd Small re-org of PropertiesLauncher 2013-10-15 09:56:52 -04:00
Dave Syer
8a804f6185 Temporary fix for Spring snapshot changes 2013-10-15 09:56:19 -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
Dave Syer
17e24fd17d Add extra test for placeholder behaviour 2013-10-14 11:16:00 -04:00
Dave Syer
efb66dcdb2 Correct typo (fixes gh-87) 2013-10-11 08:23:26 -04:00
Dave Syer
cd5bc83533 Fix build some more after changes for gh-84 2013-10-10 16:47:11 -04:00
Dave Syer
a48990f2d4 Add spring-boot-starter-test
[Fixes #56467326] [bs-314]
2013-10-10 15:47:02 -04:00
Dave Syer
228787e66d Fix build after changes for gh-84 2013-10-10 14:48:37 -04:00
Dave Syer
26f3379d1a Add mongodb to travis CI 2013-10-10 13:43:13 -04:00
Dave Syer
d60ba48de0 Fix bug in RelaxedPropertyResolver with prefix ending in separator
E.g. with a prefix spring.jpa.hibernate. we want naming-strategy and
namingstrategy to be resolvable. It wasn't working before this change
because the whole property path was being manipulated, where you
actually need to manipulate the prefix and suffix separately.
2013-10-10 13:15:21 -04:00
Dave Syer
68da5b41c6 Allow relaxed names to include prefixes 2013-10-10 13:15:21 -04:00
Dave Syer
a7d12bfddb Add FileEncodingApplicationContextInitializer
Looks for spring.mandatory_file_encoding and matches it against
System.getProperty("file.encoding").

Fixes gh-46
2013-10-10 13:15:21 -04:00
Dave Syer
b8bdf22209 Don't repeat relaxed names that already showed up 2013-10-10 13:15:21 -04:00
Andy Wilkinson
97f93bfa64 Support simple @Grab annotations everywhere
Previously, simple @Grab annotations only worked on classes. This commit
updates the simple @Grab support so that they can be used on anything
that can be annotated with @Grab.

The simplified @Grab support relies upon springcli.properties having
been generated. This commit adds an M2E lifecycle mapping for the
antrun plugin so that springcli.properties is generated as part of an
Eclipse build, thereby making it easier to run tests in Eclipse that
rely upon the simplified @Grab support.
2013-10-10 16:57:13 +01:00
Dave Syer
0ec2d19e38 Add spring.thymeleaf.encoding to ThymeleafAutoConfiguration
Both the template resolver and the view resolver now have their
encoding set explicitly (defaulting to UTF-8).

Fixes gh-79
2013-10-10 09:58:09 -04:00
Dave Syer
2c60828cf2 Ensure ServerProperties default values does not override
Since ServerProperties had primitive properties for port (in
particular) it was not possible to check when applying those
properties if the user had actually changed the value. This
in turn meant that a custom EmbeddedServletContainerFactory
could not set the default values.

Fixed by making int properties of ServerProperties into
Integer and checking for null before setting on the
container factory.

Fixes gh-84
2013-10-10 09:46:14 -04:00
Andy Wilkinson
b855ab6cae Treat Maven artifacts with bundle packaging as jars
Previously, LocalM2Resource used the pom's packaging configuration to
determine the suffix of the file that it should look for, e.g. if
the pom's packaging was jar, it would look for a file with a .jar
suffix in artifactExists(). This logic fails for artifacts with bundle
packaging as it would look for a .bundle file rather than a .jar file,
fail to find the file, and incorrectly report that the artifact does not
exist.

This commit updates LocalM2Resource to look for a file with a .jar
suffix when the packaging configuration in the pom is bundle.
2013-10-10 14:42:28 +01: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
Dave Syer
64d9f4f18d Allow user to override static resource handler mappings
A new API in Spring allows us to check for existing mappings in the
resource handler registry
2013-10-09 13:13:39 -04:00
Dave Syer
9df0c9eb4a Fix paragraphs that ran together 2013-10-09 13:01:21 -04:00
Dave Syer
6bfc888a58 Remove missing links 2013-10-09 12:43:15 -04:00
Phillip Webb
33a597b661 Update homebrew location 2013-10-09 09:41:08 -07:00
Dave Syer
bcfc134702 Add explicit header link 2013-10-09 11:59:33 -04:00
Dave Syer
3adfdd34ec Use simplified @Grab where possible 2013-10-09 10:16:01 -04:00
Dave Syer
1dd0cca294 Update M4->M5 in README 2013-10-09 09:04:39 -04: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
Phillip Webb
1a9ce42da9 Apply source formatting to samples 2013-10-08 20:25:10 -07:00