Commit Graph

1581 Commits (447b2be91d56f66031532d8b8785f8e83064a476)
 

Author SHA1 Message Date
Dave Syer d5de29b76c Add test case for profile ordering
The command line profile (or equivalently System property) is
not winning right now. Arguably that should be fixed. (Thinking...)

Relevant to gh-342
11 years ago
Andy Wilkinson 05fd50d190 Dependency version upgrades
- spring-integration-core 3.0.1.RELEASE (closes #360)
 - Logback 1.1.1 (closes #361)
 - maven-settings-builder 3.1.1 (closes #359)
 - maven-aether-provider 3.1.1 (closes #356)
 - jopt-simple 4.6 (closes #357)
 - SLF4J 1.7.6 (closes #318)
11 years ago
Dave Syer 842e037b72 Add some tests for profile behaviour
Ordering: profiles are applied in order (from the active profiles
list in the Environment), with the last one winning as far as
property values goes. This *does* mean that a profile activated
inside application.yml is applied last and hence takes precedence.
It's debatable whether that is the right semantics, but that's
what it is for now.

Re gh-342: a profile added via SpringApplication also takes
precedence over one added on the command line. Also debatable
but at least it's predictable.

Naming: a profile adds "#<profile>" to the end of a property source
name (no more, no less)
11 years ago
Christian Dupuis 703d7d3fd9 Prevent EmptyStackException in case no stack of prompts is empty 11 years ago
Dave Syer fc4aabde75 Add some test cases and comments
In response to gh-352
11 years ago
Phillip Webb e4376bc4a6 Update READMEs to 1.0.0.RC3 11 years ago
Phillip Webb 169eeb95ad Fixup next iteration commit 11 years ago
Spring Buildmaster 1367d57e8c Next development version 11 years ago
Spring Buildmaster eaff1677a7 Release version 1.0.0.RC3 11 years ago
Phillip Webb dfe6de8c1f Fallback to JVM URL handler on exception
Update the executable JAR `Handler` to fallback to the JVM handler if
the jar cannot be opened. This prevents exceptions when trying to
open URLs in the form "jar:jndi:/localhost...".

Fixes gh-347
11 years ago
Phillip Webb 97c258a2b4 Fix properties binding to SpringApplication
Fix ConfigFileApplicationListener to correctly bind
`application.properties` to SpringApplication. Binding in RC2 failed
due to the fact that `ConfigurationPropertySources` did not extend
`EnumerablePropertySource`.

Fixes gh-346
11 years ago
Phillip Webb eaa05c6b6d Update READMEs to 1.0.0.RC2 11 years ago
Phillip Webb ef9048e86e Rename EnvironmentDelegate -> Delegating
Rename EnvironmentDelegateApplicationContextInitializer to
DelegatingApplicationListener and EnvironmentDelegateApplicationListener
to DelegatingApplicationListener.
11 years ago
Phillip Webb d5c0ef6ca3 Add ConfigFileApplicationContextInitializer
Reintroduce ConfigFileApplicationContextInitializer for tests that
wish to reuse 'application.properties' configuration.

Fixes gh-344
11 years ago
Phillip Webb 4a58171b5c A few more package tweaks
Improve package structure and include package-info javadoc.
11 years ago
Phillip Webb 69e7fb4c98 Polish 11 years ago
Phillip Webb a61a45092d Revert "Add generator app for simple table of *AutoConfiguration"
This reverts commit 89283e46b8.

Revert until we can find a new home, outside of the usual build
process.
11 years ago
Phillip Webb c370923596 Load profile files that include 'spring.profiles'
Fix ConfigFileApplicationListener to load profile specific files
(*-profile.ext) both as a root document, and again with the profile
active.

This allows profile specific files to still include a 'spring.profiles'
property if they wish.

Issue: gh-340
11 years ago
Dave Syer 89283e46b8 Add generator app for simple table of *AutoConfiguration
Run with "mvn spring-boot:run" and then scrape the Markdown from stdout.
(Result already added to docs/autoconfig.md.)
11 years ago
Dave Syer 52ba2f40dc Generate a list of autoconfig for docs 11 years ago
Oliver Gierke 929bd902be Upgraded to Spring Data Codd
Update AbstractRepositoryConfigurationSourceSupport to use the newly
introduced RepositoryConfigurationDelegate instead of effectively
reimplementing Spring Data Commons functionality which was prone to
changes in the API (code that wasn't considered to be API in the first
place).

Switch from implementing BeanClassLoaderAware to ResourceLoaderAware
to avoid having to set up a DefaultResourceLoader which should also
improve IDE integration.

Fixes gh-236
11 years ago
Dave Syer be73535611 Defensive catch block in LogbackLoggingSystem
Older versions of JBoss AS have a classpath clash with an older
SLF4J (pre 1.6.5), so to prevent an app from blowing up on
startup we defensively catch a NoSuchMethodError.

Fixes gh-339
11 years ago
Phillip Webb f0bfecd375 Refactor PropertySource support
Locate PropertySourcesLoaders using SpringFactoriesLoader and refactor
the interface to expose file extensions and support 'profiles' within
documents.

Rework ConfigFileApplicationListener for consistent profile loading.
Profiles are now loaded in a consistent order for both profile specific
files, and contained profile documents (i.e. YAML sub-sections).

Also update ConfigFileApplicationListener so that it no longer directly
processes @ProperySource annotations. Instead the standard Spring
ConfigurationClassPostProcessor will insert @PropertySource items with
ConfigFileApplicationListener later re-ordering them.

The SpringApplication can no longer be configured using @ProperySource
annotations, however, application.properties may still be used.

Fixes gh-322
11 years ago
Phillip Webb 06494e068f Consistent property source ordering with names
Update ConfigFileApplicationListener so that custom names and custom
locations use consistent ordering. i.e. earlier items take precedence
(same as @ProperySource).
11 years ago
Phillip Webb 52c4205945 Polish ConfigFileApplicationListenerTests
Add "my.property" to `application.properties` in order to test ordering
or property sources.

Also use hamcrest for assertions.
11 years ago
Phillip Webb 9ab886f4db Consistent javadoc "code" block formatting
Update javadoc to consistently use the "code" style with <pre> blocks.
Also include the latest spring-javadoc.css formatting file.

Fixes gh-332
11 years ago
Phillip Webb b21f56a292 Don't register shutdown hook from embedded context
Change `EmbeddedWebApplicationContext` to no longer automatically call
`registerShutdownHook()`. Shutdown hooks must now be registered by the
caller (for users of SpringApplication this will happen automatically).

Fixes gh-314
11 years ago
Phillip Webb 5863795e10 Polish 11 years ago
Dave Syer 2f138d84dd Merge pull request #336 from jkubrynski/master
* pull336:
  Now custom SpringApplication class can be used when extending SpringApplicationContextLoader
11 years ago
Jakub Kubrynski 6f2e133a0a Now custom SpringApplication class can be used when extending SpringApplicationContextLoader 11 years ago
Dave Syer 76c56c6aa9 Add placeholder resolution to @PropertySource processing
Previously the core Spring processing of @PropertySource would
resolve placeholders in the location attribute, but the pre-loading
of the property source by Spring Boot didn't do that. Now implemented
using Environment.resolvePlaceholders() (N.B. at a time when the only
Environment entries available are system properties and OS env vars).

E.g.

	@Configuration
	@PropertySource("classpath:/${source.location}.properties")
	protected static class WithPropertySourcePlaceholders {
           ...
	}
11 years ago
Andy Wilkinson ca7201b4b2 Fix binding of overlapping nested maps
When binding a nested map structure, RelaxedDataBinder pre-populates
the target object with default empty maps. Previously, when these
structures overlapped, each step in pre-population process could
potentially overwrite what had come before it. This led to the output
of the pre-population process being incomplete which would lead to a
binding failure.

This commit updates the pre-population process so that it checks to see
if a property's value has already been set by an earlier step in the
process. If it has been set, the existing value is now reused rather
than being overwritten by a new empty map.

Fixes #328
11 years ago
Dave Syer 8de9890757 Add scope=test to hsqldb (fixes #330) 11 years ago
Andy Wilkinson 4f677bec08 Filter non-jar artifacts when packaging libs in Gradle plugin
Previously, the Gradle plugin would package all of a project's
dependencies in the jar's lib directory, irrespective of each
dependency's type. This led to non-jar artifacts being packaged in
the lib directory where only jar dependencies are expected. See #334
for an example failure.

This commit updates the Gradle plugin such that it only packages
dependencies of type jar, ejb, ejb-client, test-jar, or bundle. This
brings the Gradle plugin into line with the Maven plugin.

Fixes #334.
11 years ago
Phillip Webb af93ae2dac Ignore failing JMS tests for now
Ignore JMS sample which intermittently fails to run on CI.

See gh-323
11 years ago
Phillip Webb 5e7d6e608d Update copyright header 11 years ago
Phillip Webb d4f5cf4496 Filter non 'jar' types from nested libs
Update the `ArtifactsLibraries` used by the maven plugin to filter
based on artifact types. This prevent `.pom` files from accidentally
being packaged in `/libs` and ultimately resulting in 'Unable to find
ZIP central directory records' errors.

Fixes gh-324
11 years ago
Phillip Webb 2d8f66e3c5 Add more JMS sample log output 11 years ago
Phillip Webb dd66f119d3 Revert Automatically detect 'development' profile
Revert commit a97bcfe3cd as adding
profiles automatically may be problematic.

Updates gh-296
11 years ago
Christian Dupuis af75dd0e40 Move remaining properties for consistency 11 years ago
Phillip Webb c09ca17ca2 Update gradle example builds 11 years ago
Phillip Webb d137bcd80d Polish gradle repackage task formatting 11 years ago
Phillip Webb f8ab5a1f67 Merge pull request #302 from jvalkeal/gradle-mainclass
* gradle-mainclass:
  Add mainClass option for Repackage task
11 years ago
Janne Valkealahti 32453b27d3 Add mainClass option for Repackage task
Add `mainClass` property option to the Repackage task. If the property
is defined within a task, it works in the same way as if it defined
within the springBoot{} 'ext' properties section.

Option is valid only for that specific task where it is defined, and
will override option defined in springBoot{} ext properties.

Fixes gh-283
11 years ago
Phillip Webb ed9735361e Apply source cleanup and formatting 11 years ago
Phillip Webb 80f2336f17 Polish 11 years ago
Phillip Webb 65b6cf8bcb Merge pull request #304 from adambro/patch-1
* patch-1:
  Prevent 404s in README.md links
11 years ago
Adam Brodziak f67b165f5a Prevent 404s in README.md links
Fix links to ensure that they don't cause 404 errors when published to
Github Pages.

Fixes gh-304
11 years ago
Phillip Webb 3749b1a3b7 Merge pull request #313 from madorb/master
* pull313:
  Document that applicaiton.yml requires snakeyaml
11 years ago
Ben c251e33bf8 Document that applicaiton.yml requires snakeyaml
Update documentation to reference the need for a yaml library to be on
the classpath.

Fixes gh-313
11 years ago