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
c548693f
Commit
c548693f
authored
Apr 28, 2021
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.4.x'
See gh-26261
parents
80248dcc
097a4363
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
1 deletion
+35
-1
JavaConventions.java
.../java/org/springframework/boot/build/JavaConventions.java
+35
-1
No files found.
buildSrc/src/main/java/org/springframework/boot/build/JavaConventions.java
View file @
c548693f
...
...
@@ -16,6 +16,11 @@
package
org
.
springframework
.
boot
.
build
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -26,8 +31,10 @@ import java.util.stream.Collectors;
import
io.spring.javaformat.gradle.FormatTask
;
import
io.spring.javaformat.gradle.SpringJavaFormatPlugin
;
import
org.gradle.api.Action
;
import
org.gradle.api.JavaVersion
;
import
org.gradle.api.Project
;
import
org.gradle.api.Task
;
import
org.gradle.api.artifacts.Configuration
;
import
org.gradle.api.artifacts.ConfigurationContainer
;
import
org.gradle.api.artifacts.Dependency
;
...
...
@@ -147,10 +154,14 @@ class JavaConventions {
project
.
getTasks
().
withType
(
Test
.
class
,
(
test
)
->
{
test
.
useJUnitPlatform
();
test
.
setMaxHeapSize
(
"1024M"
);
CopyJdk8156584SecurityProperties
copyJdk8156584SecurityProperties
=
new
CopyJdk8156584SecurityProperties
(
project
);
if
(
buildingWithJava8
(
project
))
{
test
.
systemProperty
(
"java.security.properties"
,
getClass
().
getClassLoader
().
getResource
(
"jdk-8156584-security.properties"
));
"file:"
+
test
.
getWorkingDir
().
toPath
().
relativize
(
copyJdk8156584SecurityProperties
.
output
));
test
.
setDebug
(
true
);
}
test
.
doFirst
(
copyJdk8156584SecurityProperties
);
});
project
.
getPlugins
().
withType
(
JavaPlugin
.
class
,
(
javaPlugin
)
->
project
.
getDependencies
()
.
add
(
JavaPlugin
.
TEST_RUNTIME_ONLY_CONFIGURATION_NAME
,
"org.junit.platform:junit-platform-launcher"
));
...
...
@@ -226,4 +237,27 @@ class JavaConventions {
project
.
getPlugins
().
apply
(
ToolchainPlugin
.
class
);
}
private
static
final
class
CopyJdk8156584SecurityProperties
implements
Action
<
Task
>
{
private
static
final
String
SECURITY_PROPERTIES_FILE_NAME
=
"jdk-8156584-security.properties"
;
private
final
Path
output
;
private
CopyJdk8156584SecurityProperties
(
Project
project
)
{
this
.
output
=
new
File
(
project
.
getBuildDir
(),
SECURITY_PROPERTIES_FILE_NAME
).
toPath
();
}
@Override
public
void
execute
(
Task
task
)
{
try
(
InputStream
input
=
getClass
().
getClassLoader
()
.
getResourceAsStream
(
CopyJdk8156584SecurityProperties
.
SECURITY_PROPERTIES_FILE_NAME
))
{
Files
.
copy
(
input
,
this
.
output
);
}
catch
(
IOException
ex
)
{
throw
new
RuntimeException
(
ex
);
}
}
}
}
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