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
75bb50bd
Commit
75bb50bd
authored
May 04, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x' into 2.4.x
Closes gh-26353
parents
1417c1b0
deca737b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
JavaConventions.java
.../java/org/springframework/boot/build/JavaConventions.java
+11
-7
No files found.
buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
View file @
75bb50bd
...
...
@@ -64,7 +64,6 @@ import org.springframework.boot.build.toolchain.ToolchainPlugin;
* plugin is applied:
*
* <ul>
* <li>{@code sourceCompatibility} is set to {@code 1.8}
* <li>{@link SpringJavaFormatPlugin Spring Java Format}, {@link CheckstylePlugin
* Checkstyle}, {@link TestFailuresPlugin Test Failures}, and {@link TestRetryPlugin Test
* Retry} plugins are applied
...
...
@@ -79,8 +78,12 @@ import org.springframework.boot.build.toolchain.ToolchainPlugin;
* {@link JavaPlugin} applied
* <li>{@link JavaCompile}, {@link Javadoc}, and {@link FormatTask} tasks are configured
* to use UTF-8 encoding
* <li>{@link JavaCompile} tasks are configured to use {@code -parameters} and, when
* compiling with Java 8, to:
* <li>{@link JavaCompile} tasks are configured:
* <ul>
* <li>to use {@code -parameters}
* <li>with source and target compatibility of 1.8
* </ul>
* <li>When building with Java 8, {@link JavaCompile} tasks are also configured to:
* <ul>
* <li>Treat warnings as errors
* <li>Enable {@code unchecked}, {@code deprecation}, {@code rawtypes}, and {@code varags}
...
...
@@ -107,11 +110,12 @@ import org.springframework.boot.build.toolchain.ToolchainPlugin;
*/
class
JavaConventions
{
private
static
final
String
SOURCE_AND_TARGET_COMPATIBILITY
=
"1.8"
;
void
apply
(
Project
project
)
{
project
.
getPlugins
().
withType
(
JavaBasePlugin
.
class
,
(
java
)
->
{
project
.
getPlugins
().
apply
(
TestFailuresPlugin
.
class
);
configureSpringJavaFormat
(
project
);
project
.
setProperty
(
"sourceCompatibility"
,
"1.8"
);
configureJavaCompileConventions
(
project
);
configureJavadocConventions
(
project
);
configureTestConventions
(
project
);
...
...
@@ -137,7 +141,7 @@ class JavaConventions {
jar
.
manifest
((
manifest
)
->
{
Map
<
String
,
Object
>
attributes
=
new
TreeMap
<>();
attributes
.
put
(
"Automatic-Module-Name"
,
project
.
getName
().
replace
(
"-"
,
"."
));
attributes
.
put
(
"Build-Jdk-Spec"
,
project
.
property
(
"sourceCompatibility"
)
);
attributes
.
put
(
"Build-Jdk-Spec"
,
SOURCE_AND_TARGET_COMPATIBILITY
);
attributes
.
put
(
"Built-By"
,
"Spring"
);
attributes
.
put
(
"Implementation-Title"
,
determineImplementationTitle
(
project
,
sourceJarTaskNames
,
javadocJarTaskNames
,
jar
));
...
...
@@ -198,8 +202,8 @@ class JavaConventions {
private
void
configureJavaCompileConventions
(
Project
project
)
{
project
.
getTasks
().
withType
(
JavaCompile
.
class
,
(
compile
)
->
{
compile
.
getOptions
().
setEncoding
(
"UTF-8"
);
compile
.
setSourceCompatibility
(
"1.8"
);
compile
.
setTargetCompatibility
(
"1.8"
);
compile
.
setSourceCompatibility
(
SOURCE_AND_TARGET_COMPATIBILITY
);
compile
.
setTargetCompatibility
(
SOURCE_AND_TARGET_COMPATIBILITY
);
List
<
String
>
args
=
compile
.
getOptions
().
getCompilerArgs
();
if
(!
args
.
contains
(
"-parameters"
))
{
args
.
add
(
"-parameters"
);
...
...
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