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
cd512400
Commit
cd512400
authored
Jan 25, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate support for module layout
Closes gh-8008
parent
a081c965
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
9 deletions
+25
-9
SpringBootPluginExtension.java
...pringframework/boot/gradle/SpringBootPluginExtension.java
+2
-2
RepackageTask.java
.../springframework/boot/gradle/repackage/RepackageTask.java
+11
-3
Layouts.java
...n/java/org/springframework/boot/loader/tools/Layouts.java
+3
-1
LayoutsTests.java
...a/org/springframework/boot/loader/tools/LayoutsTests.java
+2
-1
RepackageMojo.java
...in/java/org/springframework/boot/maven/RepackageMojo.java
+7
-2
No files found.
spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/SpringBootPluginExtension.java
View file @
cd512400
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -304,7 +304,7 @@ public class SpringBootPluginExtension {
DIR
(
new
Layouts
.
Expanded
()),
MODULE
(
new
Layouts
.
Module
()),
@SuppressWarnings
(
"deprecation"
)
MODULE
(
new
Layouts
.
Module
()),
NONE
(
new
Layouts
.
None
());
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/repackage/RepackageTask.java
View file @
cd512400
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -33,6 +33,8 @@ import org.gradle.api.tasks.bundling.Jar;
import
org.springframework.boot.gradle.SpringBootPluginExtension
;
import
org.springframework.boot.loader.tools.DefaultLaunchScript
;
import
org.springframework.boot.loader.tools.LaunchScript
;
import
org.springframework.boot.loader.tools.Layout
;
import
org.springframework.boot.loader.tools.Layouts
;
import
org.springframework.boot.loader.tools.Repackager
;
import
org.springframework.boot.loader.tools.Repackager.MainClassTimeoutWarningListener
;
import
org.springframework.util.FileCopyUtils
;
...
...
@@ -207,6 +209,7 @@ public class RepackageTask extends DefaultTask {
return
task
.
equals
(
withJarTask
)
||
task
.
getName
().
equals
(
withJarTask
);
}
@SuppressWarnings
(
"deprecation"
)
private
void
repackage
(
File
file
)
{
File
outputFile
=
RepackageTask
.
this
.
outputFile
;
if
(
outputFile
!=
null
&&
!
file
.
equals
(
outputFile
))
{
...
...
@@ -218,8 +221,13 @@ public class RepackageTask extends DefaultTask {
repackager
.
addMainClassTimeoutWarningListener
(
new
LoggingMainClassTimeoutWarningListener
());
setMainClass
(
repackager
);
if
(
this
.
extension
.
convertLayout
()
!=
null
)
{
repackager
.
setLayout
(
this
.
extension
.
convertLayout
());
Layout
layout
=
this
.
extension
.
convertLayout
();
if
(
layout
!=
null
)
{
if
(
layout
instanceof
Layouts
.
Module
)
{
getLogger
().
warn
(
"Module layout is deprecated. Please use a custom"
+
" LayoutFactory instead."
);
}
repackager
.
setLayout
(
layout
);
}
repackager
.
setBackupSource
(
this
.
extension
.
isBackupSource
());
try
{
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Layouts.java
View file @
cd512400
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -158,7 +158,9 @@ public final class Layouts {
/**
* Module layout (designed to be used as a "plug-in").
* @deprecated since 1.5 in favour of a custom {@link LayoutFactory}
*/
@Deprecated
public
static
class
Module
implements
Layout
{
private
static
final
Set
<
LibraryScope
>
LIB_DESTINATION_SCOPES
=
new
HashSet
<
LibraryScope
>(
...
...
spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/LayoutsTests.java
View file @
cd512400
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -87,6 +87,7 @@ public class LayoutsTests {
}
@Test
@SuppressWarnings
(
"deprecation"
)
public
void
moduleLayout
()
throws
Exception
{
Layout
layout
=
new
Layouts
.
Module
();
assertThat
(
layout
.
getLibraryDestination
(
"lib.jar"
,
LibraryScope
.
COMPILE
))
...
...
spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/RepackageMojo.java
View file @
cd512400
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -236,6 +236,10 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
repackager
.
setMainClass
(
this
.
mainClass
);
if
(
this
.
layout
!=
null
)
{
getLog
().
info
(
"Layout: "
+
this
.
layout
);
if
(
this
.
layout
==
LayoutType
.
MODULE
)
{
getLog
().
warn
(
"Module layout is deprecated. Please use a custom"
+
" LayoutFactory instead."
);
}
repackager
.
setLayout
(
this
.
layout
.
layout
());
}
return
repackager
;
...
...
@@ -344,8 +348,9 @@ public class RepackageMojo extends AbstractDependencyFilterMojo {
/**
* Module Layout.
* @deprecated since 1.5 in favour of a custom {@link LayoutFactory}
*/
MODULE
(
new
Layouts
.
Module
()),
@Deprecated
MODULE
(
new
Layouts
.
Module
()),
/**
* No Layout.
...
...
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