Commit Graph

1405 Commits (fbf3c48bf8c2a590d07edf732c54dcc68fadc883)

Author SHA1 Message Date
Dave Syer d23dab3bd0 Change package name in sample 11 years ago
Phillip Webb 43e54d38f7 Make fields private where possible 11 years ago
Phillip Webb 0160760568 Apply latest eclipse cleanup rules 11 years ago
Phillip Webb ac54d7fe3c Final polish before 1.0.0.RC1 11 years ago
Phillip Webb cdda330acd Update copyright header for files changed in 2014 11 years ago
Phillip Webb b12d728c06 Update ant example to 1.0.0.BUILD-SNAPSHOT 11 years ago
Phillip Webb 68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
11 years ago
Dave Syer 5627caa724 Move spring-boot tests utilities to main spring-boot.jar
Fixes gh-233
11 years ago
Dave Syer d53a52cf1a Fix test 11 years ago
Dave Syer d01bc59d7e Update to bootstrap 3.0.3 11 years ago
Dave Syer aded7435b5 Swicth to webjars for static sample 11 years ago
Dave Syer 559f907b54 Use explicit test dependencies in samples 11 years ago
Phillip Webb 312535bcd5 Add SpringNamingStrategy to improve FK names
Add a new `SpringNamingStrategy` hibernate `NamingStrategy` that
extends `ImprovedNamingStrategy` to improve the name of foreign
key columns.

Fixes gh-213
11 years ago
Dave Syer 5592023f16 Add support for reloading resources in Gradle plugin
Usage:

$ gradle bootRun
...

Edit files in src/main/resources and see the changes live in a web app
(e.g. static resources in /static).

The old functionality of bootRun has been replaced (since it didn't add
a lot of value and also didn't expose any JMV argument setters of anything).
This new feature set is backed by any existing "run" task configuration.

In addition autodetects a main class if there is one in the project
sources, so no need for mainClassName = '...' in build.gradle.

Applies the 'application' plugin (so no need to declare that either).

Fixes gh-225
11 years ago
Phillip Webb e3b352e0b5 Support 'headless' applications
Update SpringApplication to run by default in 'headless' mode. This
prevents the AWT system from creating a Java icon (for example in the
OSX dock).

Also update builds to run tests in 'headless' mode.
11 years ago
Phillip Webb ffe8bf5419 Remove unused .gitignore files 11 years ago
Phillip Webb 47da8a817a Polish 11 years ago
Dave Syer 5bbb01c071 Move properties file to correct location 11 years ago
Dave Syer d6b2ade8df Ensure logging initializer listens to the right event
This should make a difference to gh-196. It might even fix it
(depending on what snapshot the user had there).
11 years ago
Dave Syer b1db714c23 Allow @EnableGlobalMethodSecurity in a non webapp
Fixes gh-202
11 years ago
Dave Syer f5f41fef5e Check that WAR apps work in a container 11 years ago
Phillip Webb 1bcd3de7b5 Polish 11 years ago
Phillip Webb 0029e8200c Fix copyright dates 11 years ago
Phillip Webb 7623c291a2 Attempt to fix failing CI build 11 years ago
Dave Syer f448e79f29 Remove long package names from samples
Long package names are really unnecessary in samples and they
just clutter things up. Also Spring Loaded doesn't work with
org.sfw packages, so to demo that technology you need a
different package name.
11 years ago
Dave Syer aa2b020660 Refactor metrics to expose richer feature set
Main user-facing interface is still Counter/GaugeService but the
back end behind that has more options. The Default*Services write
metrics to a MetricWriter and there are some variants of that, and
also variants of MetricReader (basic read-only actions).

MetricRepository is now a combination of MetricReader, MetricWriter
and some more methods that make it a bit more repository like.

There is also a MultiMetricReader and a MultiMetricRepository for
the common case where metrics are stored in related (often open
ended) groups. Examples would be complex metrics like histograms
and "rich" metrics with averages and statistics attached (which
are both closed) and "field counters" which count the occurrences
of values of a particular named field or slot in an incoming message
(e.g. counting Twitter hastags, open ended).

In memory and redis implementations are provided for the repositories.
Generally speaking the in memory repository should be used as a
local buffer and then scheduled "exports" can be executed to copy
metric values accross to a remote repository for aggregation.
There is an Exporter interface to support this and a few implementations
dealing with different strategies for storing the results (singly or
grouped).

Codahale metrics are also supported through the MetricWriter interface.
Currently implemented through a naming convention (since Codahale has
a fixed object model this makes sense): metrics beginning with "histogram"
are Histograms, "timer" for Timers, "meter" for Meters etc.

Support for message driven metric consumption and production are provided
through a MetricWriterMessageHandler and a MessageChannelMetricWriter.

No support yet for pagination in the repositories, or for HATEOAS style
HTTP endpoints.
11 years ago
Dave Syer f5ad4be2c1 Add basic build.xml to actuator sample
$ ant -lib ivy-2.2.jar

(substitute the location of your actual ivy jar)

    $ java -jar target/*.jar

Fixes gh-140
11 years ago
Dave Syer 6c4ee0b05d Add PoolConfig to Redis 11 years ago
Dave Syer fa507005cd Use ServletWrappingController for jolokia instead of Servlet
We get more control over the handling and in particular the registration
of the endpoint this way. It was practically impossible to disable the
AgentServlet bean when in a parent context of the management server
because of lifecyce issues - you don't know that the user wants a
separate management server until too late.

This approach also makes it possible to test with spring-test MVC
support.
11 years ago
Dave Syer e2c962ac28 Switch to thymeleaf-spring4 11 years ago
Dave Syer d9e326a3d3 Add @Value injection to JSP (WAR) sample 11 years ago
Phillip Webb dbec81cabe Disable jmx by default
Change JmxAutoConfiguration so that by default JMX exposure is not
enabled. This matches the Javdoc text.
11 years ago
Dave Syer 6443800038 Add actuator-noweb sample 11 years ago
Dave Syer ab4dec58ef Rename packages in samples 11 years ago
Dave Syer 997b015d10 Split SecurityAutoConfiguration
Spring Security 3.2 has a new annotation @EnableWebMvcSecurity that we
should use if MVC is being used.
11 years ago
Phillip Webb 513c6a1de2 Polish 11 years ago
Dave Syer 60cb5fd35c Add log4j starter and some documentation
As discussed in gh-162
11 years ago
Dave Syer b72002142d Split MessageConverters auto config out into separate class 11 years ago
Dave Syer e55e8f9863 Add build.gradle samples and rename runJar->bootRun 11 years ago
Dave Syer bcae284dd9 Add a shim Endpoint if management context is child
When management endpoints are on a different port the HandlerMappings
are restricted to a single EndpointHandlerMapping, so the error
controller (which is a normal @Controller with @RequestMappings) does
not get mapped.

Fixed by addinga shim Endpoint on "/error" that delegates to the
ErrorController (which interface picks up an extra method).
11 years ago
Dave Syer 25d9ac6535 Remove FIXME from JPA sample 11 years ago
Phillip Webb f7f53e4e64 Fix for upstream Spring 4.0 changes 11 years ago
Dave Syer 19fa5b9af6 Updated howtos 11 years ago
Dave Syer 9db55a3b71 Add explicit test for config file and SpringApplication 11 years ago
Dave Syer 3e6c1b435f Add @SpringApplicationConfiguration (for integration testing)
Example:

    @RunWith(SpringJUnit4ClassRunner.class)
    @SpringApplicationConfiguration(classes = SampleDataJpaApplication.class)
    public class CityRepositoryIntegrationTests {

    	@Autowired
    	CityRepository repository;

Fixes gh-66.
11 years ago
Dave Syer 2f6f88e370 Fix actuator sample for new shutdown property 11 years ago
Dave Syer 756b5e1b60 Convert JSP sample to deployable (executable) WAR 11 years ago
Dave Syer 3f1cfbf241 Add JSTL to JSP sample 11 years ago
Phillip Webb f4f668a52b Polish 11 years ago
Dave Syer aed0e0f217 Add provided scope for tomcat 11 years ago
Dave Syer d6593fbee6 Add extra test for partial overrides 11 years ago
Dave Syer bd26b28aa5 Extract actuator security into separate classes
So spring-security + a web app is secure by default
(you don't need the actuator).
11 years ago
Christian Dupuis 95e68bf1a2 Prepare actuator sample to show how to use the telnet connector 11 years ago
Dave Syer 63f8b63f7e Upgrade Tomcat to 7.0.47 11 years ago
Phillip Webb 64f32893bb Source format and clean-up 11 years ago
Phillip Webb 883fd9162f Polish 11 years ago
Dave Syer 811bd32ce2 More sensible signature for servlet initializer 11 years ago
Dave Syer c678be49e3 Explicitly add servlet API to actuator sample 11 years ago
Dave Syer 6845c6b787 Remove tomcat dependencies from sample unless needed 11 years ago
Christian Dupuis 55b0e747b0 Rename spring-boot-starter-shell-crsh to spring-boot-starter-shell-remote 11 years ago
Dave Syer c144cae600 Comment out security condition pending SPR-11069 11 years ago
Dave Syer e43dcd3061 Upgrade reactor and tomcat (for websocket) 11 years ago
Dave Syer 7006f222ab Use @Transactional where appropriate 11 years ago
Dave Syer 0c79c8913f Ensure AutoConfigurationReport is always present 11 years ago
Greg Turnquist b63016d8fc Create a report based on Boot's autoconfiguration decisions
- Gather autoconfiguration conditional decisiions (true and false)
- Provide an actuator endpoint as one means to read the report
- Define @EnableAutConfigurationReport annotation to turn this feature on
- Tidy up autoconfig report a bit and log it if --debug=true
11 years ago
Christian Dupuis 6b599b8483 Add remote shell implementation based on crsh
This commit adds a new starter named spring-boot-starter-shell-crsh and auto configuration support to embed a system shell within Spring Boot applications.

The embedded shell allows clients to connect via ssh or telnet to the Boot app and execute commands. Commands can be implemented and embedded with app.

For sample usage see spring-boot-samples-actuator.
11 years ago
Dave Syer a2db6a911f Add new sample to reactor build 11 years ago
Dave Syer c5cfe54c80 Add spring-boot tests to test starter 11 years ago
Dave Syer e53dad879d Add sample with form login 11 years ago
Dave Syer 63a2d06767 Explicitly disable security on management endpoints if requested
Previously the management endpoint filter was applied to all requests
if the user had disabled security.management.enabled, but since it
had no security applied it was letting all requests through.

The fix was to explicitly exclude the whole enclosing configuration
and carefully ignore the management endpoints in the normal security
chain.

Fixes gh-100.
11 years ago
Dave Syer 6c31854600 Refactor sample dependencies to use starters 11 years ago
Dave Syer 0498617411 Disable whitelabel view if Thymeleaf error.html detected 11 years ago
Phillip Webb af0d08c998 Polish 11 years ago
Phillip Webb b772f7c2e4 Polish
Minor formatting and consistent copyright header.
11 years ago
Phillip Webb 1a9ce42da9 Apply source formatting to samples 11 years ago
Ulrich von Poblotzki f306eda703 Implemented the error handling in case of commucation failures 11 years ago
Ulrich von Poblotzki 386bb73169 Added simple error hangling to 'SnakeTimer#broadcast'
In some cases the websocket communication fails and Snake#sendMessage throws an exception.
In that case the send loop is interrupted and later clients are not update.
11 years ago
Dave Syer 4655eb3a94 Expose SpringApplicationBuilder in SpringBootServletInitializer 11 years ago
Ulrich von Poblotzki 4ddae32de9 Updated Tomcat version updated to 8.0.0-RC3
The RC1 version had some websocket issues, that prevented propper websocket communication.
In some cases the SocketJS communication was downgraded to 'xhr_streaming'.
11 years ago
Dave Syer 3b2abe9c17 Use create_drop JPA as default if in-memory
[Fixes #55277582] [bs-288]
11 years ago
Dave Syer 1a59698f8b Tweak AMQP sample slightly 11 years ago
Eberhard Wolff 1096ed6d1f Added AMQP starter and sample 11 years ago
Dave Syer 5fe9ef69c7 Add SpringApplicationContextLoader 11 years ago
Dave Syer 345c0fc5a4 Add SpringApplicationBuilder
Builder for SpringApplication and ApplicationContext instances with
convenient fluent API and context hierarchy support. Simple example
of a context hierarchy:

   new SpringApplicationBuilder(ParentConfig.class)
               .child(ChildConfig.class).run(args);

Another common use case is setting default arguments, e.g.
active Spring profiles, to set up the environment for an application:

     new SpringApplicationBuilder(Application.class).profiles("server")
 		.defaultArgs("--transport=local").run(args);

If your needs are simpler, consider using the static convenience
methods in SpringApplication instead.

[#49703716] [bs-116] Parent context for some beans maybe?
11 years ago
Dave Syer f7fa63bcb4 Add status and error messages to /trace
[Fixes #57949108] [bs-323] Make sure /trace shows error responses
11 years ago
Phillip Webb 1bdb2ce1c2 Polish 11 years ago
Dave Syer 923f286ae2 Add spring.view.{prefix,suffix} properties
Fixes #62
11 years ago
Phillip Webb e16a0278ae Support single config from ServletInitializer
Update SpringBootServletInitializer with separate getConfigClass() and
getAdditionalConfigClasses() methods. This change makes it easier to
use the SpringBootServletInitializer with the common use case of a
single config class.
11 years ago
Phillip Webb c544921eaa Polish whitespace 11 years ago
Dave Syer abb1420486 Fixes #55: stop() connector to unbind socket
The `Tomcat.start()` has to happen to initialize the `ServletContext`
but we can immediately stop the connector and then restart it when
the context is finished refreshing. Seems to make curl fail quickly
if an app is slow to start.
11 years ago
Phillip Webb 9a529b41c1 Polish 11 years ago
Phillip Webb b857a9001d Cleanup trailing whitespace 11 years ago
Dave Syer 2b5a67ba3c mongo->mongodb sample 11 years ago
Dave Syer 1026e349c4 Prevent Mongo sample tests from failing in CI 11 years ago
Dave Syer 191894a16a Add Mongo auto configuration
Spring Data Mongo is the only dependency so it doesn't
really need a new starter. Added a sample though.
11 years ago
Dave Syer d06d202fd0 Add AopAutoConfiguration (also starter and sample)
A side effect is that spring-boot-starter-data-jpa needs
to include an aspectjweaver depdendency. Hope that doesn't
hurt anything else.

[Fixes #56780004]
11 years ago
Phillip Webb a33425920b Rework POMs to support automated CI release 11 years ago
Phillip Webb 16cf2faa1b Remove sample gradle builds
Remove sample gradle builds since they are not run during the regular
build and would need to be manually updated after a release.
11 years ago
Dave Syer 38e565e920 Back to SNAPSHOT for dev 11 years ago
Dave Syer b634b3bde6 Update to 0.5.0.M2 11 years ago
Dave Syer 5755b07e6c Switch roles of snake and echo
Snake is stateful so it should be one per connection. Echo is the
opposite.
11 years ago
Phillip Webb f7ce153ff0 Fix JSP EL support with Tomcat
Fix TomcatEmbeddedServletContainerFactory to set a MERGED_WEB_XML
attribute when JSPs are used. This is required for EL support with
JSPs since Jasper checks the version number in the web.xml. Without
any web.xml Jasper default to disabling EL.

Issue: #55752948
11 years ago
Phillip Webb a95494fe61 Remove '/resources/**' mapping and default servlet
Remove '/resources/**' mapping since it can cause problems with the
'/**' when the developer defines their own 'resources' sub-folder.

Also remove default servlet config since the resources mapping renders
it redundant.

Issue: #55494446
11 years ago
Dave Syer 1e0e2e7102 Switch off CSRF filter
Might need to revisit later.
11 years ago
Dave Syer 43fc107437 Fix security config
The management endpoints were still all mixed up
with the user endpoints. Fixed that and extracted
user endpoints in to conditional block so not
protected if path explicitly set to empty string.

[#53029715]
11 years ago
Phillip Webb 2b54b6286f Rework database auto-configure
Rework several aspects of database auto-configuration:

- Use RelaxedPropertyResolver to obtain property values
- Extract EmbeddedDatabaseConnection from EmbeddedDatabaseConfiguration
- Rename several configuration classes for consistency

Issue: #53028397
11 years ago
Dave Syer 621116c9b8 ManagementServerConfiguration security
Management endpoints are still secure by default if
Spring Security is present, but now the default
user details have an ADMIN role, and a random password
(which is logged at INFO level if not overridden).

To override you add management.user.password (name, role)
to external properties.

[Fixes #53029715] [bs-203]
11 years ago
Dave Syer 3c44fda782 Switch off ws sample tests 11 years ago
Dave Syer 5ead60a7e1 Comment out websocket sample (fails in CI) 11 years ago
Dave Syer 767aa43e31 Add WebSocketAutoConfiguration
Opinionated defaults for WebSockets:

* If spring-websocket is on the classpath and so is
the Tomcat WSci initializer then it is added to the context
* A DefaultSockJsService is added if none is present
* User has only to define @Beans of type WebSocketHandler with
name starting "/"
* Each one is converted to a SockJsHttpRequestHandler and
mapped to "/<beanName>/**"
11 years ago
Dave Syer 6e8cbbde3b Use reflection hack for error page in Tocmat 8 11 years ago
Biju Kunjummen fa3b593568 Removed spring-boot related version from dependencies of samples 11 years ago
Phillip Webb d4fe320254 Update trace logging to include Hibernate SQL 11 years ago
Dave Syer d205d9404a Add additional ViewResolver configuration
The DispatcherServlet adds a default InternalViewResolver
which was used by some apps, but when the actuator was
available it added an "/error" bean and effectively
switched off the default view resolver. The net fix was
to add an InternalViewResolver at the same time as
adding any other ViewResolvers.

[Fixes #55357516] [bs-290] Actuator UI app cannot serve static index.html
11 years ago
Phillip Webb 878ff13620 Documentation updates 11 years ago
Phillip Webb cf655945aa Polish 11 years ago
Dave Syer 7bea9dd973 Massage MVC test a bit
* Use *Tests as classname
* Fixed broken test in suite where ID is not always "1"
11 years ago
Biju Kunjummen 31af68a915 Added a Spring MVC test for the Sample MessageController 11 years ago
Dave Syer 42bb793155 Add ServletContextListener to embedded web app
* User can add @Bean of type EventListener (e.g.
ServletContextListener)

[Fixes #54112999] [bs-254]
11 years ago
Phillip Webb f5bae04714 Ignore websocket sample for now 11 years ago
Phillip Webb b5e81ff42d Fix broken test dependencies 11 years ago
Phillip Webb eb69732fbb Reinstate integration tests 11 years ago
Dave Syer 521174754e Add default /error view for HTML clients
* Add integration tests for /error view
* Add "error" @Bean as default view for HTML

Users may see side effects because now there will be
a ContentNegotiatingViewResolver by default for the
first time in a vanilla Actuator app. Should be
interesting.

[Fixes #54597932] [bs-273] Circular view reference for /error
11 years ago
Dave Syer f502098065 Fix logging depdendencies in samples 11 years ago
Dave Syer 12f0d4d95e Rename ops package to actuate 11 years ago
Dave Syer d2419a36fd Add server.tomcat.access_valve_enabled flag
Also introduced new strategy for customizing Tomcat Context
(TomcatContextCustomizer) - any that are added to the factory
will be applied before any other customizations in postProcessContext()

[Fixes #54670052] [bs-275] Make Tomcat access valve logs more accessible
11 years ago
Phillip Webb d86bf66645 Add parent relativePath
Update sample applications to correctly refer to parent relativePath.
11 years ago
Phillip Webb 4e11ae1671 Documentation
Various updates to README.md files.
11 years ago
Phillip Webb 4038b39496 Add OutputCapture test class 11 years ago
Dave Syer c2c8144117 Add websocket sample 11 years ago
Dave Syer bfb843e1a0 Add logging initializer to tests 11 years ago
Dave Syer 3922a7f526 Reinstate junit dependencies in starters 11 years ago
Oliver Gierke d2def68602 Cleanups Spring Data JPA example.
Various cleanups to the Spring Data JPA example, including:

* Move repositories into service package and make them package private
  thus only expose the service interfaces to clients.
* Merge HotelRepository and HotelSummaryRepository and make service
  implementations package protected.
* Introduce integration test base class to bootstrap the app as
  SpringAppliation.run would.
* Refactor central test case to rather use Spring MVC integration
  testing framework.
* Add integration tests for repositories to execute query methods.
11 years ago
Phillip Webb 1db22aca5c Rework POM structure
Rework main build POM to be an aggregator pom that does not inherit
from any parent. Introduce new spring-boot-dependencies module to
act as a parent for both spring-boot-starter-parent and
spring-boot-parent.
11 years ago
Dave Syer 4bb5de02e7 Switch back to SNAPSHOT for dev 11 years ago
Dave Syer 638a31f5e3 Fix poms for a milestone release 11 years ago
Dave Syer 68e5a7e887 Bump version to 0.5.0.M1 11 years ago
Phillip Webb e1c6860a41 Documentation 11 years ago
Phillip Webb 5450af70e0 Ops -> Actuator 11 years ago
Phillip Webb 4c067a89fe Ops -> Actuator 11 years ago
Dave Syer 39425c81d6 Servlet context document root not found when running as exploded WAR
* Added additional search in
AbstractEmbeddedServletContainerFactory.getValidDocumentRoot() to
detect a /WEB-INF/ directory in the code archive
* If the code archive is in /WEB-INF/** then we assume it is
safe to serve content from / (exposes the loader classes
but nothing sensitive from the app)

[Fixes #54345578]
11 years ago
Dave Syer 5995b7727a Ops -> Actuator 11 years ago
Phillip Webb 3bb79db579 Renamed spring-boot-ups -> spring-boot-starter 11 years ago
Dave Syer 2f0a96c986 Remove unused @ComponentScan 11 years ago
Dave Syer 6d76467a66 Add responsive features to static sample 11 years ago
Phillip Webb 0fee00f0d7 Add gradle example builds
Add gradle example builds to spring-boot-sample-tomcat and
spring-boot-sample-traditional.

Issue: #53129653
11 years ago
Phillip Webb 6fd6d3a73e Rename maven 'package' goal to 'repackage' 11 years ago
Phillip Webb 36c3ceab97 Include servlet support for index.html resources
Issue: #54228642
11 years ago
Phillip Webb 728829ba81 Revert welcome file defaults
Revert welcome file default that break existing tests.

Issue: #54228642
11 years ago
Dave Syer fe90df3afc Remove WARN log in Tomcat startup 11 years ago
Dave Syer 4c359e1a4d Two choices are available to users for welcome page
* For a jar deployment add classpath:static/index.html
(works via Spring MVC mapping)
* For a war the same thing works, but so does adding
index.html to src/main/webapp (works via container
default servlet)

[Fixes #54092261] [bs-252]
11 years ago
Dave Syer 7ea433dce2 Fix broken logback.xml 11 years ago
Phillip Webb b665a2bb1d Renamed packages
Issue: #54095231
11 years ago
Phillip Webb 3f2bb03fb8 Renamed some projects and polish POMs
Issue: #54095231
11 years ago
Dave Syer 2098e23fca Change package names zero->boot
* actuator -> boot-ops
* cli -> boot-cli
* launcher -> boot-load
* autoconfig -> boot-config
* bootstrap -> boot-strap
* starters -> boot-up

[#54095231] [bs-253] Refactor Zero->Boot
11 years ago