Commit Graph

327 Commits (3a6dbb4cc85e7895a73b4b67f5c44a10f86e5e59)

Author SHA1 Message Date
Andy Wilkinson ce99db1902 Port the build to Gradle
Closes gh-19609
Closes gh-19608
5 years ago
Stephane Nicoll 2c1e81adf0 Polish 5 years ago
Stephane Nicoll b3643965f0 Polish "Detect config props using builder pattern and generics"
See gh-19099
5 years ago
如梦技术 743f4a4cb1 Detect config props using builder pattern and generics
See gh-19099
5 years ago
Phillip Webb 26ff18f37d Merge branch '2.1.x' into 2.2.x 5 years ago
Phillip Webb accd830dd5 Update copyright header of changed files 5 years ago
Andy Wilkinson f1af8c5510 Merge branch '2.1.x'
Closes gh-18889
5 years ago
Andy Wilkinson 59bc3c5602 Prevent recursive config props from causing a stack overflow
Previously, when the configuration properties annotation processor
encountered a property that was the same as an outer type that had
already been processed, it would fail with a stack overflow error.

This commit introduces the use of a stack to track the types that
have been processed. Types that have been seen before are skipped,
thereby preventing a failure from occurring. We do not fail upon
encountering a recursive type to allow metadata generation to
complete. At runtime, the recursive property will not cause a problem
if it is not bound.

Fixes gh-18365
5 years ago
Johnny Lim 45d85778b8 Polish
See gh-18838
5 years ago
Stephane Nicoll d6d32ec01d Polish 5 years ago
Phillip Webb 386c0a60a7 Relax @ConstructorBinding member class requirement
Update `@ConfigurationProperties` so that `@ConstructorBinding` classes
no longer need to repeat the annotation for their members.

Closes gh-18481
5 years ago
Stephane Nicoll 45f6668d03 Use @ConstructorBinding when generating meta-data
Update the configuration processor to use the newly introduced
`@ConstructorBinding` annotation to determine when meta data
should be generated from constructor parameters.

Prior to this commit, the processor had no good way to tell when
constructor parameters should be used instead of getters/setters.

Closes gh-17035
5 years ago
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
5 years ago
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
5 years ago
Stephane Nicoll 39fed4a9d9 Fix binding detection of ConfigurationProperties contributed by @Bean
This commit makes sure that a ConfigurationProperties type contributed
by a `@Bean` factory method uses properties binding regardless of the
presence of a matching constructor.

`@Bean` method makes sure the user is in control and will be responsible
of creating the instance. As a result, binding of properties will not
happen there and therefore can only happen with regular JavaBean
accessors.

Closes gh-18184
5 years ago
Andy Wilkinson 4b5ebd8505 Process all non-private methods, not just public methods
Previously, the configuration processor would ignore any
@ConfigurationProperties-annotated methods that were not public. This
prevented metadata generation for package-private @Bean methods such
as those in DataSourceConfiguration's inner-classes for DBCP2, Hikari,
and Tomcat JDBC.

This commit updates the annotation processor so that it will process
any non-private method annotated with @ConfigurationProperties.

Fixes gh-18124
5 years ago
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
5 years ago
Andy Wilkinson a4b8d2401f Merge branch '2.1.x'
Closes gh-18094
5 years ago
Andy Wilkinson abba4fa9c9 Include exception's message in message printed by AP
Fixes gh-17974
5 years ago
Andy Wilkinson b463acb10f Merge branch '2.1.x'
Closes gh-18093
5 years ago
Andy Wilkinson edcaee375f Consider @Deprecated on field when determining property's deprecation
Fixes gh-17550
5 years ago
Andy Wilkinson ab87b2a39b Polish 5 years ago
Stephane Nicoll 1c8f727864 Polish "Simplify if statements"
See gh-17785
5 years ago
SaberXu c6c3a91f8d Simplify if statements
See gh-17785
5 years ago
Phillip Webb 2cdceb92bf Polish 5 years ago
Phillip Webb 8bc780762a Merge branch '2.1.x' 5 years ago
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 5 years ago
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
5 years ago
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
5 years ago
Phillip Webb 605599138e Merge branch '2.1.x' 5 years ago
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 5 years ago
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 5 years ago
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
5 years ago
Andy Wilkinson cffc870fd6 Fix test failures on Windows
Since the move to JUnit 5, a number of tests were failing on Windows.
The majority were failing due to open file handles preventing the
clean up of the tests' temporary directory. This commit addresses
these failures by updating the tests to close JarFiles, InputStreams,
OutputStreams etc.

A change has also been made to CachingOperationInvokerTests to make
a flakey test more robust. Due to System.currentTimeMillis() being
less precise on Windows than it is on *nix platforms, the test could
fail as it would not sleep for long enough for the TTL period to have
expired.
6 years ago
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 6 years ago
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
6 years ago
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
6 years ago
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 6 years ago
Phillip Webb d306b31ce9 Merge branch '2.1.x' 6 years ago
Phillip Webb ccfbd03482 Merge branch '2.0.x' into 2.1.x 6 years ago
Phillip Webb 5fba43aa31 Merge branch '1.5.x' into 2.0.x 6 years ago
Phillip Webb 988f02d766 Merge branch '2.1.x'
Closes gh-16996
6 years ago
Phillip Webb f380ba63eb Exclude Groovy MetaClass from property meta-data
Update `TypeExcludeFilter` to exclude `groovy.lang.MetaClass`.

Closes gh-16981
6 years ago
Phillip Webb 17aaf26590 Use consistent javadoc style for annotation links
Closes gh-13920
6 years ago
Phillip Webb 1e44aba772 Fix compiler warnings and polish
Fix various compiler warnings and apply a little polish.
6 years ago
Phillip Webb 2dfd916c96 Polish 6 years ago
Stephane Nicoll 0972ef3422 Merge branch '2.1.x'
Closes gh-16451
6 years ago
Stephane Nicoll fbb5ffe0a4 Avoid infinite cycle resolving generic type that refers itself
This commit improves type resolution for a unresolved generic type that
uses itself in its upper bound declaration.

Closes gh-16451
6 years ago
Phillip Webb 2376f973f4 Merge branch '2.1.x' 6 years ago
Phillip Webb 47c6bf741d Merge branch '2.0.x' into 2.1.x 6 years ago
Phillip Webb 07c000c5b7 Merge branch '1.5.x' into 2.0.x 6 years ago
Spring Operator fb242c27d2 Use HTTPS for external links wherever possible
See gh-16276
6 years ago
Andy Wilkinson 878a635bfb Merge branch '2.1.x' 6 years ago
Andy Wilkinson 864942ad4f Merge branch '2.0.x' into 2.1.x 6 years ago
Andy Wilkinson ba4671f0ab Merge branch '1.5.x' into 2.0.x 6 years ago
Stephane Nicoll 3125f424ce Add metadata support for immutable ConfigurationProperties type
Closes gh-16071
6 years ago
Andy Wilkinson 36c1c051b8 Merge branch '2.1.x' 6 years ago
Andy Wilkinson e23f72c8b0 Merge branch '2.0.x' into 2.1.x 6 years ago
Andy Wilkinson 9fbd38ab3c Merge branch '1.5.x' into 2.0.x 6 years ago
Andy Wilkinson b828b398b5 Merge branch '2.1.x' 6 years ago
Andy Wilkinson a36aa67b52 Merge branch '2.0.x' into 2.1.x 6 years ago
Spring Operator 3e2b6ac8ed Update build and setup configuration to use HTTPS
See gh-16246
6 years ago
Andy Wilkinson 9d06d22b99 Merge branch '2.0.x' into 2.1.x 6 years ago
Andy Wilkinson d6a869fa98 Switch to Jakarta EE API dependencies where possible
Closes gh-16113
Closes gh-16112
Closes gh-16111
Closes gh-15916
Closes gh-15689
6 years ago
Stephane Nicoll 75c248dcba Move setter attribute in PropertyDescriptor proper 6 years ago
Stephane Nicoll a90c8d01a9 Polish 6 years ago
Stephane Nicoll 00a18c32ab Restructure metadata generation
This commit restructures the annotation processor to off-load most of
its logic in a PropertyDescriptor abstraction that is consumed to
generate the relevant metadata.

This has the benefit to isolate the various way properties can be
identified (java bean and lombok for now).

Closes gh-16036
6 years ago
Stephane Nicoll 99c0b4561d Polish test to request the type under test 6 years ago
Stephane Nicoll c44a1e129d Polish 6 years ago
Stephane Nicoll 8a064b0da2 Move main test annotation processor to test package 6 years ago
Stephane Nicoll 4bee913fb2 Add shared test processor
This commit adds a simple annotation processor that can be used to run
more fine grained assertions.
6 years ago
Stephane Nicoll 8773a2fed3 Polish 6 years ago
Andy Wilkinson f2e3e274a8 Merge branch '2.1.x' 6 years ago
Stephane Nicoll 34f28b4cbd Merge branch '2.1.x' 6 years ago
Stephane Nicoll 91a005f578 Resolve generic types in generated metadata
Closes gh-15850
6 years ago
Stephane Nicoll 8d1d3fb087 Polish "Avoid string concatenation inside StringBuilder append()"
Closes gh-15589
6 years ago
igor-suhorukov 59ac85d371 Avoid string concatenation inside StringBuilder append()
See gh-15589
6 years ago
dreis2211 46e59503ec Use JSONObject.putOpt in JsonConverter
Closes gh-15595
6 years ago
igor-suhorukov cbf6b330ba Simplify code by using Map computeIfAbsent
Closes gh-15543
6 years ago
Phillip Webb f3fa20b2d1 Polish 6 years ago
Madhura Bhave f0004c4ade Merge branch '2.0.x' 6 years ago
dreis2211 5c0d7f4ac0 Avoid creation of unnecessary collections
Closes gh-14916
6 years ago
Phillip Webb d76bba5e6f Migrate from ExpectedException rule to AssertJ
Replace ExpectedException JUnit rules with AssertJ exception
assertions.

Closes gh-14336
6 years ago
durigon 7aaeefbc0e Use Matcher from pre-compiled Pattern rather than String for replaceAll
Closes gh-14483
6 years ago
Stephane Nicoll 0493355241 Use deterministic order for configuration properties metadata
This commit updates the annotation processor to write metadata in a
consistent way. Groups, properties and hints are written and each item
is ordered alphabetically based on its name.

Also, deprecated items are written last.

Closes gh-14347
6 years ago
Andy Wilkinson 8ee4775820 Polish 6 years ago
Stephane Nicoll c0e45b7333 Adapt to Spring Framework API change 6 years ago
Stephane Nicoll 91af9e2ca9 Merge branch '2.0.x' 6 years ago
Stephane Nicoll d80ed27339 Fix checkstyle violation 6 years ago
Stephane Nicoll b26dedb547 Merge branch '2.0.x' 6 years ago
dreis2211 0bc66dc4a9 Replace loops with Arrays.setAll where possible
See gh-14125
6 years ago
dreis2211 a601bc863b Remove unused method in TypeUtils
Closes gh-14130
6 years ago
Stephane Nicoll 8f2ab952f5 Polish javadoc formatting 6 years ago
Stephane Nicoll 94013aaba6 Add support for DataSize
This commit adds support for Spring Framework's `DataSize` allowing to
express a size in bytes and other convenient units.

Similar to the `Duration` support introduced previously, this commit
adds transparent binding support as well as detection of default values
in `@ConfigurationProperties`-annotated object.

Closes gh-13974
6 years ago
Johnny Lim 05a7d21305 Polish ItemMetadata.buildName()
Closes gh-14024
6 years ago
dreis2211 66b1742f96 Optimize some StringBuilder.append() calls
Closes gh-13961
6 years ago
Phillip Webb aeb885192e Polish ternary expressions 6 years ago
Phillip Webb 63b609827e Fix checkstyle method order issues
Fix checkstyle issues with method ordering following the
spring-javaformat upgrade.

See gh-13932
6 years ago
Phillip Webb e6a68b39a3 Fix checkstyle javadoc issues
Fix checkstyle issues in javadoc following the spring-javaformat
upgrade.

See gh-13932
6 years ago
Phillip Webb 7fc455654a Fix checkstyle ternary issues
Fix checkstyle issues with ternary expressions following the
spring-javaformat upgrade.

See gh-13932
6 years ago
Stephane Nicoll ffe994335e Merge branch '1.5.x' into 2.0.x 6 years ago
Stephane Nicoll 174cc2bc4e Merge branch '1.5.x' into 2.0.x 6 years ago
dreis2211 ac8eebfbad Fix typos
Closes gh-13762
6 years ago
Stephane Nicoll 9e9e746554 Merge branch '1.5.x' into 2.0.x 7 years ago
Johnny Lim f34fb5f1ee Reduce object creation in findMatchingItemMetadata()
Closes gh-13473
7 years ago
Johnny Lim f385a1cb11 Polish
Closes gh-13243
7 years ago
Phillip Webb 6d8b4710d7 Merge branch '1.5.x' into 2.0.x 7 years ago
Stephane Nicoll 7b7e802129 Merge branch '1.5.x' into 2.0.x 7 years ago
Phillip Webb 5b3cb8a698 Update copyright header year for changed files 7 years ago
Phillip Webb 6e09e497f2 Formatting 7 years ago
Phillip Webb 41efea51a7 Polish ternary expressions
Consistently format ternary expressions and always favor `!=` as the
the check.
7 years ago
Phillip Webb e125085993 Merge branch '1.5.x' into 2.0.x 7 years ago
Stephane Nicoll 79c222da78 Allow to provide manual metadata for keys that are not unique
Closes gh-12193
7 years ago
Stephane Nicoll 782d8c63da Merge branch '1.5.x' into 2.0.x 7 years ago
Phillip Webb 685babc829 Polish "Use lambdas for map entry iteration where possible"
Closes gh-12626
7 years ago
igor-suhorukov 69bc19e0ca Use lambdas for map entry iteration where possible
See gh-12626
7 years ago
Madhura Bhave 8b29823885 Prevent StackOverFlowException in metadata processor
Fixes gh-11037
7 years ago
Phillip Webb a4b0be089d Polish 7 years ago
dreis2211 0d3f3e46dd Fix typos
Closes gh-12468
7 years ago
Stephane Nicoll 7d1faa1c88 Ignore static and abstract accessors
This commit updates the annotation processor and the binder to ignore
any static or abstract method that has the characteristics of a JavaBean
accessor. As a result, no property is generated for those (invalid)
accessor and no binding occurs on them either.

Closes gh-12390
7 years ago
igor-suhorukov 56cbc65e7b Polish
See gh-12236
7 years ago
Phillip Webb 29c3be3590 Polish 7 years ago
igor-suhorukov 98f4692c62 Polish
This commit changes invocations to immediately return the expression
instead of assigning it to a temporary variable. The method name should
be sufficient for callers to know exactly what will be returned.

Closes gh-12211
7 years ago
Stephane Nicoll 3fddfee65c Fix default value of endpoint's cache ttl
Closes gh-12173
7 years ago
igor-suhorukov fe023817c7 Polish static finals
Closes gh-12083
7 years ago
Johnny Lim 88b184ca23 Polish 7 years ago
Andy Wilkinson 76a450dfba Format with Eclipse Oxygen SR2 7 years ago
Johnny Lim 3cead7693d Polish
Closes gh-11871
7 years ago
Phillip Webb 187c4d728c Merge branch '1.5.x' 7 years ago
Stephane Nicoll 51c307f643 Merge branch '1.5.x' 7 years ago
Phillip Webb af50a18da9 Polish 7 years ago
Stephane Nicoll 5e26d04c05 Only generate time-to-live property for matching endpoints
This commit makes sure that a "cache.time-to-live" property is not
generated for endpoints that do not have a main read operation (i.e. a
read operation with no parameter or only nullable parameters).

This matches the endpoint feature that provides caching for only such
operation.

Closes gh-11703
7 years ago
Phillip Webb b234501af3 Polish 7 years ago
igor-suhorukov 093ca0a687 Use EnumMap whenever possible
Replace regular Map instances with EnumMap to reduce memory consumption.

Closes gh-11760
7 years ago
Phillip Webb ab6ad6aa4b Polish 7 years ago
andrey.onufreyko b19dcb13e2 Replace string arguments with char
Optimize method calls by replacing single character String arguments
with char.

Closes gh-11680
7 years ago
dreis2211 b7e663e820 Polish
Closes gh-11724
7 years ago
Phillip Webb f3379668ac Polish 7 years ago
Phillip Webb 6d93573db0 Merge branch '1.5.x' 7 years ago
Stephane Nicoll ba6be4f22f Merge branch '1.5.x' 7 years ago
Stephane Nicoll 49b5fe0c29 Polish
As `validation-api` 2 is available by default, this commit adds the
integration test as a regular test case. The integration test is kept to
exercise what happens in a standard project.

See gh-11512
7 years ago
Stephane Nicoll 60f5cf10ba Merge branch '1.5.x' 7 years ago
Andy Wilkinson 54c0cf513b Polish 7 years ago
Stephane Nicoll f8af6c8134 Merge branch '1.5.x' 7 years ago
Johnny Lim 77150f8dc9 Polish
Closes gh-11630
7 years ago
Phillip Webb 87bccb96f1 Merge branch '1.5.x' 7 years ago
Stephane Nicoll 66d58294d5 Merge branch '1.5.x' 7 years ago
Stephane Nicoll f2d3f51f3f Merge branch '1.5.x' 7 years ago
Stephane Nicoll ac004eabf3 Update copyright header
See gh-11510
7 years ago
Johnny Lim 37d8eedae3 Polish
Closes gh-11510
7 years ago
Stephane Nicoll 03dd53f347 Fix broken merge 7 years ago
Stephane Nicoll e3bfd797a3 Merge branch '1.5.x' 7 years ago
Madhura Bhave 8102dc78cb Remove redundant throws declarations 7 years ago
Johnny Lim 3c5ccb1166 Polish
Closes gh-11418
7 years ago
Phillip Webb 3273859fde Polish 7 years ago
Stephane Nicoll a626f5462d Consistent use of @AliasFor
Closes gh-10836
7 years ago
Stephane Nicoll b6aa0f24e2 Clean endpointIds in generated metadata
Closes gh-11107
7 years ago
Stephane Nicoll 7f2af8b209 Polish 7 years ago
Stephane Nicoll 23218add90 Polish 7 years ago
Andy Wilkinson aa9c5e6e08 Align expectation with new endpoint enabled property description
See gh-10870
7 years ago
Phillip Webb e82913dd5a Align appendix edits with source code
Port editing changes from append to java source files to ensure that
IDE meta-data also reflects the improvements.

Closes gh-10870
7 years ago
Phillip Webb cbaf0fa686 Support Duration in generated meta-data
Update the configuration properties annotation processor to deal
with `Duration` based default values. For example a field that
defaults to `Duration.ofSeconds(10)` will have a meta-data default
value of `10s`.

See gh-11080
7 years ago
Johnny Lim 1783a072ad Remove explicit constructor super() calls
Closes gh-11068
7 years ago
dreis2211 1e4941e29a Use StandardCharsets where possible
Closes gh-11036
7 years ago
Stephane Nicoll bcab23e538 Polish "Separate endpoint concerns"
* Fix the endpoint prefix for generated metadata.
* Polish and improve configuration key descriptions.

Closes gh-10176
7 years ago
Phillip Webb fd5c43cdc9 Separate endpoint concerns
Update endpoint code to provide cleaner separation of concerns.
Specifically, the top level endpoint package is no longer aware of
the fact that JMX and HTTP are ultimately used to expose endpoints.
Caching concerns have also been abstracted behind a general purpose
`OperationMethodInvokerAdvisor` interface.

Configuration properties have been refined to further enforce
separation. The `management.endpoint.<name>` prefix provides
configuration for a  single endpoint (including enable and cache
time-to-live). These  properties are now technology agnostic (they
don't include `web` or `jmx` sub properties).

The `management.endpoints.<technology>` prefix provide exposure specific
configuration. For example, `management.endpoints.web.path-mapping`
allow endpoint URLs to be changed.

Endpoint enabled/disabled logic has been simplified so that endpoints
can't be disabled per exposure technology. Instead a filter based
approach is used to allow refinement of what endpoints are exposed over
a given technology.

Fixes gh-10176
7 years ago
Johnny Lim bd0dcfb172 Utilize StandardCharsets
Closes gh-10972
7 years ago
Phillip Webb c55b5d7111 Polish 7 years ago
Andy Wilkinson 6f55b57855 Make discovery of additional config metdata more robust with Gradle
Previously, the configuration metadata annotation processor relied
upon an additional metadata file have been copied to an output
location. When building with Gradle, it's the processResources task
that performs this copy and there is no guarantee that it will have
run before the compileJava task unless an explicit dependency betwee
the two tasks has been configured. If a project is built using
Gradle's parallel build support, the likelihood of this required
ordering not occurring increases.

This commit updates the configuration metadata annotation processor to
consider a new annotation processor option when looking for the
additional config metadata file. The Gradle plugin has been updated
to provide this option as a compiler argument. The option is only
provided when the annotation processor is found on the compilation
classpath to avoid a warning from javac's annotation processing about
the use of an option that is not supported by any of the available
annotation processors.

Closes gh-9755
7 years ago
Stephane Nicoll 56afc25304 Allow to customize the path of a web endpoint
This commit introduces a endpoints.<id>.web.path generic property that
allows to customize the path of an endpoint. By default the path is the
same as the id of the endpoint.

Such customization does not apply for the CloudFoundry specific
endpoints.

Closes gh-10181
7 years ago
Andy Wilkinson 2b426c30a6 Polish “Remove explicit type arguments”
Closes gh-10494
7 years ago
Johnny Lim 6168fae720 Remove explicit type arguments
See gh-10494
7 years ago
Johnny Lim 5aa32b3d0f Polish
Closes gh-10636
7 years ago
Phillip Webb 748e0779b6 Update copyright year for changed files 7 years ago
Phillip Webb b87f9c11f1 Fix POMs for the updated build/release process
Fix POMs following project relocations and apply CI friendly Maven
conventions.

See gh-9316
7 years ago
Phillip Webb 0ba4830b4f Relocate projects to spring-boot-project
Move projects to better reflect the way that Spring Boot is released.

The following projects are under `spring-boot-project`:

  - `spring-boot`
  - `spring-boot-autoconfigure`
  - `spring-boot-tools`
  - `spring-boot-starters`
  - `spring-boot-actuator`
  - `spring-boot-actuator-autoconfigure`
  - `spring-boot-test`
  - `spring-boot-test-autoconfigure`
  - `spring-boot-devtools`
  - `spring-boot-cli`
  - `spring-boot-docs`

See gh-9316
7 years ago