Commit Graph

322 Commits

Author SHA1 Message Date
Andy Wilkinson ee16332745 Update Actuator to use the new endpoint infrastructure
This commit migrates the Actuator onto the new endpoint infrastruture.
In addition to the existing support for accessing the endpoints via
JMX and HTTP using Spring MVC, support for access via HTTP using
Jersey and WebFlux has been added. This includes using a separate
management port where we now spin up an additional, appropriately
configured servlet or reactive web server to expose the management
context on a different HTTP port to the main application.

Closes gh-2921
Closes gh-5389
Closes gh-9796
2017-08-11 16:38:41 +01:00
Andy Wilkinson 0aa39d0279 Improve the package structure of spring-boot-actuator module
Closes gh-7545
2017-08-10 12:08:01 +01:00
Andy Wilkinson bb55f49396 Remove concept of sensitivity from Actuator's endpoints
Closes gh-9924
2017-08-01 10:05:09 +01:00
Andy Wilkinson 847f6d1b2c Update test in Actuator sample to adapt to changes in env response
See gh-9864
2017-08-01 09:03:23 +01:00
Andy Wilkinson 4f76a560b8 Fix the Actuator sample 2017-07-31 08:47:16 +01:00
Andy Wilkinson 9f75da9a8f Simplify the Actuator's hypermedia support
This commit replaces the Acuator's support for hypermedia with a
single endpoint that returns HAL-formatted links to all of the
available endpoints. This is done without requiring Spring HATEOAS
to be on the classpath in a similar manner to the existing
CloudFoundry discovery endpoint.

Closes gh-9901
2017-07-30 22:43:05 +01:00
Phillip Webb 9db72450da Merge branch '1.5.x' 2017-07-19 10:23:23 -07:00
Phillip Webb 68910f2b8f Polish 2017-07-19 10:21:06 -07:00
Madhura Bhave ecaa6340e2 Update path in actuator sample tests 2017-07-17 19:22:33 -07:00
Madhura Bhave b58923a42d Merge branch '1.5.x' 2017-07-17 11:27:08 -07:00
Madhura Bhave 0f8a819af9 Enable cors in default management security config
Fixes gh-9548
2017-07-17 10:49:48 -07:00
Stephane Nicoll aa083996f9 Fixup version numbers following release 2017-06-08 17:38:11 +03:00
Spring Buildmaster 05d4d0281c Next Development Version 2017-06-08 12:47:16 +00:00
Phillip Webb 06558675bb Polish 2017-04-25 09:45:14 -07:00
Stephane Nicoll 9327b58304 Fixup version numbers following release 2017-04-21 11:26:45 +02:00
Spring Buildmaster 9768b0a8c2 Next Development Version 2017-04-21 08:32:01 +00:00
Madhura Bhave bcd79dd992 Move all actuators under `/application`
Context path can be configured via `management.context-path`.

Closes gh-6886
2017-04-14 15:15:44 -07:00
Phillip Webb c4cba6b0ea Merge branch '1.5.x' 2017-04-11 21:07:51 -07:00
Phillip Webb d301d0f4c3 Merge branch '1.4.x' into 1.5.x 2017-04-11 20:42:48 -07:00
Phillip Webb 758ddcd420 Polish 2017-04-11 20:17:23 -07:00
Madhura Bhave 971057705d Merge branch '1.5.x' 2017-04-11 15:57:10 -07:00
Madhura Bhave 535451f9e5 Merge branch '1.4.x' into 1.5.x 2017-04-11 15:54:01 -07:00
Madhura Bhave b2f0ebfcb8 Prevent empty json for parameters in trace endpoint
Fixes gh-8883
2017-04-11 15:30:39 -07:00
Phillip Webb 2de7e9c310 Merge branch '1.5.x' 2017-04-04 10:07:38 -07:00
Phillip Webb 3b93bb46e0 Revert accidental call to `.close()`
Remove call to `.close()` which was accidentally left in after some
performance testing.
2017-04-04 09:56:03 -07:00
Phillip Webb ad38776de3 Polish 2017-04-04 09:48:10 -07:00
Andy Wilkinson 47c0c3c0ef Update samples with Gradle configuration to align with new plugin 2017-04-04 15:33:27 +01:00
Phillip Webb 67556ba8ea Restructure embedded web server packages
Rework `org.springframework.boot.context.embedded` to relocate classes
to `org.springframework.boot.web`. Packages are now organized around
the following areas:

Packages for shared concerns, for example the `WebServer` interface
to start/stop a server and the common configuration elements:
- org.springframework.boot.web.context
- org.springframework.boot.web.server

Servlet specific packages:
- org.springframework.boot.web.servlet.server
- org.springframework.boot.web.servlet.context
- org.springframework.boot.web.servlet.filter

Reactive specific packages:
- org.springframework.boot.web.reactive.context
- org.springframework.boot.web.reactive.server

Embedded server implementations (both reactive and servlet):
- org.springframework.boot.web.embedded

In addition:

- Rename `EmbeddedServletContainerFactory` to `ServletWebServerFactory`
  to align with the `ReactiveWebServerFactory`.
- Rename `EmbeddedWebApplicationContext` to
  `ServletWebServerApplicationContext` and
- Rename `EmbeddedReactiveWebApplicationContext` to
  `ReactiveWebServerApplicationContext`.
- Add checkstyle rules to restrict imports.
- Fixup all affected code to use the correct imports and local names.

Fixes gh-8532
2017-03-12 21:08:25 -07:00
Phillip Webb d8f827d224 Cleanup and format code 2017-03-06 17:08:09 -08:00
Phillip Webb 425dbc3e52 Update copyright header for edited files 2017-03-06 15:04:07 -08:00
Stephane Nicoll 3cdc81c351 Fixup version numbers following release 2017-03-03 17:34:05 +01:00
Spring Buildmaster d23fa24340 Next Development Version 2017-03-03 16:18:26 +00:00
Stephane Nicoll dac3810bc1 Fixup version numbers following release 2017-03-03 16:14:56 +01:00
Spring Buildmaster 2a83e80a9b Next Development Version 2017-03-03 14:39:21 +00:00
Andy Wilkinson fbf493b1e8 Merge branch '1.5.x' 2017-02-08 20:51:37 +00:00
Andy Wilkinson ab192d01cc Merge branch '1.4.x' into 1.5.x 2017-02-08 20:51:30 +00:00
Andy Wilkinson 7e030d2068 Polish 2017-02-08 20:51:23 +00:00
Andy Wilkinson 1efa700713 Merge branch '1.5.x' 2017-02-08 20:50:45 +00:00
Andy Wilkinson 25982ecf69 Merge branch '1.4.x' into 1.5.x 2017-02-08 20:50:24 +00:00
Andy Wilkinson 04c8b912ee Fall back to standard LiveBeansView behaviour when MBean is in use
Closes gh-8146
2017-02-08 20:49:16 +00:00
Brian Clozel 12d883f6b9 Introduce "server.servlet" configuration prefix
This commit refactors the `ServerProperties` property keys and
introduces a separate "server.servlet" namespace to isolate
servlet-specific properties from the rest.

Closes gh-8066
2017-02-07 16:48:22 +01:00
Madhura Bhave 5dafa3ae9c Fixup version numbers following release 2017-01-30 15:27:42 -08:00
Spring Buildmaster 5c12500366 Next Development Version 2017-01-30 20:10:13 +00:00
Andy Wilkinson a9656145de Fix up version numbers following release 2017-01-30 12:27:04 +00:00
Spring Buildmaster a2696bf873 Next Development Version 2017-01-30 11:40:24 +00:00
Stephane Nicoll bd0c1cb9c3 Fixup version numbers following release 2017-01-26 15:55:14 +01:00
Spring Buildmaster ed1ce140c0 Next Development Version 2017-01-26 14:20:39 +00:00
Phillip Webb 53f1df86a2 Merge branch '1.5.x' 2016-12-30 12:17:28 -08:00
Phillip Webb aacf5d660f Update copyright year for changed files 2016-12-30 11:53:51 -08:00
Phillip Webb 273beaa3ce Polish 2016-12-30 11:10:44 -08:00
Stephane Nicoll 4604bb7e8a Merge branch '1.5.x' 2016-12-30 18:01:59 +01:00
Stephane Nicoll c903ff46a7 Polish samples 2016-12-30 17:57:14 +01:00
Phillip Webb c3edf9e341 Fixup version numbers following release 2016-12-22 19:03:09 -08:00
Spring Buildmaster 9057f9ae1f Next development version 2016-12-23 00:15:23 +00:00
Stephane Nicoll 72e696bcbd Fixup version numbers following release 2016-11-08 18:24:42 +01:00
Spring Buildmaster e712a9ba8c Next Development Version 2016-11-08 16:55:37 +00:00
Stephane Nicoll c5cc626d48 Remove remote shell support
See gh-7044
2016-10-11 17:59:25 +02:00
Andy Wilkinson fe10ea73b0 Merge branch '1.4.x' into 1.5.x 2016-10-05 14:58:42 +01:00
Andy Wilkinson ad3e5c04bb Add a second, portal-compatible ID to the Gradle plugin
To be compatible with Gradle's plugin portal, plugins must have an
ID that uses a reverse domain name. This means that spring-boot is
not compatible.

This commit introduces a new ID, org.springframework.boot, and
deprecates the old ID.

Closes gh-6997
2016-10-05 14:58:26 +01:00
Andy Wilkinson f137ec6a3a Merge branch '1.5.x' 2016-10-05 14:58:02 +01:00
Andy Wilkinson 846f264da8 Merge branch '1.4.x' into 1.5.x 2016-10-05 14:57:51 +01:00
Andy Wilkinson 77f1da871f Add a second, portal-compatible ID to the Gradle plugin
To be compatible with Gradle's plugin portal, plugins must have an
ID that uses a reverse domain name. This means that spring-boot is
not compatible.

This commit introduces a new ID, org.springframework.boot, and
deprecates the old ID.

Closes gh-6997
2016-10-05 14:54:23 +01:00
Stephane Nicoll 6643ec3713 Next development version 2016-09-21 17:05:50 +02:00
Stephane Nicoll 6bd670edbc Initiate 1.4.x branch 2016-09-21 11:11:24 +02:00
Stephane Nicoll 97083300d7 Fixup version numbers following release 2016-09-21 10:35:52 +02:00
Spring Buildmaster 7e9ed5e1a7 Next Development Version 2016-09-21 07:58:07 +00:00
Andy Wilkinson 07a50bb16c Update the samples to make use of auto-configured TestRestTemplate
Closes gh-6730
2016-08-25 12:07:40 +01:00
Phillip Webb c7a23eae56 Fixup version numbers following release 2016-07-28 14:38:17 -07:00
Spring Buildmaster 334baaeffd Next development version 2016-07-28 19:54:01 +00:00
Johnny Lim 417fae4e27 Use the managed version for H2 in spring-boot-sample-actuator
Closes gh-6432
2016-07-20 11:29:43 +02:00
Phillip Webb 05ff4ed4e0 Upgrade to Tomcat 8.5.4 & remove tomcat-juli
Upgrade the managed Tomcat dependency to 8.5.4 and remove `tomcat-juli`
since it's now included in `tomcat-embed-core`.

Fixes gh-6192
2016-07-18 17:52:35 -07:00
Andy Wilkinson 3348ed5bb3 Make use of new GetMapping and PostMapping annotations
Closes gh-5277
2016-05-09 17:08:16 +01:00
Phillip Webb a7cb689f95 Move @LocalServerPort annotation
Move the @LocalServerPort to org.springframework.boot.context.embedded
since it's only really useful when working with embedded servlet
containers.

See gh-5822
2016-04-28 12:45:15 -07:00
Stephane Nicoll cc0fc07c0e Move `shell.*` to `management.shell.*`
This commit moves the `shell` namespace to `management.shell`

Closes gh-5703
2016-04-15 18:12:35 +02:00
Stephane Nicoll f364d713dd Add `LocalManagementPort`
Add an annotation alias for the actual management port, similar to what
was done for the main context (`LocalServerPort`).

See gh-5548
2016-04-15 14:02:38 +02:00
Phillip Webb b398b3319c Rename @SpringApplicationTest -> @SpringBootTest
Rename @SpringApplicationTest to SpringBootTest and
@SpringApplicationContextLoader to @SpringBootContextLoader.

Fixes gh-5562
2016-04-04 22:36:58 -07:00
Andy Wilkinson 33f0ea3480 Rework SpringApplicationTest to support web modes
Rework the new testing support so that @SpringApplicationTest can be
used for standard integration tests, web integration tests with a
mock Servlet environment and web integration tests with an embedded
servlet container. This means that it a replacement for 1.3's
@IntegrationTest and @WebIntegrationTest and allows all
SpringApplication testing to be configured using a common annotation.

The old @IntegrationTest and @WebIntegrationTest along with their
supporting classes have been reinstated to their previous form (while
remaining deprecated). This should ensure that they continue to work
in 1.4 exactly as they did in 1.3 giving users a smooth path to
@SpringApplicationTest.

See gh-5477
2016-03-31 21:35:10 -07:00
Phillip Webb 50cb72cb48 Ignore failing Maven goal from Eclipse 2016-03-25 12:46:53 -07:00
Andy Wilkinson 58ca9a1c5d Add a BuildInfo task for generating build.properties with Gradle
The commit adds a new BuildInfo task that can be used to generate
a build.properties file, intended for inclusion in the Actuator's
info endpoint.

A default instance of the task can be configure using the plugin's
DSL:

springBoot {
	buildInfo()
}

Additional properties can also be configured using the DSL:

springBoot {
	buildInfo {
		additionalProperties = [
			'foo': 'bar'
		]
	}
}

When configured via the DSL, the Java plugin's classes task is
configured to depend on the build info task. Alternatively, if more
control is required, the task can be declared and configured manually:

task buildInfo(type: org.springframework.boot.gradle.buildinfo.BuildInfo) {
	additionalProperties = [
		'foo': 'bar'
	]
}

classes {
	dependsOn buildInfo
}

See gh-2559
2016-03-24 08:59:55 +00:00
Phillip Webb 0829a1bde8 Drop superfluous annotations
Update internal tests to drop annotations that can now
be inferred.

Fixes gh-5470
2016-03-23 22:19:36 -07:00
Phillip Webb c28f552883 Migrate SpringJUnit4ClassRunner to SpringRunner
Replace all existing SpringJUnit4ClassRunner references with the new
SpringRunner alias.

Fixes gh-5292
2016-03-23 22:18:18 -07:00
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
2016-03-23 22:17:50 -07:00
Stephane Nicoll 10012cfddc Rename Maven plugin mojo
Rename the goal from `generate-build-info` to `build-info` for consistency.

See gh-2559
2016-03-17 16:58:08 +01:00
Stephane Nicoll 2526a54e31 Polish contribution
Closes gh-5337
2016-03-14 14:24:24 +01:00
Stephane Nicoll dddea70985 Collect and display build information
This commit updates the Maven plugin to generate a
`META-INF/boot/build.properties` file with various build-specific
settings (group, artifact, name, version and build time). Additionally,
the plugin can be configured to write an arbitrary number of additional
properties.

A new `BuildProperties` bean is automatically exposed when such a file is
present. If that bean is present, an `InfoContributor` is automatically
created to expose that information under the `build` key.

As for the git contributor, it is possible to only display the core
settings or everything using the `management.info.build.mode` property.

See gh-2559
2016-03-10 17:21:31 +01:00
Phillip Webb 73cbb2f40a Polish 2016-03-03 09:14:24 -08:00
Stephane Nicoll 0490fbc7f8 Polish contribution
`InfoProvider` is now `InfoContributor` and contributes to the `Info`
instance via a builder. The `Info` instance is immutable. Each
contributor can be disabled via the `management.info.<name>.enabled`
key or all can be disabled using `management.info.defaults.enabled` (this
is similar to what the health endpoint does).

By default, all keys from the environment starting with `info.` are
exposed. If a `git.properties` file is present in the classpath, the
content of `GitInfo` is exposed using the `git` key.

A `SimpleInfoContributor` and `AbstractEnvironmentInfoContributor` are
available for convenience. `InfoContributor` instances can be ordered
the usual way, with a default order provided by
`InfoProviderAutoConfiguration#DEFAULT_ORDER`.

Closes gh-3492
2016-03-03 16:23:37 +01:00
Meang Akira Tanaka 8bebe6dea9 Info endpoint
See gh-3492
2016-03-03 14:39:55 +01:00
Andy Wilkinson 44ddfcc7fa Upgrade copyright headers of all files changed in 2016 2016-02-25 12:09:42 +00:00
Stephane Nicoll ebffa493e4 Harmonize ConfigurationProperties bean name
When `@EnableConfigurationProperties` is defined, Spring Boot
automatically registers a bean in the context for each class specified
on the annotation. Previously, the name of the bean only included the
prefix which leads to conflict if two different classes use the same
prefix.

This commit changes the bean name structure to be <prefix>-<fqn> where
prefix is the prefix used on the annotation and <fqn> the fully qualified
name of the target class.

Closes gh-4395
2016-02-09 17:19:11 +01:00
Phillip Webb 1cc1fc6431 Use AssertJ in spring-boot-samples
See gh-5083
2016-02-06 15:51:26 -08:00
Phillip Webb fbaf209240 Move master to 1.4.0.BUILD-SNAPSHOT 2016-01-24 10:45:24 -08:00
Phillip Webb c77a7e0cba Fixup version numbers following release 2016-01-21 19:18:01 -08:00
Spring Buildmaster 504d3e97ba Next development version 2016-01-21 18:41:30 -08:00
Stephane Nicoll ecf56f0708 Fixup version numbers following release 2015-12-18 15:07:13 +01:00
Spring Buildmaster 8db59059a5 Next Development Version 2015-12-18 05:43:02 -08:00
Phillip Webb 0489a3b4de Polish 2015-12-10 19:43:29 +00:00
Dave Syer 344360453e Add test for management.security.enabled=false with child context 2015-11-27 17:14:49 +00:00
Dave Syer 2de48a35ab Make /error the error page in child context as well as parent
If user set the management.port *and* the management.context-path
then the /error path was in the wrong place because formerly it
was implemented (in this case) by an MvcEndpoint. If we
switch it to a regular @Controller (which are now supported in the
child context if there is one) then it won't disappear under the
management.context-path.

Also use lazy request matching in ignores as well as secure paths.
The problem was that the ignores were constructed eagerly from the
actuator paths before they were available (the EndpointHandlerMapping
needs to be lazily accessed to avoid a security-induced bean creation
cascade).

Fixes gh-4624
2015-11-27 16:53:37 +00:00
Johnny Lim 8ec00c35bf Polish
Closes gh-4572
2015-11-21 08:12:21 +01:00