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
179e1558
Commit
179e1558
authored
Jun 18, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
2433f721
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
31 deletions
+32
-31
DataSourceInitializerPostProcessor.java
...utoconfigure/jdbc/DataSourceInitializerPostProcessor.java
+2
-1
ClassifierTests.java
...java/org/springframework/boot/gradle/ClassifierTests.java
+15
-14
SampleWebSecureApplication.java
...ain/java/sample/ui/secure/SampleWebSecureApplication.java
+5
-6
SpringBootPluginExtension.groovy
...ingframework/boot/gradle/SpringBootPluginExtension.groovy
+3
-3
RepackagePluginFeatures.java
...mework/boot/gradle/repackage/RepackagePluginFeatures.java
+5
-5
RepackageTask.java
.../springframework/boot/gradle/repackage/RepackageTask.java
+2
-2
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializerPostProcessor.java
View file @
179e1558
...
@@ -33,7 +33,7 @@ import org.springframework.core.type.AnnotationMetadata;
...
@@ -33,7 +33,7 @@ import org.springframework.core.type.AnnotationMetadata;
* be registered via the inner {@link Registrar} class.
* be registered via the inner {@link Registrar} class.
*
*
* @author Dave Syer
* @author Dave Syer
* @since 1.1.
0
* @since 1.1.
2
*/
*/
class
DataSourceInitializerPostProcessor
implements
BeanPostProcessor
{
class
DataSourceInitializerPostProcessor
implements
BeanPostProcessor
{
...
@@ -78,6 +78,7 @@ class DataSourceInitializerPostProcessor implements BeanPostProcessor {
...
@@ -78,6 +78,7 @@ class DataSourceInitializerPostProcessor implements BeanPostProcessor {
registry
.
registerBeanDefinition
(
BEAN_NAME
,
beanDefinition
);
registry
.
registerBeanDefinition
(
BEAN_NAME
,
beanDefinition
);
}
}
}
}
}
}
}
}
spring-boot-integration-tests/src/test/java/org/springframework/boot/gradle/ClassifierTests.java
View file @
179e1558
...
@@ -16,48 +16,49 @@
...
@@ -16,48 +16,49 @@
package
org
.
springframework
.
boot
.
gradle
;
package
org
.
springframework
.
boot
.
gradle
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
import
java.util.jar.JarFile
;
import
java.util.jar.JarFile
;
import
org.gradle.tooling.ProjectConnection
;
import
org.gradle.tooling.ProjectConnection
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
org.springframework.boot.dependency.tools.ManagedDependencies
;
import
static
org
.
junit
.
Assert
.
assertNotNull
;
/**
/**
* Tests for using the Gradle plugin's support for installing artifacts
* Tests for using the Gradle plugin's support for installing artifacts
*
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
ClassifierTests
{
public
class
ClassifierTests
{
private
ProjectConnection
project
;
private
ProjectConnection
project
;
private
static
final
String
BOOT_VERSION
=
ManagedDependencies
.
get
()
.
find
(
private
static
final
String
BOOT_VERSION
=
ManagedDependencies
.
get
()
"spring-boot"
).
getVersion
();
.
find
(
"spring-boot"
).
getVersion
();
@Test
@Test
public
void
classifierInBootTask
()
throws
Exception
{
public
void
classifierInBootTask
()
throws
Exception
{
project
=
new
ProjectCreator
().
createProject
(
"classifier"
);
this
.
project
=
new
ProjectCreator
().
createProject
(
"classifier"
);
project
.
newBuild
().
forTasks
(
"build"
).
withArguments
(
this
.
project
.
newBuild
().
forTasks
(
"build"
)
"-PbootVersion="
+
BOOT_VERSION
,
"--stacktrace"
).
run
();
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"--stacktrace"
).
run
();
checkFilesExist
(
"classifier"
);
checkFilesExist
(
"classifier"
);
}
}
@Test
@Test
public
void
classifierInBootExtension
()
throws
Exception
{
public
void
classifierInBootExtension
()
throws
Exception
{
project
=
new
ProjectCreator
().
createProject
(
"classifier-extension"
);
this
.
project
=
new
ProjectCreator
().
createProject
(
"classifier-extension"
);
project
.
newBuild
().
forTasks
(
"build"
).
withArguments
(
this
.
project
.
newBuild
().
forTasks
(
"build"
)
"-PbootVersion="
+
BOOT_VERSION
,
"--stacktrace"
,
"--info"
).
run
();
.
withArguments
(
"-PbootVersion="
+
BOOT_VERSION
,
"--stacktrace"
,
"--info"
)
.
run
();
}
}
private
void
checkFilesExist
(
String
name
)
throws
Exception
{
private
void
checkFilesExist
(
String
name
)
throws
Exception
{
JarFile
jar
=
new
JarFile
(
"target/"
+
name
+
"/build/libs/"
+
name
+
".jar"
);
JarFile
jar
=
new
JarFile
(
"target/"
+
name
+
"/build/libs/"
+
name
+
".jar"
);
assertNotNull
(
jar
.
getManifest
());
assertNotNull
(
jar
.
getManifest
());
jar
.
close
();
jar
.
close
();
jar
=
new
JarFile
(
"target/"
+
name
+
"/build/libs/"
+
name
+
"-exec.jar"
);
jar
=
new
JarFile
(
"target/"
+
name
+
"/build/libs/"
+
name
+
"-exec.jar"
);
assertNotNull
(
jar
.
getManifest
());
assertNotNull
(
jar
.
getManifest
());
jar
.
close
();
jar
.
close
();
}
}
}
}
spring-boot-samples/spring-boot-sample-web-secure/src/main/java/sample/ui/secure/SampleWebSecureApplication.java
View file @
179e1558
...
@@ -89,18 +89,17 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter {
...
@@ -89,18 +89,17 @@ public class SampleWebSecureApplication extends WebMvcConfigurerAdapter {
}
}
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
+
10
)
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
+
10
)
protected
static
class
AuthenticationSecurity
extends
GlobalAuthenticationConfigurerAdapter
{
protected
static
class
AuthenticationSecurity
extends
GlobalAuthenticationConfigurerAdapter
{
@Autowired
@Autowired
private
DataSource
dataSource
;
private
DataSource
dataSource
;
@Override
@Override
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
// @formatter:off
auth
.
jdbcAuthentication
().
dataSource
(
this
.
dataSource
).
withUser
(
"admin"
)
auth
.
jdbcAuthentication
().
dataSource
(
dataSource
).
withUser
(
"admin"
).
password
(
"admin"
)
.
password
(
"admin"
).
roles
(
"ADMIN"
,
"USER"
).
and
().
withUser
(
"user"
)
.
roles
(
"ADMIN"
,
"USER"
).
and
().
withUser
(
"user"
).
password
(
"user"
)
.
password
(
"user"
).
roles
(
"USER"
);
.
roles
(
"USER"
);
// @formatter:on
}
}
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPluginExtension.groovy
View file @
179e1558
...
@@ -58,15 +58,15 @@ public class SpringBootPluginExtension {
...
@@ -58,15 +58,15 @@ public class SpringBootPluginExtension {
}
}
/**
/**
* The main class that should be run. Instead of setting this explicitly you can use the
* The main class that should be run. Instead of setting this explicitly you can use the
* 'mainClassName' of the project or the 'main' of the 'run' task. If not specified the
* 'mainClassName' of the project or the 'main' of the 'run' task. If not specified the
* value from the MANIFEST will be used, or if no manifest entry is the archive will be
* value from the MANIFEST will be used, or if no manifest entry is the archive will be
* searched for a suitable class.
* searched for a suitable class.
*/
*/
String
mainClass
String
mainClass
/**
/**
* The classifier (file name part before the extension). Instead of setting this explicitly
* The classifier (file name part before the extension). Instead of setting this explicitly
* you can use the 'classifier' property of the 'bootRepackage' task. If not specified the archive
* you can use the 'classifier' property of the 'bootRepackage' task. If not specified the archive
* will be replaced instead of renamed.
* will be replaced instead of renamed.
*/
*/
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java
View file @
179e1558
...
@@ -61,7 +61,7 @@ public class RepackagePluginFeatures implements PluginFeatures {
...
@@ -61,7 +61,7 @@ public class RepackagePluginFeatures implements PluginFeatures {
project
.
afterEvaluate
(
new
Action
<
Project
>()
{
project
.
afterEvaluate
(
new
Action
<
Project
>()
{
@Override
@Override
public
void
execute
(
Project
project
)
{
public
void
execute
(
Project
project
)
{
project
.
getTasks
().
withType
(
Jar
.
class
,
new
OutputAction
(
task
));
project
.
getTasks
().
withType
(
Jar
.
class
,
new
OutputAction
(
task
));
}
}
});
});
}
}
...
@@ -89,9 +89,9 @@ public class RepackagePluginFeatures implements PluginFeatures {
...
@@ -89,9 +89,9 @@ public class RepackagePluginFeatures implements PluginFeatures {
@Override
@Override
public
void
execute
(
Jar
archive
)
{
public
void
execute
(
Jar
archive
)
{
if
(
""
.
equals
(
archive
.
getClassifier
()))
{
if
(
""
.
equals
(
archive
.
getClassifier
()))
{
setClassifier
(
task
,
archive
);
setClassifier
(
t
his
.
t
ask
,
archive
);
File
file
=
archive
.
getArchivePath
();
File
file
=
archive
.
getArchivePath
();
String
classifier
=
task
.
getClassifier
();
String
classifier
=
t
his
.
t
ask
.
getClassifier
();
if
(
classifier
!=
null
)
{
if
(
classifier
!=
null
)
{
String
withClassifer
=
file
.
getName
();
String
withClassifer
=
file
.
getName
();
withClassifer
=
StringUtils
.
stripFilenameExtension
(
withClassifer
)
withClassifer
=
StringUtils
.
stripFilenameExtension
(
withClassifer
)
...
@@ -99,8 +99,8 @@ public class RepackagePluginFeatures implements PluginFeatures {
...
@@ -99,8 +99,8 @@ public class RepackagePluginFeatures implements PluginFeatures {
+
StringUtils
.
getFilenameExtension
(
withClassifer
);
+
StringUtils
.
getFilenameExtension
(
withClassifer
);
File
out
=
new
File
(
file
.
getParentFile
(),
withClassifer
);
File
out
=
new
File
(
file
.
getParentFile
(),
withClassifer
);
file
=
out
;
file
=
out
;
task
.
getOutputs
().
file
(
file
);
t
his
.
t
ask
.
getOutputs
().
file
(
file
);
task
.
setOutputFile
(
file
);
t
his
.
t
ask
.
setOutputFile
(
file
);
}
}
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackageTask.java
View file @
179e1558
...
@@ -120,8 +120,8 @@ public class RepackageTask extends DefaultTask {
...
@@ -120,8 +120,8 @@ public class RepackageTask extends DefaultTask {
try
{
try
{
FileCopyUtils
.
copy
(
file
,
out
);
FileCopyUtils
.
copy
(
file
,
out
);
}
}
catch
(
IOException
e
)
{
catch
(
IOException
e
x
)
{
throw
new
IllegalStateException
(
e
.
getMessage
(),
e
);
throw
new
IllegalStateException
(
e
x
.
getMessage
(),
ex
);
}
}
file
=
out
;
file
=
out
;
}
}
...
...
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