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
80544268
Commit
80544268
authored
Jul 02, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Format source code
parent
fa88c481
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
38 additions
and
27 deletions
+38
-27
SampleParentContextApplication.java
...in/java/sample/parent/SampleParentContextApplication.java
+2
-1
SampleIntegrationApplicationTests.java
...le/parent/consumer/SampleIntegrationApplicationTests.java
+1
-0
VersionManagedDependencies.java
...ringframework/boot/gradle/VersionManagedDependencies.java
+2
-2
ProjectLibraries.java
...ringframework/boot/gradle/repackage/ProjectLibraries.java
+2
-1
RepackagePluginFeatures.java
...mework/boot/gradle/repackage/RepackagePluginFeatures.java
+7
-5
RepackageTask.java
.../springframework/boot/gradle/repackage/RepackageTask.java
+10
-6
BootRunTask.java
...oovy/org/springframework/boot/gradle/run/BootRunTask.java
+2
-2
FindMainClassTask.java
...rg/springframework/boot/gradle/run/FindMainClassTask.java
+6
-5
RunPluginFeatures.java
...rg/springframework/boot/gradle/run/RunPluginFeatures.java
+1
-1
SourceSets.java
...roovy/org/springframework/boot/gradle/run/SourceSets.java
+1
-1
YamlProcessor.java
...ain/java/org/springframework/boot/yaml/YamlProcessor.java
+4
-3
No files found.
spring-boot-samples/spring-boot-sample-parent-context/src/main/java/sample/parent/SampleParentContextApplication.java
View file @
80544268
...
...
@@ -30,7 +30,8 @@ import org.springframework.context.annotation.ImportResource;
public
class
SampleParentContextApplication
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
new
SpringApplicationBuilder
(
Parent
.
class
).
child
(
SampleParentContextApplication
.
class
).
run
(
args
);
new
SpringApplicationBuilder
(
Parent
.
class
).
child
(
SampleParentContextApplication
.
class
).
run
(
args
);
}
@EnableAutoConfiguration
...
...
spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationApplicationTests.java
View file @
80544268
...
...
@@ -33,6 +33,7 @@ import org.springframework.util.StreamUtils;
import
sample.parent.SampleParentContextApplication
;
import
sample.parent.producer.ProducerApplication
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
/**
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/VersionManagedDependencies.java
View file @
80544268
...
...
@@ -31,8 +31,8 @@ import org.springframework.boot.dependency.tools.ManagedDependencies;
import
org.springframework.boot.dependency.tools.PropertiesFileDependencies
;
/**
* Utility to provide access to {@link ManagedDependencies} with support for version
*
file
overrides.
* Utility to provide access to {@link ManagedDependencies} with support for version
file
* overrides.
*
* @author Phillip Webb
*/
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/ProjectLibraries.java
View file @
80544268
...
...
@@ -123,7 +123,8 @@ class ProjectLibraries implements Libraries {
LibraryCallback
callback
)
throws
IOException
{
if
(
artifacts
!=
null
)
{
for
(
ResolvedArtifact
artifact
:
artifacts
)
{
callback
.
library
(
new
Library
(
artifact
.
getFile
(),
scope
,
isUnpackRequired
(
artifact
)));
callback
.
library
(
new
Library
(
artifact
.
getFile
(),
scope
,
isUnpackRequired
(
artifact
)));
}
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java
View file @
80544268
...
...
@@ -55,8 +55,9 @@ public class RepackagePluginFeatures implements PluginFeatures {
+
"archives so that they can be executed from the command "
+
"line using 'java -jar'"
);
task
.
setGroup
(
BasePlugin
.
BUILD_GROUP
);
task
.
dependsOn
(
project
.
getConfigurations
().
getByName
(
Dependency
.
ARCHIVES_CONFIGURATION
).
getAllArtifacts
().
getBuildDependencies
());
task
.
dependsOn
(
project
.
getConfigurations
()
.
getByName
(
Dependency
.
ARCHIVES_CONFIGURATION
).
getAllArtifacts
()
.
getBuildDependencies
());
registerOutput
(
project
,
task
);
ensureTaskRunsOnAssembly
(
project
,
task
);
}
...
...
@@ -68,7 +69,7 @@ public class RepackagePluginFeatures implements PluginFeatures {
project
.
getTasks
().
withType
(
Jar
.
class
,
new
RegisterInputsOutputsAction
(
task
));
Object
withJar
=
task
.
getWithJarTask
();
if
(
withJar
!=
null
)
{
if
(
withJar
!=
null
)
{
task
.
dependsOn
(
withJar
);
}
}
...
...
@@ -83,8 +84,8 @@ public class RepackagePluginFeatures implements PluginFeatures {
* Register BootRepackage so that we can use task {@code foo(type: BootRepackage)}.
*/
private
void
registerRepackageTaskProperty
(
Project
project
)
{
project
.
getExtensions
().
getExtraProperties
()
.
set
(
"BootRepackage"
,
RepackageTask
.
class
);
project
.
getExtensions
().
getExtraProperties
()
.
set
(
"BootRepackage"
,
RepackageTask
.
class
);
}
/**
...
...
@@ -135,6 +136,7 @@ public class RepackagePluginFeatures implements PluginFeatures {
private
void
addLibraryDependencies
(
final
RepackageTask
task
)
{
try
{
task
.
getLibraries
().
doWithLibraries
(
new
LibraryCallback
()
{
@Override
public
void
library
(
Library
library
)
throws
IOException
{
task
.
getInputs
().
file
(
library
.
getFile
());
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java
View file @
80544268
...
...
@@ -97,7 +97,8 @@ public class RepackageTask extends DefaultTask {
}
if
(
this
.
customConfiguration
!=
null
)
{
libraries
.
setCustomConfigurationName
(
this
.
customConfiguration
);
}
else
if
(
extension
.
getCustomConfiguration
()
!=
null
)
{
}
else
if
(
extension
.
getCustomConfiguration
()
!=
null
)
{
libraries
.
setCustomConfigurationName
(
extension
.
getCustomConfiguration
());
}
return
libraries
;
...
...
@@ -180,11 +181,13 @@ public class RepackageTask extends DefaultTask {
String
mainClass
=
(
String
)
getProject
().
property
(
"mainClassName"
);
if
(
RepackageTask
.
this
.
mainClass
!=
null
)
{
mainClass
=
RepackageTask
.
this
.
mainClass
;
}
else
if
(
this
.
extension
.
getMainClass
()
!=
null
)
{
}
else
if
(
this
.
extension
.
getMainClass
()
!=
null
)
{
mainClass
=
this
.
extension
.
getMainClass
();
}
else
if
(
getProject
().
getTasks
().
getByName
(
"run"
).
hasProperty
(
"main"
))
{
mainClass
=
(
String
)
getProject
().
getTasks
().
getByName
(
"run"
).
property
(
"main"
);
}
else
if
(
getProject
().
getTasks
().
getByName
(
"run"
).
hasProperty
(
"main"
))
{
mainClass
=
(
String
)
getProject
().
getTasks
().
getByName
(
"run"
)
.
property
(
"main"
);
}
getLogger
().
info
(
"Setting mainClass: "
+
mainClass
);
repackager
.
setMainClass
(
mainClass
);
...
...
@@ -205,7 +208,8 @@ public class RepackageTask extends DefaultTask {
long
startTime
=
System
.
currentTimeMillis
();
try
{
return
super
.
findMainMethod
(
source
);
}
finally
{
}
finally
{
long
duration
=
System
.
currentTimeMillis
()
-
startTime
;
if
(
duration
>
FIND_WARNING_TIMEOUT
)
{
getLogger
().
warn
(
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/BootRunTask.java
View file @
80544268
...
...
@@ -38,8 +38,8 @@ public class BootRunTask extends JavaExec {
@Override
public
void
exec
()
{
SourceSet
mainSourceSet
=
SourceSets
.
findMainSourceSet
(
getProject
());
final
File
outputDir
=
(
mainSourceSet
==
null
?
null
:
mainSourceSet
.
getOutput
()
.
getResourcesDir
());
final
File
outputDir
=
(
mainSourceSet
==
null
?
null
:
mainSourceSet
.
getOutput
()
.
getResourcesDir
());
final
Set
<
File
>
resources
=
new
LinkedHashSet
<
File
>();
if
(
mainSourceSet
!=
null
)
{
resources
.
addAll
(
mainSourceSet
.
getResources
().
getSrcDirs
());
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/FindMainClassTask.java
View file @
80544268
package
org
.
springframework
.
boot
.
gradle
.
run
;
import
java.io.IOException
;
...
...
@@ -41,8 +40,8 @@ public class FindMainClassTask extends DefaultTask {
mainClass
=
bootExtension
.
getMainClass
();
}
ApplicationPluginConvention
application
=
(
ApplicationPluginConvention
)
project
.
getConvention
().
getPlugins
().
get
(
"application"
);
ApplicationPluginConvention
application
=
(
ApplicationPluginConvention
)
project
.
getConvention
().
getPlugins
().
get
(
"application"
);
// Try the Application extension setting
if
(
mainClass
==
null
&&
application
.
getMainClassName
()
!=
null
)
{
mainClass
=
application
.
getMainClassName
();
...
...
@@ -61,9 +60,11 @@ public class FindMainClassTask extends DefaultTask {
"Looking for main in: "
+
mainSourceSet
.
getOutput
().
getClassesDir
());
try
{
mainClass
=
MainClassFinder
.
findSingleMainClass
(
mainSourceSet
.
getOutput
().
getClassesDir
());
mainClass
=
MainClassFinder
.
findSingleMainClass
(
mainSourceSet
.
getOutput
().
getClassesDir
());
project
.
getLogger
().
info
(
"Computed main class: "
+
mainClass
);
}
catch
(
IOException
ex
)
{
}
catch
(
IOException
ex
)
{
throw
new
IllegalStateException
(
"Cannot find main class"
,
ex
);
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/RunPluginFeatures.java
View file @
80544268
...
...
@@ -48,7 +48,7 @@ public class RunPluginFeatures implements PluginFeatures {
project
.
getTasks
().
all
(
new
Action
<
Task
>()
{
@Override
public
void
execute
(
Task
task
)
{
if
(
task
instanceof
JavaExec
||
task
instanceof
CreateStartScripts
)
{
if
(
task
instanceof
JavaExec
||
task
instanceof
CreateStartScripts
)
{
task
.
dependsOn
(
FIND_MAIN_CLASS_TASK_NAME
);
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/run/SourceSets.java
View file @
80544268
...
...
@@ -42,7 +42,7 @@ class SourceSets {
private
static
Iterable
<
SourceSet
>
getJavaSourceSets
(
Project
project
)
{
JavaPluginConvention
plugin
=
project
.
getConvention
().
getPlugin
(
JavaPluginConvention
.
class
);
if
(
plugin
==
null
)
{
if
(
plugin
==
null
)
{
return
Collections
.
emptyList
();
}
return
plugin
.
getSourceSets
();
...
...
spring-boot/src/main/java/org/springframework/boot/yaml/YamlProcessor.java
View file @
80544268
...
...
@@ -53,8 +53,8 @@ public abstract class YamlProcessor {
/**
* A map of document matchers allowing callers to selectively use only some of the
* documents in a YAML resource. In YAML documents are separated by
*
<code>---<code>
lines, and each document is converted to properties before the match is made. E.g.
* documents in a YAML resource. In YAML documents are separated by
<code>---</code>
* lines, and each document is converted to properties before the match is made. E.g.
*
* <pre class="code">
* environment: dev
...
...
@@ -66,7 +66,8 @@ public abstract class YamlProcessor {
* name: My Cool App
* </pre>
*
* when mapped with <code>documentMatchers = YamlProcessor.mapMatcher({"environment": "prod"})</code>
* when mapped with
* <code>documentMatchers = YamlProcessor.mapMatcher({"environment": "prod"})</code>
* would end up as
*
* <pre class="code">
...
...
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