Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
22157091
Commit
22157091
authored
May 26, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.0.x'
parents
5626b7a5
6f0ccc64
Changes
33
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
173 additions
and
1147 deletions
+173
-1147
CONTRIBUTING.adoc
CONTRIBUTING.adoc
+22
-35
eclipse-code-formatter.xml
eclipse/eclipse-code-formatter.xml
+0
-315
org.eclipse.jdt.core.prefs
eclipse/org.eclipse.jdt.core.prefs
+0
-412
org.eclipse.jdt.ui.prefs
eclipse/org.eclipse.jdt.ui.prefs
+0
-125
spring-boot-project.setup
eclipse/spring-boot-project.setup
+2
-2
eclipse.properties
spring-boot-dependencies/.eclipse/eclipse.properties
+1
-0
MetricsProperties.java
...boot/actuate/autoconfigure/metrics/MetricsProperties.java
+4
-3
EndpointRequestTests.java
...autoconfigure/security/reactive/EndpointRequestTests.java
+2
-1
EndpointRequestTests.java
.../autoconfigure/security/servlet/EndpointRequestTests.java
+2
-1
KafkaProperties.java
...ngframework/boot/autoconfigure/kafka/KafkaProperties.java
+1
-0
JpaProperties.java
...ngframework/boot/autoconfigure/orm/jpa/JpaProperties.java
+1
-1
DefaultErrorWebExceptionHandler.java
...e/web/reactive/error/DefaultErrorWebExceptionHandler.java
+3
-4
DispatcherServletAutoConfigurationTests.java
.../web/servlet/DispatcherServletAutoConfigurationTests.java
+3
-3
pom.xml
spring-boot-project/spring-boot-parent/pom.xml
+22
-25
checkstyle.xml
...-project/spring-boot-parent/src/checkstyle/checkstyle.xml
+3
-166
pom.xml
...t/spring-boot-starters/spring-boot-starter-parent/pom.xml
+19
-0
ServletContextInitializerBeans.java
...work/boot/web/servlet/ServletContextInitializerBeans.java
+1
-1
SimpleMainTests.java
...c/test/java/org/springframework/boot/SimpleMainTests.java
+4
-4
BindConverterTests.java
...work/boot/context/properties/bind/BindConverterTests.java
+1
-2
pom.xml
spring-boot-samples/pom.xml
+42
-14
ManagementPortAndPathSampleActuatorApplicationTests.java
.../ManagementPortAndPathSampleActuatorApplicationTests.java
+2
-2
SampleAntApplicationIT.java
...-ant/src/test/java/sample/ant/SampleAntApplicationIT.java
+4
-4
MessageController.java
...junit-jupiter/src/main/java/sample/MessageController.java
+0
-3
application.properties
...ot-sample-kafka/src/main/resources/application.properties
+1
-1
SampleJob.java
...-sample-quartz/src/main/java/sample/quartz/SampleJob.java
+0
-4
SampleSecureWebFluxApplication.java
...sample/secure/webflux/SampleSecureWebFluxApplication.java
+3
-4
application.properties
...-secure-webflux/src/main/resources/application.properties
+1
-1
SampleSecureWebFluxCustomSecurityTests.java
...ecure/webflux/SampleSecureWebFluxCustomSecurityTests.java
+8
-8
application.properties
...-sample-servlet/src/main/resources/application.properties
+1
-1
application.properties
...session-webflux/src/main/resources/application.properties
+1
-1
ExampleController.java
...bflux/src/main/java/sample/webflux/ExampleController.java
+16
-0
SampleWebFluxApplication.java
...rc/main/java/sample/webflux/SampleWebFluxApplication.java
+3
-4
application.properties
...-sample-webflux/src/main/resources/application.properties
+0
-0
No files found.
CONTRIBUTING.adoc
View file @
22157091
...
@@ -47,12 +47,14 @@ given the ability to merge pull requests.
...
@@ -47,12 +47,14 @@ given the ability to merge pull requests.
None of these is essential for a pull request, but they will all help. They can also be
None of these is essential for a pull request, but they will all help. They can also be
added after the original pull request but before a merge.
added after the original pull request but before a merge.
* Use the Spring Framework code format conventions. If you use Eclipse and you follow
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project
the '`Importing into eclipse`' instructions below you should get project specific
to apply code formatting conventions. If you use Eclipse and you follow the '`Importing
formatting automatically. You can also import formatter settings using the
into eclipse`' instructions below you should get project specific formatting
`eclipse-code-formatter.xml` file from the `eclipse` folder. If using IntelliJ IDEA, you
automatically. You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin]
can use the http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter Plugin]
or format the code from the Maven build by running
to import the same file.
`./mvnw io.spring.javaformat:spring-javaformat-maven-plugin:apply`.
* The build includes checkstyle rules for many of our code conventions. Run
`./mvnw validate` if you want to check you changes are compliant.
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
* Make sure all new `.java` files to have a simple Javadoc class comment with at least an
`@author` tag identifying you, and preferably at least a paragraph on what the class is
`@author` tag identifying you, and preferably at least a paragraph on what the class is
for.
for.
...
@@ -80,13 +82,15 @@ should also work without issue.
...
@@ -80,13 +82,15 @@ should also work without issue.
=== Building from Source
=== Building from Source
To build the source you will need to install
Spring Boot source can be build from the command line using
https://maven.apache.org/run-maven/index.html[Apache Maven] v3.2.3 or above and JDK 1.8.
http://maven.apache.org/run-maven/index.html[Apache Maven] on JDK 1.8 or above.
We include '`Maven Wrapper`' scripts (`./mvnw` or `mvnw.bat`) that you can run rather
than needing to install Maven locally.
==== Default Build
==== Default Build
The project can be built from the root directory using the standard
m
aven command:
The project can be built from the root directory using the standard
M
aven command:
[indent=0]
[indent=0]
----
----
...
@@ -134,9 +138,9 @@ can run this from the top-level directory:
...
@@ -134,9 +138,9 @@ can run this from the top-level directory:
=== Importing into Eclipse
=== Importing into Eclipse
You can import the Spring Boot code into any Eclipse
Mars
based distribution. The easiest
You can import the Spring Boot code into any Eclipse
Oxygen
based distribution. The easiest
way to setup a new environment is to use the Eclipse Installer with the provided
way to setup a new environment is to use the Eclipse Installer with the provided
`.setup` file.
`.setup` file
(in the `/eclipse` folder)
.
==== Using the Eclipse Installer
==== Using the Eclipse Installer
...
@@ -165,24 +169,21 @@ easier to navigate.
...
@@ -165,24 +169,21 @@ easier to navigate.
==== Manual Installation with M2Eclipse
==== Manual Installation with M2Eclipse
If you prefer to install Eclipse yourself
we recommend that you
use the
If you prefer to install Eclipse yourself
you should
use the
http://eclipse.org/m2e/[M2Eclipse] eclipse plugin. If you don't already have m2eclipse
http://eclipse.org/m2e/[M2Eclipse] eclipse plugin. If you don't already have m2eclipse
installed it is available from the "Eclipse marketplace".
installed it is available from the "Eclipse marketplace".
Spring Boot includes project specific source formatting settings, in order to have these
Spring Boot includes project specific source formatting settings, in order to have these
work with m2eclipse, we provide additional Eclipse plugins that you can install:
work with m2eclipse, we provide an additional Eclipse plugin that you can install:
===== Install the m2eclipse-maveneclipse plugin
* Select "`Help`" -> "`Install New Software`".
* Add `https://dl.bintray.com/philwebb/m2eclipse-maveneclipse` as a site.
* Install "Maven Integration for the maven-eclipse-plugin"
===== Install the Spring Formatter plugin
===== Install the Spring Formatter plugin
* Select "`Help`" -> "`Install New Software`".
* Select "`Help`" -> "`Install New Software`".
* Add `https://dl.bintray.com/
philwebb/spring-eclipse-code-formatter
/` as a site.
* Add `https://dl.bintray.com/
spring/javaformat-eclipse
/` as a site.
* Install "Spring
Code Formatter
"
* Install "Spring
Java Format
"
NOTE: The
se plugins are
optional. Projects can be imported without the plugins, your code
NOTE: The
plugin is
optional. Projects can be imported without the plugins, your code
changes just won't be automatically formatted.
changes just won't be automatically formatted.
With the requisite eclipse plugins installed you can select
With the requisite eclipse plugins installed you can select
...
@@ -191,20 +192,6 @@ need to import the root `spring-boot` pom and the `spring-boot-samples` pom sepa
...
@@ -191,20 +192,6 @@ need to import the root `spring-boot` pom and the `spring-boot-samples` pom sepa
==== Importing into Eclipse without M2Eclipse
If you prefer not to use m2eclipse you can generate eclipse project metadata using the
following command:
[indent=0]
----
$ ./mvnw eclipse:eclipse
----
The generated eclipse projects can be imported by selecting `import existing projects`
from the `file` menu.
=== Importing into Other IDEs
=== Importing into Other IDEs
Maven is well supported by most Java IDEs. Refer to your vendor documentation.
Maven is well supported by most Java IDEs. Refer to your vendor documentation.
...
@@ -212,7 +199,7 @@ Maven is well supported by most Java IDEs. Refer to your vendor documentation.
...
@@ -212,7 +199,7 @@ Maven is well supported by most Java IDEs. Refer to your vendor documentation.
== Integration Tests
== Integration Tests
The sample applications are used as integration tests during the build (when you
The sample applications are used as integration tests during the build (when you
`
mvn
install`). Due to the fact that they make use of the `spring-boot-maven-plugin`
`
./mvnw
install`). Due to the fact that they make use of the `spring-boot-maven-plugin`
they cannot be called directly, and so instead are launched via the
they cannot be called directly, and so instead are launched via the
`maven-invoker-plugin`. If you encounter build failures running the integration tests,
`maven-invoker-plugin`. If you encounter build failures running the integration tests,
check the `build.log` file in the appropriate sample directory.
check the `build.log` file in the appropriate sample directory.
...
...
eclipse/eclipse-code-formatter.xml
deleted
100644 → 0
View file @
5626b7a5
This diff is collapsed.
Click to expand it.
eclipse/org.eclipse.jdt.core.prefs
deleted
100644 → 0
View file @
5626b7a5
This diff is collapsed.
Click to expand it.
eclipse/org.eclipse.jdt.ui.prefs
deleted
100644 → 0
View file @
5626b7a5
This diff is collapsed.
Click to expand it.
eclipse/spring-boot-project.setup
View file @
22157091
...
@@ -63,7 +63,7 @@
...
@@ -63,7 +63,7 @@
<requirement
<requirement
name=
"AnyEditTools.feature.group"
/>
name=
"AnyEditTools.feature.group"
/>
<requirement
<requirement
name=
"
org.eclipse.m2e.maven
eclipse.feature.feature.group"
/>
name=
"
io.spring.javaformat.
eclipse.feature.feature.group"
/>
<requirement
<requirement
name=
"org.eclipse.jst.server_adapters.feature.feature.group"
/>
name=
"org.eclipse.jst.server_adapters.feature.feature.group"
/>
<requirement
<requirement
...
@@ -87,7 +87,7 @@
...
@@ -87,7 +87,7 @@
<repository
<repository
url=
"http://andrei.gmxhome.de/eclipse/"
/>
url=
"http://andrei.gmxhome.de/eclipse/"
/>
<repository
<repository
url=
"https://dl.bintray.com/
philwebb/m2eclipse-maveneclipse
"
/>
url=
"https://dl.bintray.com/
spring/javaformat-eclipse/
"
/>
<repository
<repository
url=
"http://download.eclipse.org/egit/github/updates/"
/>
url=
"http://download.eclipse.org/egit/github/updates/"
/>
<repository
<repository
...
...
spring-boot-dependencies/.eclipse/eclipse.properties
0 → 100644
View file @
22157091
copyright-year
=
2012-2018
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MetricsProperties.java
View file @
22157091
...
@@ -167,9 +167,10 @@ public class MetricsProperties {
...
@@ -167,9 +167,10 @@ public class MetricsProperties {
/**
/**
* Whether meter IDs starting with the specified name should publish percentile
* Whether meter IDs starting with the specified name should publish percentile
* histograms. For monitoring systems that support aggregable percentile calculation
* histograms. For monitoring systems that support aggregable percentile
* based on a histogram, this can be set to true. For other systems, this has no effect. The
* calculation based on a histogram, this can be set to true. For other systems,
* longest match wins, the key `all` can also be used to configure all meters.
* this has no effect. The longest match wins, the key `all` can also be used to
* configure all meters.
*/
*/
private
Map
<
String
,
Boolean
>
percentilesHistogram
=
new
LinkedHashMap
<>();
private
Map
<
String
,
Boolean
>
percentilesHistogram
=
new
LinkedHashMap
<>();
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java
View file @
22157091
...
@@ -123,7 +123,8 @@ public class EndpointRequestTests {
...
@@ -123,7 +123,8 @@ public class EndpointRequestTests {
endpoints
.
add
(
mockEndpoint
(
"foo"
,
"foo"
));
endpoints
.
add
(
mockEndpoint
(
"foo"
,
"foo"
));
endpoints
.
add
(
mockEndpoint
(
"bar"
,
"bar"
));
endpoints
.
add
(
mockEndpoint
(
"bar"
,
"bar"
));
endpoints
.
add
(
mockEndpoint
(
"baz"
,
"baz"
));
endpoints
.
add
(
mockEndpoint
(
"baz"
,
"baz"
));
PathMappedEndpoints
pathMappedEndpoints
=
new
PathMappedEndpoints
(
"/actuator"
,
()
->
endpoints
);
PathMappedEndpoints
pathMappedEndpoints
=
new
PathMappedEndpoints
(
"/actuator"
,
()
->
endpoints
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/foo"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/foo"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/baz"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/baz"
);
assertMatcher
(
matcher
).
matches
(
"/actuator/bar"
);
assertMatcher
(
matcher
).
matches
(
"/actuator/bar"
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java
View file @
22157091
...
@@ -145,7 +145,8 @@ public class EndpointRequestTests {
...
@@ -145,7 +145,8 @@ public class EndpointRequestTests {
endpoints
.
add
(
mockEndpoint
(
"foo"
,
"foo"
));
endpoints
.
add
(
mockEndpoint
(
"foo"
,
"foo"
));
endpoints
.
add
(
mockEndpoint
(
"bar"
,
"bar"
));
endpoints
.
add
(
mockEndpoint
(
"bar"
,
"bar"
));
endpoints
.
add
(
mockEndpoint
(
"baz"
,
"baz"
));
endpoints
.
add
(
mockEndpoint
(
"baz"
,
"baz"
));
PathMappedEndpoints
pathMappedEndpoints
=
new
PathMappedEndpoints
(
"/actuator"
,
()
->
endpoints
);
PathMappedEndpoints
pathMappedEndpoints
=
new
PathMappedEndpoints
(
"/actuator"
,
()
->
endpoints
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/foo"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/foo"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/baz"
);
assertMatcher
(
matcher
,
pathMappedEndpoints
).
doesNotMatch
(
"/actuator/baz"
);
assertMatcher
(
matcher
).
matches
(
"/actuator/bar"
);
assertMatcher
(
matcher
).
matches
(
"/actuator/bar"
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
View file @
22157091
...
@@ -949,6 +949,7 @@ public class KafkaProperties {
...
@@ -949,6 +949,7 @@ public class KafkaProperties {
"Resource '"
+
resource
+
"' must be on a file system"
,
ex
);
"Resource '"
+
resource
+
"' must be on a file system"
,
ex
);
}
}
}
}
}
}
public
static
class
Jaas
{
public
static
class
Jaas
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java
View file @
22157091
...
@@ -244,7 +244,7 @@ public class JpaProperties {
...
@@ -244,7 +244,7 @@ public class JpaProperties {
if
(
ddlAuto
!=
null
)
{
if
(
ddlAuto
!=
null
)
{
return
ddlAuto
;
return
ddlAuto
;
}
}
return
this
.
ddlAuto
!=
null
?
this
.
ddlAuto
:
defaultDdlAuto
.
get
(
);
return
(
this
.
ddlAuto
!=
null
?
this
.
ddlAuto
:
defaultDdlAuto
.
get
()
);
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandler.java
View file @
22157091
...
@@ -125,10 +125,9 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
...
@@ -125,10 +125,9 @@ public class DefaultErrorWebExceptionHandler extends AbstractErrorWebExceptionHa
.
just
(
"error/"
+
errorStatus
.
toString
(),
.
just
(
"error/"
+
errorStatus
.
toString
(),
"error/"
+
SERIES_VIEWS
.
get
(
errorStatus
.
series
()),
"error/error"
)
"error/"
+
SERIES_VIEWS
.
get
(
errorStatus
.
series
()),
"error/error"
)
.
flatMap
((
viewName
)
->
renderErrorView
(
viewName
,
responseBody
,
error
))
.
flatMap
((
viewName
)
->
renderErrorView
(
viewName
,
responseBody
,
error
))
.
switchIfEmpty
(
.
switchIfEmpty
(
this
.
errorProperties
.
getWhitelabel
().
isEnabled
()
this
.
errorProperties
.
getWhitelabel
().
isEnabled
()
?
renderDefaultErrorView
(
responseBody
,
error
)
?
renderDefaultErrorView
(
responseBody
,
error
)
:
Mono
.
error
(
getError
(
request
)))
:
Mono
.
error
(
getError
(
request
)))
.
next
().
doOnNext
((
response
)
->
logError
(
request
,
errorStatus
));
.
next
().
doOnNext
((
response
)
->
logError
(
request
,
errorStatus
));
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/DispatcherServletAutoConfigurationTests.java
View file @
22157091
...
@@ -72,7 +72,8 @@ public class DispatcherServletAutoConfigurationTests {
...
@@ -72,7 +72,8 @@ public class DispatcherServletAutoConfigurationTests {
// from the default one, we're registering one anyway
// from the default one, we're registering one anyway
@Test
@Test
public
void
registrationOverrideWithDispatcherServletWrongName
()
{
public
void
registrationOverrideWithDispatcherServletWrongName
()
{
this
.
contextRunner
.
withUserConfiguration
(
CustomDispatcherServletDifferentName
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
CustomDispatcherServletDifferentName
.
class
)
.
run
((
context
)
->
{
.
run
((
context
)
->
{
ServletRegistrationBean
<?>
registration
=
context
ServletRegistrationBean
<?>
registration
=
context
.
getBean
(
ServletRegistrationBean
.
class
);
.
getBean
(
ServletRegistrationBean
.
class
);
...
@@ -89,8 +90,7 @@ public class DispatcherServletAutoConfigurationTests {
...
@@ -89,8 +90,7 @@ public class DispatcherServletAutoConfigurationTests {
.
run
((
context
)
->
{
.
run
((
context
)
->
{
ServletRegistrationBean
<?>
registration
=
context
ServletRegistrationBean
<?>
registration
=
context
.
getBean
(
ServletRegistrationBean
.
class
);
.
getBean
(
ServletRegistrationBean
.
class
);
assertThat
(
registration
.
getUrlMappings
())
assertThat
(
registration
.
getUrlMappings
()).
containsExactly
(
"/foo"
);
.
containsExactly
(
"/foo"
);
assertThat
(
registration
.
getServletName
())
assertThat
(
registration
.
getServletName
())
.
isEqualTo
(
"customDispatcher"
);
.
isEqualTo
(
"customDispatcher"
);
assertThat
(
context
).
hasSingleBean
(
DispatcherServlet
.
class
);
assertThat
(
context
).
hasSingleBean
(
DispatcherServlet
.
class
);
...
...
spring-boot-project/spring-boot-parent/pom.xml
View file @
22157091
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
...
@@ -25,6 +26,7 @@
...
@@ -25,6 +26,7 @@
<aether.version>
1.0.2.v20150114
</aether.version>
<aether.version>
1.0.2.v20150114
</aether.version>
<maven.version>
3.1.1
</maven.version>
<maven.version>
3.1.1
</maven.version>
<spock.version>
1.0-groovy-2.4
</spock.version>
<spock.version>
1.0-groovy-2.4
</spock.version>
<spring-javaformat.version>
0.0.1
</spring-javaformat.version>
</properties>
</properties>
<scm>
<scm>
<url>
http://github.com/spring-projects/spring-boot
</url>
<url>
http://github.com/spring-projects/spring-boot
</url>
...
@@ -310,7 +312,12 @@
...
@@ -310,7 +312,12 @@
<dependency>
<dependency>
<groupId>
com.puppycrawl.tools
</groupId>
<groupId>
com.puppycrawl.tools
</groupId>
<artifactId>
checkstyle
</artifactId>
<artifactId>
checkstyle
</artifactId>
<version>
8.5
</version>
<version>
8.8
</version>
</dependency>
<dependency>
<groupId>
io.spring.javaformat
</groupId>
<artifactId>
spring-javaformat-checkstyle
</artifactId>
<version>
${spring-javaformat.version}
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
</plugin>
</plugin>
...
@@ -567,6 +574,19 @@
...
@@ -567,6 +574,19 @@
</execution>
</execution>
</executions>
</executions>
</plugin>
</plugin>
<plugin>
<groupId>
io.spring.javaformat
</groupId>
<artifactId>
spring-javaformat-maven-plugin
</artifactId>
<version>
${spring-javaformat.version}
</version>
<executions>
<execution>
<phase>
validate
</phase>
<goals>
<goal>
validate
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
...
@@ -575,14 +595,8 @@
...
@@ -575,14 +595,8 @@
<id>
checkstyle-validation
</id>
<id>
checkstyle-validation
</id>
<phase>
validate
</phase>
<phase>
validate
</phase>
<configuration>
<configuration>
<skip>
${disable.checks}
</skip>
<configLocation>
src/checkstyle/checkstyle.xml
</configLocation>
<configLocation>
src/checkstyle/checkstyle.xml
</configLocation>
<suppressionsLocation>
src/checkstyle/checkstyle-suppressions.xml
</suppressionsLocation>
<suppressionsLocation>
src/checkstyle/checkstyle-suppressions.xml
</suppressionsLocation>
<headerLocation>
src/checkstyle/checkstyle-header.txt
</headerLocation>
<propertyExpansion>
main.basedir=${main.basedir}
</propertyExpansion>
<encoding>
UTF-8
</encoding>
<consoleOutput>
true
</consoleOutput>
<failOnViolation>
true
</failOnViolation>
<includeTestSourceDirectory>
true
</includeTestSourceDirectory>
<includeTestSourceDirectory>
true
</includeTestSourceDirectory>
</configuration>
</configuration>
<goals>
<goals>
...
@@ -600,23 +614,6 @@
...
@@ -600,23 +614,6 @@
<parameters>
true
</parameters>
<parameters>
true
</parameters>
</configuration>
</configuration>
</plugin>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-eclipse-plugin
</artifactId>
<configuration>
<useProjectReferences>
false
</useProjectReferences>
<additionalConfig>
<file>
<name>
.settings/org.eclipse.jdt.ui.prefs
</name>
<location>
${main.basedir}/eclipse/org.eclipse.jdt.ui.prefs
</location>
</file>
<file>
<name>
.settings/org.eclipse.jdt.core.prefs
</name>
<location>
${main.basedir}/eclipse/org.eclipse.jdt.core.prefs
</location>
</file>
</additionalConfig>
</configuration>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-enforcer-plugin
</artifactId>
<artifactId>
maven-enforcer-plugin
</artifactId>
...
...
spring-boot-project/spring-boot-parent/src/checkstyle/checkstyle.xml
View file @
22157091
This diff is collapsed.
Click to expand it.
spring-boot-project/spring-boot-starters/spring-boot-starter-parent/pom.xml
View file @
22157091
...
@@ -249,6 +249,25 @@
...
@@ -249,6 +249,25 @@
<ignore></ignore>
<ignore></ignore>
</action>
</action>
</pluginExecution>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<versionRange>
[3.0.0,)
</versionRange>
<goals>
<goal>
check
</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</pluginExecutions>
</lifecycleMappingMetadata>
</lifecycleMappingMetadata>
</configuration>
</configuration>
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/ServletContextInitializerBeans.java
View file @
22157091
...
@@ -81,7 +81,7 @@ public class ServletContextInitializerBeans
...
@@ -81,7 +81,7 @@ public class ServletContextInitializerBeans
addAdaptableBeans
(
beanFactory
);
addAdaptableBeans
(
beanFactory
);
List
<
ServletContextInitializer
>
sortedInitializers
=
this
.
initializers
.
values
()
List
<
ServletContextInitializer
>
sortedInitializers
=
this
.
initializers
.
values
()
.
stream
()
.
stream
()
.
flatMap
(
value
->
value
.
stream
()
.
flatMap
(
(
value
)
->
value
.
stream
()
.
sorted
(
AnnotationAwareOrderComparator
.
INSTANCE
))
.
sorted
(
AnnotationAwareOrderComparator
.
INSTANCE
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
this
.
sortedList
=
Collections
.
unmodifiableList
(
sortedInitializers
);
this
.
sortedList
=
Collections
.
unmodifiableList
(
sortedInitializers
);
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SimpleMainTests.java
View file @
22157091
...
@@ -76,10 +76,10 @@ public class SimpleMainTests {
...
@@ -76,10 +76,10 @@ public class SimpleMainTests {
}
}
private
String
[]
getArgs
(
String
...
args
)
{
private
String
[]
getArgs
(
String
...
args
)
{
List
<
String
>
list
=
new
ArrayList
<>(
Arrays
.
asList
(
List
<
String
>
list
=
new
ArrayList
<>(
"--spring.main.web-application-type=none"
,
Arrays
.
asList
(
"--spring.main.web-application-type=none"
,
"--spring.main.show-banner=OFF"
,
"--spring.main.show-banner=OFF"
,
"--spring.main.register-shutdownHook=false"
));
"--spring.main.register-shutdownHook=false"
));
if
(
args
.
length
>
0
)
{
if
(
args
.
length
>
0
)
{
list
.
add
(
"--spring.main.sources="
list
.
add
(
"--spring.main.sources="
+
StringUtils
.
arrayToCommaDelimitedString
(
args
));
+
StringUtils
.
arrayToCommaDelimitedString
(
args
));
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindConverterTests.java
View file @
22157091
...
@@ -70,8 +70,7 @@ public class BindConverterTests {
...
@@ -70,8 +70,7 @@ public class BindConverterTests {
@Test
@Test
public
void
createWhenPropertyEditorInitializerIsNullShouldCreate
()
{
public
void
createWhenPropertyEditorInitializerIsNullShouldCreate
()
{
new
BindConverter
(
new
BindConverter
(
ApplicationConversionService
.
getSharedInstance
(),
null
);
ApplicationConversionService
.
getSharedInstance
(),
null
);
}
}
@Test
@Test
...
...
spring-boot-samples/pom.xml
View file @
22157091
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
<properties>
<properties>
<main.basedir>
${basedir}/..
</main.basedir>
<main.basedir>
${basedir}/..
</main.basedir>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
<spring-javaformat.version>
0.0.1
</spring-javaformat.version>
</properties>
</properties>
<modules>
<modules>
<module>
spring-boot-sample-ant
</module>
<module>
spring-boot-sample-ant
</module>
...
@@ -173,22 +174,49 @@
...
@@ -173,22 +174,49 @@
</plugins>
</plugins>
</pluginManagement>
</pluginManagement>
<plugins>
<plugins>
<plugin>
<groupId>
io.spring.javaformat
</groupId>
<artifactId>
spring-javaformat-maven-plugin
</artifactId>
<version>
${spring-javaformat.version}
</version>
<executions>
<execution>
<phase>
validate
</phase>
<goals>
<goal>
validate
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-eclipse-plugin
</artifactId>
<artifactId>
maven-checkstyle-plugin
</artifactId>
<configuration>
<version>
3.0.0
</version>
<useProjectReferences>
false
</useProjectReferences>
<dependencies>
<additionalConfig>
<dependency>
<file>
<groupId>
com.puppycrawl.tools
</groupId>
<name>
.settings/org.eclipse.jdt.ui.prefs
</name>
<artifactId>
checkstyle
</artifactId>
<location>
${main.basedir}/eclipse/org.eclipse.jdt.ui.prefs
</location>
<version>
8.8
</version>
</file>
</dependency>
<file>
<dependency>
<name>
.settings/org.eclipse.jdt.core.prefs
</name>
<groupId>
io.spring.javaformat
</groupId>
<location>
${main.basedir}/eclipse/org.eclipse.jdt.core.prefs
</location>
<artifactId>
spring-javaformat-checkstyle
</artifactId>
</file>
<version>
${spring-javaformat.version}
</version>
</additionalConfig>
</dependency>
</configuration>
</dependencies>
<executions>
<execution>
<id>
checkstyle-validation
</id>
<phase>
validate
</phase>
<configuration>
<configLocation>
../spring-boot-parent/src/checkstyle/checkstyle.xml
</configLocation>
<suppressionsLocation>
../spring-boot-parent/src/checkstyle/checkstyle-suppressions.xml
</suppressionsLocation>
<includeTestSourceDirectory>
true
</includeTestSourceDirectory>
</configuration>
<goals>
<goal>
check
</goal>
</goals>
</execution>
</executions>
</plugin>
</plugin>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
...
...
spring-boot-samples/spring-boot-sample-actuator/src/test/java/sample/actuator/ManagementPortAndPathSampleActuatorApplicationTests.java
View file @
22157091
...
@@ -89,8 +89,8 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
...
@@ -89,8 +89,8 @@ public class ManagementPortAndPathSampleActuatorApplicationTests {
String
unknownProperty
=
"test-does-not-exist"
;
String
unknownProperty
=
"test-does-not-exist"
;
assertThat
(
this
.
environment
.
containsProperty
(
unknownProperty
)).
isFalse
();
assertThat
(
this
.
environment
.
containsProperty
(
unknownProperty
)).
isFalse
();
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
()
ResponseEntity
<
String
>
entity
=
new
TestRestTemplate
()
.
withBasicAuth
(
"user"
,
getPassword
()).
getForEntity
(
.
withBasicAuth
(
"user"
,
getPassword
()).
getForEntity
(
"http://localhost:"
"http://localhost:"
+
this
.
managementPort
+
"/admin/env/"
+
unknownProperty
,
+
this
.
managementPort
+
"/admin/env/"
+
unknownProperty
,
String
.
class
);
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
}
...
...
spring-boot-samples/spring-boot-sample-ant/src/test/java/sample/ant/SampleAntApplicationIT.java
View file @
22157091
...
@@ -48,12 +48,12 @@ public class SampleAntApplicationIT {
...
@@ -48,12 +48,12 @@ public class SampleAntApplicationIT {
});
});
assertThat
(
jarFiles
).
hasSize
(
1
);
assertThat
(
jarFiles
).
hasSize
(
1
);
Process
process
=
new
JavaExecutable
()
.
processBuilder
(
"-jar"
,
jarFiles
[
0
]
Process
process
=
new
JavaExecutable
()
.
getName
()).
directory
(
target
).
start
();
.
processBuilder
(
"-jar"
,
jarFiles
[
0
].
getName
()).
directory
(
target
).
start
();
process
.
waitFor
(
5
,
TimeUnit
.
MINUTES
);
process
.
waitFor
(
5
,
TimeUnit
.
MINUTES
);
assertThat
(
process
.
exitValue
()).
isEqualTo
(
0
);
assertThat
(
process
.
exitValue
()).
isEqualTo
(
0
);
String
output
=
FileCopyUtils
.
copyToString
(
new
InputStreamReader
(
process
String
output
=
FileCopyUtils
.
getInputStream
()));
.
copyToString
(
new
InputStreamReader
(
process
.
getInputStream
()));
assertThat
(
output
).
contains
(
"Spring Boot Ant Example"
);
assertThat
(
output
).
contains
(
"Spring Boot Ant Example"
);
}
}
...
...
spring-boot-samples/spring-boot-sample-junit-jupiter/src/main/java/sample/MessageController.java
View file @
22157091
...
@@ -19,9 +19,6 @@ package sample;
...
@@ -19,9 +19,6 @@ package sample;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author Eddú Meléndez
*/
@RestController
@RestController
public
class
MessageController
{
public
class
MessageController
{
...
...
spring-boot-samples/spring-boot-sample-kafka/src/main/resources/application.properties
View file @
22157091
...
@@ -3,4 +3,4 @@ spring.kafka.consumer.group-id=testGroup
...
@@ -3,4 +3,4 @@ spring.kafka.consumer.group-id=testGroup
spring.kafka.consumer.auto-offset-reset
=
earliest
spring.kafka.consumer.auto-offset-reset
=
earliest
spring.kafka.consumer.value-deserializer
=
org.springframework.kafka.support.serializer.JsonDeserializer
spring.kafka.consumer.value-deserializer
=
org.springframework.kafka.support.serializer.JsonDeserializer
spring.kafka.consumer.properties.spring.json.trusted.packages
=
sample.kafka
spring.kafka.consumer.properties.spring.json.trusted.packages
=
sample.kafka
spring.kafka.producer.value-serializer
=
org.springframework.kafka.support.serializer.JsonSerializer
spring.kafka.producer.value-serializer
=
org.springframework.kafka.support.serializer.JsonSerializer
\ No newline at end of file
spring-boot-samples/spring-boot-sample-quartz/src/main/java/sample/quartz/SampleJob.java
View file @
22157091
/*
/*
<<<<<<< HEAD:spring-boot-samples/spring-boot-sample-quartz/src/main/java/sample/quartz/SampleJob.java
* Copyright 2012-2017 the original author or authors.
=======
* Copyright 2012-2018 the original author or authors.
* Copyright 2012-2018 the original author or authors.
>>>>>>> local15x/1.5.x:spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/service/CitySearchCriteria.java
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
...
spring-boot-samples/spring-boot-sample-secure-webflux/src/main/java/sample/secure/webflux/SampleSecureWebFluxApplication.java
View file @
22157091
...
@@ -19,12 +19,11 @@ package sample.secure.webflux;
...
@@ -19,12 +19,11 @@ package sample.secure.webflux;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.web.reactive.function.server.RequestPredicates
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.RouterFunctions
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
static
org
.
springframework
.
web
.
reactive
.
function
.
server
.
RequestPredicates
.
POST
;
import
static
org
.
springframework
.
web
.
reactive
.
function
.
server
.
RouterFunctions
.
route
;
@SpringBootApplication
@SpringBootApplication
public
class
SampleSecureWebFluxApplication
{
public
class
SampleSecureWebFluxApplication
{
...
@@ -34,7 +33,7 @@ public class SampleSecureWebFluxApplication {
...
@@ -34,7 +33,7 @@ public class SampleSecureWebFluxApplication {
@Bean
@Bean
public
RouterFunction
<
ServerResponse
>
monoRouterFunction
(
EchoHandler
echoHandler
)
{
public
RouterFunction
<
ServerResponse
>
monoRouterFunction
(
EchoHandler
echoHandler
)
{
return
route
(
POST
(
"/echo"
),
echoHandler:
:
echo
);
return
RouterFunctions
.
route
(
RequestPredicates
.
POST
(
"/echo"
),
echoHandler:
:
echo
);
}
}
}
}
spring-boot-samples/spring-boot-sample-secure-webflux/src/main/resources/application.properties
View file @
22157091
spring.security.user.name
=
user
spring.security.user.name
=
user
spring.security.user.password
=
password
spring.security.user.password
=
password
management.endpoints.web.exposure.include
=
*
management.endpoints.web.exposure.include
=
*
\ No newline at end of file
spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java
View file @
22157091
...
@@ -101,6 +101,14 @@ public class SampleSecureWebFluxCustomSecurityTests {
...
@@ -101,6 +101,14 @@ public class SampleSecureWebFluxCustomSecurityTests {
.
expectStatus
().
isOk
();
.
expectStatus
().
isOk
();
}
}
private
String
getBasicAuth
()
{
return
new
String
(
Base64
.
getEncoder
().
encode
((
"user:password"
).
getBytes
()));
}
private
String
getBasicAuthForAdmin
()
{
return
new
String
(
Base64
.
getEncoder
().
encode
((
"admin:admin"
).
getBytes
()));
}
@Configuration
@Configuration
static
class
SecurityConfiguration
{
static
class
SecurityConfiguration
{
...
@@ -128,12 +136,4 @@ public class SampleSecureWebFluxCustomSecurityTests {
...
@@ -128,12 +136,4 @@ public class SampleSecureWebFluxCustomSecurityTests {
}
}
private
String
getBasicAuth
()
{
return
new
String
(
Base64
.
getEncoder
().
encode
((
"user:password"
).
getBytes
()));
}
private
String
getBasicAuthForAdmin
()
{
return
new
String
(
Base64
.
getEncoder
().
encode
((
"admin:admin"
).
getBytes
()));
}
}
}
spring-boot-samples/spring-boot-sample-servlet/src/main/resources/application.properties
View file @
22157091
spring.security.user.name
=
user
spring.security.user.name
=
user
spring.security.user.password
=
password
spring.security.user.password
=
password
\ No newline at end of file
spring-boot-samples/spring-boot-sample-session-webflux/src/main/resources/application.properties
View file @
22157091
spring.security.user.name
=
user
spring.security.user.name
=
user
spring.security.user.password
=
password
spring.security.user.password
=
password
\ No newline at end of file
spring-boot-samples/spring-boot-sample-webflux/src/main/java/sample/webflux/ExampleController.java
View file @
22157091
/*
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
webflux
;
package
sample
.
webflux
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
...
...
spring-boot-samples/spring-boot-sample-webflux/src/main/java/sample/webflux/SampleWebFluxApplication.java
View file @
22157091
...
@@ -19,12 +19,11 @@ package sample.webflux;
...
@@ -19,12 +19,11 @@ package sample.webflux;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.web.reactive.function.server.RequestPredicates
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.RouterFunction
;
import
org.springframework.web.reactive.function.server.RouterFunctions
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
org.springframework.web.reactive.function.server.ServerResponse
;
import
static
org
.
springframework
.
web
.
reactive
.
function
.
server
.
RequestPredicates
.
POST
;
import
static
org
.
springframework
.
web
.
reactive
.
function
.
server
.
RouterFunctions
.
route
;
@SpringBootApplication
@SpringBootApplication
public
class
SampleWebFluxApplication
{
public
class
SampleWebFluxApplication
{
...
@@ -34,7 +33,7 @@ public class SampleWebFluxApplication {
...
@@ -34,7 +33,7 @@ public class SampleWebFluxApplication {
@Bean
@Bean
public
RouterFunction
<
ServerResponse
>
monoRouterFunction
(
EchoHandler
echoHandler
)
{
public
RouterFunction
<
ServerResponse
>
monoRouterFunction
(
EchoHandler
echoHandler
)
{
return
route
(
POST
(
"/echo"
),
echoHandler:
:
echo
);
return
RouterFunctions
.
route
(
RequestPredicates
.
POST
(
"/echo"
),
echoHandler:
:
echo
);
}
}
}
}
spring-boot-samples/spring-boot-sample-webflux/src/main/resources/application.properties
deleted
100644 → 0
View file @
5626b7a5
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment