Commit Graph

1174 Commits

Author SHA1 Message Date
Christian Dupuis b8b948d366 Migrate JolokiaAutoConfiguration to use ConfigurationProperties instead of accessing the environment directly to obtain configuration properties 2014-01-09 17:52:55 +01:00
Dave Syer 51f9189923 Prevent 404 in gh-pages 2014-01-09 14:30:06 +00:00
Dave Syer 889a97a6b2 Default spring.config.location to file: if no prefix supplied
Fixes gh-198
2014-01-09 12:22:50 +00:00
Dave Syer aebaa580db Add test for user overriding @EnableJpaRepositories 2014-01-09 11:14:18 +00:00
Dave Syer c8152bfc70 SpringBootTestUtils->EnvironmentTestUtils 2014-01-09 10:56:33 +00:00
Dave Syer 478e655758 Change algorithm for determining active profile from external config
Instead of adding active prpfiles for every one we encounter, we need to
build up a complete "default" Environment and then ask it what the active
profiles are. Implemented in ConfigFileApplicationListener.

Fixes gh-198
2014-01-08 18:03:37 +00:00
Dave Syer 7d846c835a Allow user to disable all JMX exports with spring.jmx.enabled 2014-01-08 14:27:34 +00:00
Dave Syer 561cb3a50f TestUtils -> SpringBootTestUtils 2014-01-08 13:58:21 +00:00
Andy Wilkinson 73b9899708 Use a single <manifestEntries> element
Previously, there were two <manifestEntries> elements in the CLI's
pom.xml. With certain versions of Maven, this appeared to cause the
first element to be ignored in favour of the second. The problem did
not occur when built locally with Maven 3.1.1, but did occur when built
by Bamboo which, I believe, uses 3.0.x

This commit combines the two <manifestEntries> into one.
2014-01-08 13:14:54 +00:00
Andy Wilkinson 9a5be9f4cd Revert "Test that auto configurations can be added by init scripts"
The test passes locally, both in Eclipse and on the command line, but
fails on the CI server. Revert the addition of the test while I
hopefully figure out why.

This reverts commit 2e81b1d0d0.
2014-01-08 11:43:59 +00:00
Andy Wilkinson a010de955d Reinstate ./repository as a "remote" repository
The grab command downloads the dependencies of one or more Groovy
scripts to ./repository. This commit ensures that those previously
downloaded dependencies can be used by a subsequent invocation of the
run command.

The location and behaviour of the local cache is unaffected by this
change. If the dependencies in ./repository do not exist in the local
cache, Aether will "download" them from ./repository and store them in
the local cache.

Fixes #191
2014-01-08 11:34:17 +00:00
Andy Wilkinson a58e4cbb1f Add support for configuring Aether via settings.xml
Previously, Aether's configuration was largely hard-coded making it
impossible to configure a mirror, provide credentials for accessing
a repository, etc.

This commit adds support for configuring Aether via Maven's
settings.xml file. The support is optional and must be enabled by
grabbing spring-boot-maven-settings in an init script. The Aether
instance that's used when running the application will then be
configured using settings.xml. The settings file is expected to be
found in ${user.home}/.m2/settings.xml.

The configuration of the following items is currently supported:

 - Offline
 - Proxies
 - Mirrors
 - Server authentication
 - Local repository location

If the support is not enabled, settings.xml does not exist, or
settings.xml does not configure certain things then sensible defaults
are applied.
2014-01-08 11:21:56 +00:00
Andy Wilkinson 2e81b1d0d0 Test that auto configurations can be added by init scripts
When an init command is run, it may add entries to the classpath. This
commit adds a test that verifies that, if an entry that is added to
the classpath contains a CompilerAutoConfiguration file in
META-INF/services, then the CompilerAutoConfigurations declared in it
are found by subsequent ServiceLoader.load calls.
2014-01-08 11:21:56 +00:00
Dave Syer 321ce3aad2 TestUtils -> SpringBootTestUtils 2014-01-08 10:46:42 +00:00
Dave Syer 147968cf83 Set isolation to DEFAULT for JPA transaction manager
Also logs a warning about the fact that locks may not be taken when
starting a Job. JPA and Batch don't really work that well together
in general so it's probably not worth a lot of effort to work aoround
this. If anyone needs to they should create a custom JpaDialect
(and a BatchConfigurer).

Fixes gh-197
2014-01-08 09:58:23 +00:00
Dave Syer 2066c04a3e Make Map<String,String> a special case in RelaxedDataBinder
Fixes gh-195
2014-01-08 09:37:51 +00:00
Dave Syer 7b58718453 Add missing YAML file for test 2014-01-08 07:30:58 +00:00
Dave Syer 4e1245d9ee Restore changes from 0332501 (fix class loader test failure) 2014-01-08 07:30:09 +00:00
Dave Syer e00db0de24 Ignore other failing test as short term measure 2014-01-08 07:25:36 +00:00
Dave Syer bf69da3983 Ignore failing test as short term measure 2014-01-07 19:48:56 +00:00
Janne Valkealahti 780397bd6b Fix for wildcard recursive classpath handling
Previous fix for handling wildcard entries in a classpath
imposed a new problem in a case where entry is a directory
with a jar files but also contains a lot of nested directories.

For example entry "./*" resulted for scanning whole disk starting
from "/". In case of default hadoop classpath, it scanned everything
under hadoop's installation. On some cases this deep scan was hidden
and was revealed by NPE's for file access exceptions.

When we want to support wildcard entries we only want to get
jar files from that directory, while boot itself have a need
to travel recursively to find classfiles from an expoded archive.

We handle this case by using recursive(true by default) flag in
ExplodedArchive and this flag is set to false in PropertiesLauncher
if we match wildcard.
2014-01-07 18:05:10 +00:00
Dave Syer 633dea9d80 Add declarative ApplicationListener 2014-01-07 17:53:34 +00:00
Dave Syer 73c2216732 Migrate file encoding initializer to listener 2014-01-07 17:52:46 +00:00
Dave Syer 4d28e1b601 Migrate VCAP initializer to a listener 2014-01-07 17:52:46 +00:00
Dave Syer 441572c61c Migrate config file initializer to a listener 2014-01-07 17:52:46 +00:00
Dave Syer 3dacf4be17 Migrate Logging and Liquibase initializers to be listeners 2014-01-07 17:52:45 +00:00
Dave Syer 27ae6a5fd6 Add ApplicationListener as first class component in Spring Application 2014-01-07 17:52:45 +00:00
Andy Wilkinson 3336b6da44 Remove redundant @GrabResolver transform
Previously, a transform was used to add @GrabResolver annotations
during compilation that added the Spring milestone and snapshot
repositories. This functionality is now handled by
RepositoryConfigurationFactory so the transform is no longer required.
2014-01-07 10:31:10 +00:00
Phillip Webb 751beda2cb Additional fixes for auto-configuration report
Fix the following issues that were introduced in commit 0610378:

- Formatting of code including imports
- Improve hashcode/equals implementations by using ObjectUtils
- Provide hashcode/equals for ConditionOutcome
- Use LinkedHashSet in ConditionAndOutcomes to maintain insert order

Fixed gh-127
2014-01-06 10:52:33 -08:00
Greg Turnquist b5b86d07ba Add Spring MVC's org.springframework.ui package to the list of automatic imports 2014-01-06 17:30:05 +00:00
Dave Syer 8fe696944a Delete duplicate logback.xml if running from Maven plugin
Fixes gh-143
2014-01-06 17:28:22 +00:00
Dave Syer ac34f9c993 First proper draft of DSL for Groovy Commands
Users can declare or Command, OptionHandler classes in an init script
or they can use a DSL, e.g.

command("foo") { args -> println "Do stuff with ${args} array" }

or

command("foo") {
  options { option "bar", "Help text for bar option" ithOptionArg() ofType Integer }
  run { options -> println "Do stuff with ${options.valueOf('bar')}" }
}
2014-01-06 16:00:10 +00:00
Dave Syer 1e75c0a55b Extend programming model for script commands 2014-01-06 11:40:21 +00:00
Dave Syer b5db4d3ff4 Enhance FileOptions to support multiple classpath resources 2014-01-06 11:40:21 +00:00
Dave Syer cd7b1b19c5 Add InitCommand to execute groovy script on startup
InitCommand runs on creation of SpringCli so it can search for additional
Commands in updated classpath. Also added as interactive command in Shell
session.
2014-01-06 11:40:21 +00:00
Dave Syer 033250195b Allow user to specify classLoader as loader property
PropertiesLauncher now supports creating its own class loader
from looader.classLoader property. It will succeed if the
implementation specified has a default constructor or one
that takes a parent class loader, or one that takes a URL[]
and a parent class loader (like URLClassLoader).
2014-01-06 11:40:20 +00:00
Dave Syer f5f41fef5e Check that WAR apps work in a container 2014-01-06 11:38:00 +00:00
Greg Turnquist 0610378d2f Resolves #127: Prevent duplicate report outcomes
The collection of outcomes is a list. Sometimes a race condition causes to instances
of the same outcome to get added to the list shown in the report. By replacing this
with a set and propery equals/hashCode, duplicates are prevented from appearing
in the report.

I added test cases to prove that that POJO is properly managed inside a Set and also
to show that duplicates don't appear in the final report.
2014-01-06 10:42:16 +00:00
Dave Syer c71322a0b2 Add a BatchConfigurer so the transaction manager can adapt to JPA
Autoconfiguration ordering has to be adjusted so that a DataSource is
available before an EntityManagerFactory is ever needed. Previously
the autoconfigs were accidentally loaded in the right order, but after
the change to BatchAutoConfiguration the order has to be explicit.

Fixes gh-189
2014-01-06 10:41:49 +00:00
Dave Syer e48ddaeb99 Fix grab test 2014-01-06 10:41:49 +00:00
Dave Syer df476bed1f Ensure local repository cache is always used 2014-01-03 09:56:22 +00:00
Dave Syer 47a0df1e3d Add groovy to dependency management 2014-01-03 08:34:14 +00:00
Phillip Webb 6b3e79e693 Polish 2014-01-02 14:56:51 -08:00
Phillip Webb bd6c672bba Drop jumping into shell when running without args
Change SpringCli so that running without arguments no longer jumps into
the embedded REPL shell. This restores the ability to obtain quick usage
help by simply typing `spring` from the command prompt.

Windows users or developers that prefer the embedded shell can still
launch it using `spring shell`.
2014-01-02 14:26:04 -08:00
Phillip Webb f56318e9b8 Polish embedded REPL shell 2014-01-02 14:13:22 -08:00
Phillip Webb 1bcd3de7b5 Polish 2014-01-02 12:10:37 -08:00
Phillip Webb 0f9c705980 Rework OptionHandler '-cp' argument support
Change OptionHandler to support '-cp' instead of '--cp'. This update
to the original fix (045088e8b) renders `help` output correctly and
should prevent potential issues if a `-p` command is added in the future.

Fixes gh-178
2014-01-02 11:42:59 -08:00
Phillip Webb 3a82eac2e6 Prevent early initialization of Servlets
Defer loading of Servlets (with a loadOnStartup priority) until
the `EmbeddedServletContainer.start()` method is called. This prevents
issues with the DispatcherServlet being initialized before the embedded
ApplicationContext is fully initialized.
2014-01-02 11:11:21 -08:00
Phillip Webb 3cd4026bcc Update eclipse template copyright date to 2014 2014-01-02 10:56:03 -08:00
Phillip Webb 0029e8200c Fix copyright dates 2014-01-02 10:55:04 -08:00