Commit e544922d authored by Phillip Webb's avatar Phillip Webb

Merge branch '1.5.x' into 2.0.x

parents 9c5f207e e75d8eaf
......@@ -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
added after the original pull request but before a merge.
* Use the Spring Framework code format conventions. If you use Eclipse and you follow
the '`Importing into eclipse`' instructions below you should get project specific
formatting automatically. You can also import formatter settings using the
`eclipse-code-formatter.xml` file from the `eclipse` folder. If using IntelliJ IDEA, you
can use the http://plugins.jetbrains.com/plugin/6546[Eclipse Code Formatter Plugin]
to import the same file.
* We use the https://github.com/spring-io/spring-javaformat/[Spring JavaFormat] project
to apply code formatting conventions. If you use Eclipse and you follow the '`Importing
into eclipse`' instructions below you should get project specific formatting
automatically. You can also install the https://github.com/spring-io/spring-javaformat/#intellij-idea[Spring JavaFormat IntelliJ Plugin]
or format the code from the Maven build by running
`./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
`@author` tag identifying you, and preferably at least a paragraph on what the class is
for.
......@@ -80,13 +82,15 @@ should also work without issue.
=== Building from Source
To build the source you will need to install
https://maven.apache.org/run-maven/index.html[Apache Maven] v3.2.3 or above and JDK 1.8.
Spring Boot source can be build from the command line using
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
The project can be built from the root directory using the standard maven command:
The project can be built from the root directory using the standard Maven command:
[indent=0]
----
......@@ -134,9 +138,9 @@ can run this from the top-level directory:
=== 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
`.setup` file.
`.setup` file (in the `/eclipse` folder).
==== Using the Eclipse Installer
......@@ -165,24 +169,21 @@ easier to navigate.
==== 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
installed it is available from the "Eclipse marketplace".
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
* Select "`Help`" -> "`Install New Software`".
* Add `https://dl.bintray.com/philwebb/spring-eclipse-code-formatter/` as a site.
* Install "Spring Code Formatter"
* Add `https://dl.bintray.com/spring/javaformat-eclipse/` as a site.
* Install "Spring Java Format"
NOTE: These 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.
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
==== 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
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
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
`maven-invoker-plugin`. If you encounter build failures running the integration tests,
check the `build.log` file in the appropriate sample directory.
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -63,7 +63,7 @@
<requirement
name="AnyEditTools.feature.group"/>
<requirement
name="org.eclipse.m2e.maveneclipse.feature.feature.group"/>
name="io.spring.javaformat.eclipse.feature.feature.group"/>
<requirement
name="org.eclipse.jst.server_adapters.feature.feature.group"/>
<requirement
......@@ -87,7 +87,7 @@
<repository
url="http://andrei.gmxhome.de/eclipse/"/>
<repository
url="https://dl.bintray.com/philwebb/m2eclipse-maveneclipse"/>
url="https://dl.bintray.com/spring/javaformat-eclipse/"/>
<repository
url="http://download.eclipse.org/egit/github/updates/"/>
<repository
......
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
......@@ -25,6 +26,7 @@
<aether.version>1.0.2.v20150114</aether.version>
<maven.version>3.1.1</maven.version>
<spock.version>1.0-groovy-2.4</spock.version>
<spring-javaformat.version>0.0.1</spring-javaformat.version>
</properties>
<scm>
<url>http://github.com/spring-projects/spring-boot</url>
......@@ -310,7 +312,12 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<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>
</dependencies>
</plugin>
......@@ -567,6 +574,19 @@
</execution>
</executions>
</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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
......@@ -575,14 +595,8 @@
<id>checkstyle-validation</id>
<phase>validate</phase>
<configuration>
<skip>${disable.checks}</skip>
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
<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>
</configuration>
<goals>
......@@ -600,23 +614,6 @@
<parameters>true</parameters>
</configuration>
</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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
......
......@@ -249,6 +249,25 @@
<ignore></ignore>
</action>
</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>
</lifecycleMappingMetadata>
</configuration>
......
......@@ -15,6 +15,7 @@
<properties>
<main.basedir>${basedir}/..</main.basedir>
<java.version>1.8</java.version>
<spring-javaformat.version>0.0.1</spring-javaformat.version>
</properties>
<modules>
<module>spring-boot-sample-ant</module>
......@@ -174,22 +175,49 @@
</plugins>
</pluginManagement>
<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>
<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>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.0.0</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.8</version>
</dependency>
<dependency>
<groupId>io.spring.javaformat</groupId>
<artifactId>spring-javaformat-checkstyle</artifactId>
<version>${spring-javaformat.version}</version>
</dependency>
</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>
<groupId>org.apache.maven.plugins</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment