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
d44ecf50
Commit
d44ecf50
authored
Oct 16, 2020
by
Scott Frederick
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3.x'
Closes gh-23731
parents
d005a64c
9c672deb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
43 deletions
+110
-43
DocumentPluginGoals.java
...framework/boot/build/mavenplugin/DocumentPluginGoals.java
+30
-6
AbstractDependencyFilterMojo.java
...ingframework/boot/maven/AbstractDependencyFilterMojo.java
+3
-2
AbstractPackagerMojo.java
.../org/springframework/boot/maven/AbstractPackagerMojo.java
+6
-5
BuildImageMojo.java
...n/java/org/springframework/boot/maven/BuildImageMojo.java
+3
-2
BuildInfoMojo.java
...in/java/org/springframework/boot/maven/BuildInfoMojo.java
+3
-3
Image.java
...n/src/main/java/org/springframework/boot/maven/Image.java
+63
-23
Layers.java
.../src/main/java/org/springframework/boot/maven/Layers.java
+2
-2
No files found.
buildSrc/src/main/java/org/springframework/boot/build/mavenplugin/DocumentPluginGoals.java
View file @
d44ecf50
...
...
@@ -136,11 +136,7 @@ public class DocumentPluginGoals extends DefaultTask {
for
(
Parameter
parameter
:
parameters
)
{
String
name
=
parameter
.
getName
();
writer
.
printf
(
"| <<%s-%s,%s>>%n"
,
detailsSectionId
,
name
,
name
);
String
type
=
parameter
.
getType
();
if
(
type
.
lastIndexOf
(
'.'
)
>=
0
)
{
type
=
type
.
substring
(
type
.
lastIndexOf
(
'.'
)
+
1
);
}
writer
.
printf
(
"| `%s`%n"
,
type
);
writer
.
printf
(
"| `%s`%n"
,
typeNameToJavadocLink
(
shortTypeName
(
parameter
.
getType
()),
parameter
.
getType
()));
String
defaultValue
=
parameter
.
getDefaultValue
();
if
(
defaultValue
!=
null
)
{
writer
.
printf
(
"| `%s`%n"
,
defaultValue
);
...
...
@@ -166,7 +162,7 @@ public class DocumentPluginGoals extends DefaultTask {
writer
.
println
(
"|==="
);
writer
.
println
();
writeDetail
(
writer
,
"Name"
,
name
);
writeDetail
(
writer
,
"Type"
,
parameter
.
getType
(
));
writeDetail
(
writer
,
"Type"
,
typeNameToJavadocLink
(
parameter
.
getType
()
));
writeOptionalDetail
(
writer
,
"Default value"
,
parameter
.
getDefaultValue
());
writeOptionalDetail
(
writer
,
"User property"
,
parameter
.
getUserProperty
());
writeOptionalDetail
(
writer
,
"Since"
,
parameter
.
getSince
());
...
...
@@ -191,4 +187,32 @@ public class DocumentPluginGoals extends DefaultTask {
writer
.
println
();
}
private
String
shortTypeName
(
String
name
)
{
if
(
name
.
lastIndexOf
(
'.'
)
>=
0
)
{
name
=
name
.
substring
(
name
.
lastIndexOf
(
'.'
)
+
1
);
}
if
(
name
.
lastIndexOf
(
'$'
)
>=
0
)
{
name
=
name
.
substring
(
name
.
lastIndexOf
(
'$'
)
+
1
);
}
return
name
;
}
private
String
typeNameToJavadocLink
(
String
name
)
{
return
typeNameToJavadocLink
(
name
,
name
);
}
private
String
typeNameToJavadocLink
(
String
shortName
,
String
name
)
{
if
(
name
.
startsWith
(
"org.springframework.boot.maven"
))
{
return
"{spring-boot-docs}/maven-plugin/api/"
+
typeNameToJavadocPath
(
name
)
+
".html["
+
shortName
+
"]"
;
}
if
(
name
.
startsWith
(
"org.springframework.boot"
))
{
return
"{spring-boot-docs}/api/"
+
typeNameToJavadocPath
(
name
)
+
".html["
+
shortName
+
"]"
;
}
return
shortName
;
}
private
String
typeNameToJavadocPath
(
String
name
)
{
return
name
.
replace
(
"."
,
"/"
).
replace
(
"$"
,
"."
);
}
}
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractDependencyFilterMojo.java
View file @
d44ecf50
...
...
@@ -40,7 +40,8 @@ public abstract class AbstractDependencyFilterMojo extends AbstractMojo {
/**
* Collection of artifact definitions to include. The {@link Include} element defines
* a {@code groupId} and {@code artifactId} mandatory properties and an optional
* mandatory {@code groupId} and {@code artifactId} properties and an optional
* mandatory {@code groupId} and {@code artifactId} properties and an optional
* {@code classifier} property.
* @since 1.2.0
*/
...
...
@@ -49,7 +50,7 @@ public abstract class AbstractDependencyFilterMojo extends AbstractMojo {
/**
* Collection of artifact definitions to exclude. The {@link Exclude} element defines
*
a {@code groupId} and {@code artifactId} mandatory
properties and an optional
*
mandatory {@code groupId} and {@code artifactId}
properties and an optional
* {@code classifier} property.
* @since 1.1.0
*/
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/AbstractPackagerMojo.java
View file @
d44ecf50
...
...
@@ -75,7 +75,7 @@ public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
/**
* The name of the main class. If not specified the first compiled class found that
* contains a
'main'
method will be used.
* contains a
{@code main}
method will be used.
* @since 1.0.0
*/
@Parameter
...
...
@@ -83,8 +83,8 @@ public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
/**
* The type of archive (which corresponds to how the dependencies are laid out inside
* it). Possible values are
JAR, WAR, ZIP, DIR, NONE. Defaults to a guess based on the
* archive type.
* it). Possible values are
{@code JAR}, {@code WAR}, {@code ZIP}, {@code DIR},
*
{@code NONE}. Defaults to a guess based on the
archive type.
* @since 1.0.0
*/
@Parameter
(
property
=
"spring-boot.repackage.layout"
)
...
...
@@ -114,7 +114,8 @@ public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
public
boolean
includeSystemScope
;
/**
* Layer configuration with the option to exclude layer tools jar.
* Layer configuration with options to disable layer creation, exclude layer tools
* jar, and provide a custom layers configuration file.
* @since 2.3.0
*/
@Parameter
...
...
@@ -211,7 +212,7 @@ public abstract class AbstractPackagerMojo extends AbstractDependencyFilterMojo
ZIP
(
new
Expanded
()),
/**
* Dir Layout.
* Dir
ectory
Layout.
*/
DIR
(
new
Expanded
()),
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildImageMojo.java
View file @
d44ecf50
...
...
@@ -100,8 +100,9 @@ public class BuildImageMojo extends AbstractPackagerMojo {
private
String
classifier
;
/**
* Image configuration, with `builder`, `runImage`, `name`, `env`, `cleanCache`,
* `verboseLogging`, and `publish` options.
* Image configuration, with {@code builder}, {@code runImage}, {@code name},
* {@code env}, {@code cleanCache}, {@code verboseLogging}, {@code pullPolicy}, and
* {@code publish} options.
* @since 2.3.0
*/
@Parameter
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/BuildInfoMojo.java
View file @
d44ecf50
...
...
@@ -62,7 +62,7 @@ public class BuildInfoMojo extends AbstractMojo {
private
MavenProject
project
;
/**
* The location of the generated
build-info.properties
.
* The location of the generated
{@code build-info.properties} file
.
*/
@Parameter
(
defaultValue
=
"${project.build.outputDirectory}/META-INF/build-info.properties"
)
private
File
outputFile
;
...
...
@@ -77,8 +77,8 @@ public class BuildInfoMojo extends AbstractMojo {
private
String
time
;
/**
* Additional properties to store in the
build-info.properties. Each entry is prefixed
*
by {@code build.} in the generated build-info.properties
.
* Additional properties to store in the
{@code build-info.properties} file. Each
*
entry is prefixed by {@code build.} in the generated {@code build-info.properties}
.
*/
@Parameter
private
Map
<
String
,
String
>
additionalProperties
;
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/Image.java
View file @
d44ecf50
...
...
@@ -38,62 +38,102 @@ import org.springframework.util.StringUtils;
*/
public
class
Image
{
/**
* The name of the created image.
*/
String
name
;
/**
* The builder used to create the image.
*/
String
builder
;
/**
* The run image used to launch the built image.
*/
String
runImage
;
/**
* Environment properties that should be passed to the builder.
*/
Map
<
String
,
String
>
env
;
/**
* If the cache should be cleaned before building.
*/
boolean
cleanCache
;
/**
* If verbose logging is required.
*/
boolean
verboseLogging
;
/**
* If images should be pulled from a remote repository during image build.
*/
PullPolicy
pullPolicy
;
Boolean
publish
;
/**
* If the built image should be pushed to a registry.
* The name of the created image.
* @return the image name
*/
Boolean
publish
;
public
String
getName
()
{
return
this
.
name
;
}
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/**
* The name of the builder image to use to create the image.
* @return the builder image name
*/
public
String
getBuilder
()
{
return
this
.
builder
;
}
void
setBuilder
(
String
builder
)
{
this
.
builder
=
builder
;
}
/**
* The name of the run image to use to create the image.
* @return the builder image name
*/
public
String
getRunImage
()
{
return
this
.
runImage
;
}
void
setRunImage
(
String
runImage
)
{
this
.
runImage
=
runImage
;
}
/**
* Environment properties that should be passed to the builder.
* @return the environment properties
*/
public
Map
<
String
,
String
>
getEnv
()
{
return
this
.
env
;
}
/**
* If the cache should be cleaned before building.
* @return {@code true} if the cache should be cleaned
*/
public
boolean
isCleanCache
()
{
return
this
.
cleanCache
;
}
/**
* If verbose logging is required.
* @return {@code true} for verbose logging
*/
public
boolean
isVerboseLogging
()
{
return
this
.
verboseLogging
;
}
/**
* If images should be pulled from a remote repository during image build.
* @return the pull policy
*/
public
PullPolicy
getPullPolicy
()
{
return
this
.
pullPolicy
;
}
public
void
setPullPolicy
(
PullPolicy
pullPolicy
)
{
this
.
pullPolicy
=
pullPolicy
;
}
/**
* If the built image should be pushed to a registry.
* @return {@code true} if the image should be published
*/
public
Boolean
getPublish
()
{
return
this
.
publish
;
}
public
void
setPublish
(
Boolean
publish
)
{
this
.
publish
=
publish
;
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/Layers.java
View file @
d44ecf50
...
...
@@ -33,8 +33,8 @@ public class Layers {
private
File
configuration
;
/**
* Whether a
layers.idx
file should be added to the jar.
* @return true if a
layers.idx
file should be added.
* Whether a
{@code layers.idx}
file should be added to the jar.
* @return true if a
{@code layers.idx}
file should be added.
*/
public
boolean
isEnabled
()
{
return
this
.
enabled
;
...
...
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