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
1bcd3de7
Commit
1bcd3de7
authored
Jan 02, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
0f9c7059
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
159 additions
and
56 deletions
+159
-56
howto.md
docs/howto.md
+3
-3
AbstractEndpoint.java
...ringframework/boot/actuate/endpoint/AbstractEndpoint.java
+1
-0
EndpointMBeanExporter.java
...work/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
+6
-0
JolokiaMvcEndpoint.java
...amework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
+2
-0
SimpleHealthIndicatorTests.java
...ework/boot/actuate/health/SimpleHealthIndicatorTests.java
+2
-0
JpaBaseConfiguration.java
...work/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java
+2
-1
AbstractJpaAutoConfigurationTests.java
...oconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java
+0
-4
integration.groovy
spring-boot-cli/samples/integration.groovy
+2
-2
CommandCompleter.java
...rg/springframework/boot/cli/command/CommandCompleter.java
+16
-0
PromptCommand.java
...a/org/springframework/boot/cli/command/PromptCommand.java
+22
-5
Shell.java
...main/java/org/springframework/boot/cli/command/Shell.java
+18
-1
ShellCommand.java
...va/org/springframework/boot/cli/command/ShellCommand.java
+21
-2
StopCommand.java
...ava/org/springframework/boot/cli/command/StopCommand.java
+19
-4
JreProxySelector.java
...ngframework/boot/cli/compiler/grape/JreProxySelector.java
+3
-0
SampleActuatorNoWebApplicationTests.java
.../sample/actuator/SampleActuatorNoWebApplicationTests.java
+1
-1
SampleSecureApplication.java
.../src/main/java/sample/ops/ui/SampleSecureApplication.java
+2
-1
SampleSecureApplicationTests.java
...test/java/sample/ops/ui/SampleSecureApplicationTests.java
+1
-1
SampleServletApplication.java
...rc/main/java/sample/servlet/SampleServletApplication.java
+3
-3
SampleServletApplicationTests.java
...st/java/sample/servlet/SampleServletApplicationTests.java
+2
-2
NonAutoConfigurationSampleTomcatApplicationTests.java
...cat/NonAutoConfigurationSampleTomcatApplicationTests.java
+2
-1
WelcomeController.java
...e-web-jsp/src/main/java/sample/jsp/WelcomeController.java
+2
-2
SpringBootPlugin.java
...ovy/org/springframework/boot/gradle/SpringBootPlugin.java
+1
-2
ProjectLibraries.java
...rg/springframework/boot/gradle/task/ProjectLibraries.java
+8
-8
Repackage.java
...roovy/org/springframework/boot/gradle/task/Repackage.java
+1
-2
ExplodedArchive.java
.../springframework/boot/loader/archive/ExplodedArchive.java
+4
-3
ExplodedArchiveTests.java
...ngframework/boot/loader/archive/ExplodedArchiveTests.java
+2
-2
SimpleJsonParser.java
...ava/org/springframework/boot/config/SimpleJsonParser.java
+5
-0
EmbeddedServletContainer.java
...ework/boot/context/embedded/EmbeddedServletContainer.java
+1
-0
ConfigurationPropertiesBindingPostProcessor.java
...operties/ConfigurationPropertiesBindingPostProcessor.java
+2
-1
LogbackLoggingSystem.java
...gframework/boot/logging/logback/LogbackLoggingSystem.java
+4
-5
MockEmbeddedServletContainerFactory.java
...context/embedded/MockEmbeddedServletContainerFactory.java
+1
-0
No files found.
docs/howto.md
View file @
1bcd3de7
...
@@ -200,7 +200,7 @@ webapp or service:
...
@@ -200,7 +200,7 @@ webapp or service:
<artifactId>spring-boot-starter-jetty</artifactId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency
</dependency
</dependencies>
</dependencies>
## Terminate SSL in Tomcat
## Terminate SSL in Tomcat
...
@@ -818,7 +818,7 @@ change the behaviour:
...
@@ -818,7 +818,7 @@ change the behaviour:
classpath resource or a URL). A separate
`Environment`
property
classpath resource or a URL). A separate
`Environment`
property
source is set up for this document and it can be overridden by
source is set up for this document and it can be overridden by
system properties, environment variables or the command line.
system properties, environment variables or the command line.
No matter what you set in the environment, Spring Boot will always
No matter what you set in the environment, Spring Boot will always
load
`application.properties`
as described above. If YAML is used then
load
`application.properties`
as described above. If YAML is used then
files with the ".yml" extension are also added to the list by default.
files with the ".yml" extension are also added to the list by default.
...
@@ -942,4 +942,4 @@ it with
...
@@ -942,4 +942,4 @@ it with
after which you can run the application with
after which you can run the application with
$ java -jar target/*.jar
$ java -jar target/*.jar
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/AbstractEndpoint.java
View file @
1bcd3de7
...
@@ -55,6 +55,7 @@ public abstract class AbstractEndpoint<T> implements Endpoint<T> {
...
@@ -55,6 +55,7 @@ public abstract class AbstractEndpoint<T> implements Endpoint<T> {
this
.
id
=
id
;
this
.
id
=
id
;
}
}
@Override
public
boolean
isEnabled
()
{
public
boolean
isEnabled
()
{
return
this
.
enabled
;
return
this
.
enabled
;
}
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBeanExporter.java
View file @
1bcd3de7
...
@@ -186,14 +186,17 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
...
@@ -186,14 +186,17 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
// SmartLifeCycle implementation
// SmartLifeCycle implementation
@Override
public
final
int
getPhase
()
{
public
final
int
getPhase
()
{
return
this
.
phase
;
return
this
.
phase
;
}
}
@Override
public
final
boolean
isAutoStartup
()
{
public
final
boolean
isAutoStartup
()
{
return
this
.
autoStartup
;
return
this
.
autoStartup
;
}
}
@Override
public
final
boolean
isRunning
()
{
public
final
boolean
isRunning
()
{
this
.
lifecycleLock
.
lock
();
this
.
lifecycleLock
.
lock
();
try
{
try
{
...
@@ -204,6 +207,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
...
@@ -204,6 +207,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
}
}
}
}
@Override
public
final
void
start
()
{
public
final
void
start
()
{
this
.
lifecycleLock
.
lock
();
this
.
lifecycleLock
.
lock
();
try
{
try
{
...
@@ -217,6 +221,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
...
@@ -217,6 +221,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
}
}
}
}
@Override
public
final
void
stop
()
{
public
final
void
stop
()
{
this
.
lifecycleLock
.
lock
();
this
.
lifecycleLock
.
lock
();
try
{
try
{
...
@@ -229,6 +234,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
...
@@ -229,6 +234,7 @@ public class EndpointMBeanExporter extends MBeanExporter implements SmartLifecyc
}
}
}
}
@Override
public
final
void
stop
(
Runnable
callback
)
{
public
final
void
stop
(
Runnable
callback
)
{
this
.
lifecycleLock
.
lock
();
this
.
lifecycleLock
.
lock
();
try
{
try
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/mvc/JolokiaMvcEndpoint.java
View file @
1bcd3de7
...
@@ -68,6 +68,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
...
@@ -68,6 +68,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
this
.
controller
.
afterPropertiesSet
();
this
.
controller
.
afterPropertiesSet
();
}
}
@Override
public
void
setServletContext
(
ServletContext
servletContext
)
{
public
void
setServletContext
(
ServletContext
servletContext
)
{
this
.
controller
.
setServletContext
(
servletContext
);
this
.
controller
.
setServletContext
(
servletContext
);
}
}
...
@@ -76,6 +77,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
...
@@ -76,6 +77,7 @@ public class JolokiaMvcEndpoint implements MvcEndpoint, InitializingBean,
this
.
controller
.
setInitParameters
(
initParameters
);
this
.
controller
.
setInitParameters
(
initParameters
);
}
}
@Override
public
final
void
setApplicationContext
(
ApplicationContext
context
)
public
final
void
setApplicationContext
(
ApplicationContext
context
)
throws
BeansException
{
throws
BeansException
{
this
.
controller
.
setApplicationContext
(
context
);
this
.
controller
.
setApplicationContext
(
context
);
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/SimpleHealthIndicatorTests.java
View file @
1bcd3de7
...
@@ -34,6 +34,8 @@ import static org.mockito.Mockito.verify;
...
@@ -34,6 +34,8 @@ import static org.mockito.Mockito.verify;
import
static
org
.
mockito
.
Mockito
.
when
;
import
static
org
.
mockito
.
Mockito
.
when
;
/**
/**
* Tests for {@link SimpleHealthIndicator}.
*
* @author Dave Syer
* @author Dave Syer
*/
*/
public
class
SimpleHealthIndicatorTests
{
public
class
SimpleHealthIndicatorTests
{
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaBaseConfiguration.java
View file @
1bcd3de7
...
@@ -73,7 +73,8 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware, Environm
...
@@ -73,7 +73,8 @@ public abstract class JpaBaseConfiguration implements BeanFactoryAware, Environm
@Bean
@Bean
@ConditionalOnMissingBean
(
EntityManagerFactoryInfo
.
class
)
@ConditionalOnMissingBean
(
EntityManagerFactoryInfo
.
class
)
public
LocalContainerEntityManagerFactoryBean
entityManagerFactory
(
JpaVendorAdapter
jpaVendorAdapter
)
{
public
LocalContainerEntityManagerFactoryBean
entityManagerFactory
(
JpaVendorAdapter
jpaVendorAdapter
)
{
LocalContainerEntityManagerFactoryBean
entityManagerFactoryBean
=
new
LocalContainerEntityManagerFactoryBean
();
LocalContainerEntityManagerFactoryBean
entityManagerFactoryBean
=
new
LocalContainerEntityManagerFactoryBean
();
entityManagerFactoryBean
.
setJpaVendorAdapter
(
jpaVendorAdapter
);
entityManagerFactoryBean
.
setJpaVendorAdapter
(
jpaVendorAdapter
);
entityManagerFactoryBean
.
setDataSource
(
getDataSource
());
entityManagerFactoryBean
.
setDataSource
(
getDataSource
());
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/AbstractJpaAutoConfigurationTests.java
View file @
1bcd3de7
...
@@ -137,10 +137,8 @@ public abstract class AbstractJpaAutoConfigurationTests {
...
@@ -137,10 +137,8 @@ public abstract class AbstractJpaAutoConfigurationTests {
@Test
@Test
public
void
usesManuallyDefinedEntityManagerFactoryBeanIfAvailable
()
{
public
void
usesManuallyDefinedEntityManagerFactoryBeanIfAvailable
()
{
setupTestConfiguration
(
TestConfigurationWithEntityManagerFactory
.
class
);
setupTestConfiguration
(
TestConfigurationWithEntityManagerFactory
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
LocalContainerEntityManagerFactoryBean
factoryBean
=
this
.
context
LocalContainerEntityManagerFactoryBean
factoryBean
=
this
.
context
.
getBean
(
LocalContainerEntityManagerFactoryBean
.
class
);
.
getBean
(
LocalContainerEntityManagerFactoryBean
.
class
);
Map
<
String
,
Object
>
map
=
factoryBean
.
getJpaPropertyMap
();
Map
<
String
,
Object
>
map
=
factoryBean
.
getJpaPropertyMap
();
...
@@ -149,10 +147,8 @@ public abstract class AbstractJpaAutoConfigurationTests {
...
@@ -149,10 +147,8 @@ public abstract class AbstractJpaAutoConfigurationTests {
@Test
@Test
public
void
usesManuallyDefinedTransactionManagerBeanIfAvailable
()
{
public
void
usesManuallyDefinedTransactionManagerBeanIfAvailable
()
{
setupTestConfiguration
(
TestConfigurationWithTransactionManager
.
class
);
setupTestConfiguration
(
TestConfigurationWithTransactionManager
.
class
);
this
.
context
.
refresh
();
this
.
context
.
refresh
();
PlatformTransactionManager
txManager
=
this
.
context
PlatformTransactionManager
txManager
=
this
.
context
.
getBean
(
PlatformTransactionManager
.
class
);
.
getBean
(
PlatformTransactionManager
.
class
);
assertThat
(
txManager
,
instanceOf
(
CustomJpaTransactionManager
.
class
));
assertThat
(
txManager
,
instanceOf
(
CustomJpaTransactionManager
.
class
));
...
...
spring-boot-cli/samples/integration.groovy
View file @
1bcd3de7
...
@@ -8,7 +8,7 @@ class SpringIntegrationExample implements CommandLineRunner {
...
@@ -8,7 +8,7 @@ class SpringIntegrationExample implements CommandLineRunner {
DirectChannel
input
()
{
DirectChannel
input
()
{
new
DirectChannel
();
new
DirectChannel
();
}
}
@Override
@Override
void
run
(
String
...
args
)
{
void
run
(
String
...
args
)
{
print
new
MessagingTemplate
(
input
()).
convertSendAndReceive
(
"World"
)
print
new
MessagingTemplate
(
input
()).
convertSendAndReceive
(
"World"
)
...
@@ -23,4 +23,4 @@ class HelloTransformer {
...
@@ -23,4 +23,4 @@ class HelloTransformer {
"Hello, ${payload}"
"Hello, ${payload}"
}
}
}
}
\ No newline at end of file
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/CommandCompleter.java
View file @
1bcd3de7
/*
* Copyright 2012-2014 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.io.IOException
;
import
java.io.IOException
;
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/PromptCommand.java
View file @
1bcd3de7
/*
* Copyright 2012-2013 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
org.springframework.boot.cli.command.AbstractCommand
;
/**
/**
* @author Dave Syer
* @author Dave Syer
...
@@ -10,7 +25,8 @@ public class PromptCommand extends AbstractCommand {
...
@@ -10,7 +25,8 @@ public class PromptCommand extends AbstractCommand {
private
final
ShellCommand
runCmd
;
private
final
ShellCommand
runCmd
;
public
PromptCommand
(
ShellCommand
runCmd
)
{
public
PromptCommand
(
ShellCommand
runCmd
)
{
super
(
"prompt"
,
"Change the prompt used with the current 'shell' command. Execute with no arguments to return to the previous value."
);
super
(
"prompt"
,
"Change the prompt used with the current 'shell' command. "
+
"Execute with no arguments to return to the previous value."
);
this
.
runCmd
=
runCmd
;
this
.
runCmd
=
runCmd
;
}
}
...
@@ -18,10 +34,11 @@ public class PromptCommand extends AbstractCommand {
...
@@ -18,10 +34,11 @@ public class PromptCommand extends AbstractCommand {
public
void
run
(
String
...
strings
)
throws
Exception
{
public
void
run
(
String
...
strings
)
throws
Exception
{
if
(
strings
.
length
>
0
)
{
if
(
strings
.
length
>
0
)
{
for
(
String
string
:
strings
)
{
for
(
String
string
:
strings
)
{
runCmd
.
pushPrompt
(
string
+
" "
);
this
.
runCmd
.
pushPrompt
(
string
+
" "
);
}
}
}
else
{
}
runCmd
.
popPrompt
();
else
{
this
.
runCmd
.
popPrompt
();
}
}
}
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/Shell.java
View file @
1bcd3de7
/*
* Copyright 2012-2013 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -12,7 +28,8 @@ public class Shell {
...
@@ -12,7 +28,8 @@ public class Shell {
public
static
void
main
(
String
...
args
)
throws
IOException
{
public
static
void
main
(
String
...
args
)
throws
IOException
{
if
(
args
.
length
==
0
)
{
if
(
args
.
length
==
0
)
{
SpringCli
.
main
(
"shell"
);
// right into the REPL by default
SpringCli
.
main
(
"shell"
);
// right into the REPL by default
}
else
{
}
else
{
SpringCli
.
main
(
args
);
SpringCli
.
main
(
args
);
}
}
}
}
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/ShellCommand.java
View file @
1bcd3de7
/*
* Copyright 2012-2013 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
java.io.IOException
;
import
java.io.IOException
;
...
@@ -26,8 +42,11 @@ import org.springframework.util.StringUtils;
...
@@ -26,8 +42,11 @@ import org.springframework.util.StringUtils;
public
class
ShellCommand
extends
AbstractCommand
{
public
class
ShellCommand
extends
AbstractCommand
{
private
String
defaultPrompt
=
"$ "
;
private
String
defaultPrompt
=
"$ "
;
private
SpringCli
springCli
;
private
SpringCli
springCli
;
private
String
prompt
=
this
.
defaultPrompt
;
private
String
prompt
=
this
.
defaultPrompt
;
private
Stack
<
String
>
prompts
=
new
Stack
<
String
>();
private
Stack
<
String
>
prompts
=
new
Stack
<
String
>();
public
ShellCommand
(
SpringCli
springCli
)
{
public
ShellCommand
(
SpringCli
springCli
)
{
...
@@ -186,8 +205,8 @@ public class ShellCommand extends AbstractCommand {
...
@@ -186,8 +205,8 @@ public class ShellCommand extends AbstractCommand {
String
version
=
ShellCommand
.
class
.
getPackage
().
getImplementationVersion
();
String
version
=
ShellCommand
.
class
.
getPackage
().
getImplementationVersion
();
version
=
(
version
==
null
?
""
:
" (v"
+
version
+
")"
);
version
=
(
version
==
null
?
""
:
" (v"
+
version
+
")"
);
System
.
out
.
println
(
"Spring Boot CLI"
+
version
);
System
.
out
.
println
(
"Spring Boot CLI"
+
version
);
System
.
out
System
.
out
.
println
(
"Hit TAB to complete. Type 'help' and hit "
.
println
(
"Hit TAB to complete. Type 'help' and hit
RETURN for help, and 'quit' to exit."
);
+
"
RETURN for help, and 'quit' to exit."
);
}
}
public
void
pushPrompt
(
String
prompt
)
{
public
void
pushPrompt
(
String
prompt
)
{
...
...
spring-boot-cli/src/main/java/org/springframework/boot/cli/command/StopCommand.java
View file @
1bcd3de7
/*
* Copyright 2012-2013 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
cli
.
command
;
package
org
.
springframework
.
boot
.
cli
.
command
;
import
org.springframework.boot.cli.command.AbstractCommand
;
import
org.springframework.boot.cli.command.RunCommand
;
/**
/**
* @author Jon Brisbin
* @author Jon Brisbin
...
@@ -11,13 +25,14 @@ public class StopCommand extends AbstractCommand {
...
@@ -11,13 +25,14 @@ public class StopCommand extends AbstractCommand {
private
final
RunCommand
runCmd
;
private
final
RunCommand
runCmd
;
public
StopCommand
(
RunCommand
runCmd
)
{
public
StopCommand
(
RunCommand
runCmd
)
{
super
(
"stop"
,
"Stop the currently-running application started with the 'run' command."
);
super
(
"stop"
,
"Stop the currently-running application started with the 'run' command."
);
this
.
runCmd
=
runCmd
;
this
.
runCmd
=
runCmd
;
}
}
@Override
@Override
public
void
run
(
String
...
strings
)
throws
Exception
{
public
void
run
(
String
...
strings
)
throws
Exception
{
runCmd
.
stop
();
this
.
runCmd
.
stop
();
}
}
}
}
spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/JreProxySelector.java
View file @
1bcd3de7
...
@@ -47,6 +47,7 @@ public final class JreProxySelector implements ProxySelector {
...
@@ -47,6 +47,7 @@ public final class JreProxySelector implements ProxySelector {
public
JreProxySelector
()
{
public
JreProxySelector
()
{
}
}
@Override
public
Proxy
getProxy
(
RemoteRepository
repository
)
{
public
Proxy
getProxy
(
RemoteRepository
repository
)
{
List
<
java
.
net
.
Proxy
>
proxies
=
null
;
List
<
java
.
net
.
Proxy
>
proxies
=
null
;
try
{
try
{
...
@@ -95,6 +96,7 @@ public final class JreProxySelector implements ProxySelector {
...
@@ -95,6 +96,7 @@ public final class JreProxySelector implements ProxySelector {
public
static
final
Authentication
INSTANCE
=
new
JreProxyAuthentication
();
public
static
final
Authentication
INSTANCE
=
new
JreProxyAuthentication
();
@Override
public
void
fill
(
AuthenticationContext
context
,
String
key
,
public
void
fill
(
AuthenticationContext
context
,
String
key
,
Map
<
String
,
String
>
data
)
{
Map
<
String
,
String
>
data
)
{
Proxy
proxy
=
context
.
getProxy
();
Proxy
proxy
=
context
.
getProxy
();
...
@@ -136,6 +138,7 @@ public final class JreProxySelector implements ProxySelector {
...
@@ -136,6 +138,7 @@ public final class JreProxySelector implements ProxySelector {
}
}
}
}
@Override
public
void
digest
(
AuthenticationDigest
digest
)
{
public
void
digest
(
AuthenticationDigest
digest
)
{
// we don't know anything about the JRE's current authenticator, assume the
// we don't know anything about the JRE's current authenticator, assume the
// worst (i.e. interactive)
// worst (i.e. interactive)
...
...
spring-boot-samples/spring-boot-sample-actuator-noweb/src/test/java/sample/actuator/SampleActuatorNoWebApplicationTests.java
View file @
1bcd3de7
...
@@ -59,7 +59,7 @@ public class SampleActuatorNoWebApplicationTests {
...
@@ -59,7 +59,7 @@ public class SampleActuatorNoWebApplicationTests {
context
.
close
();
context
.
close
();
}
}
}
}
@Test
@Test
public
void
endpointsExist
()
throws
Exception
{
public
void
endpointsExist
()
throws
Exception
{
assertNotNull
(
context
.
getBean
(
MetricsEndpoint
.
class
));
assertNotNull
(
context
.
getBean
(
MetricsEndpoint
.
class
));
...
...
spring-boot-samples/spring-boot-sample-secure/src/main/java/sample/ops/ui/SampleSecureApplication.java
View file @
1bcd3de7
...
@@ -53,7 +53,8 @@ public class SampleSecureApplication extends WebMvcConfigurerAdapter {
...
@@ -53,7 +53,8 @@ public class SampleSecureApplication extends WebMvcConfigurerAdapter {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// Set user password to "password" for demo purposes only
// Set user password to "password" for demo purposes only
new
SpringApplicationBuilder
(
SampleSecureApplication
.
class
).
properties
(
new
SpringApplicationBuilder
(
SampleSecureApplication
.
class
).
properties
(
"security.basic.enabled=false"
,
"security.user.password=password"
).
run
(
args
);
"security.basic.enabled=false"
,
"security.user.password=password"
).
run
(
args
);
}
}
@Override
@Override
...
...
spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/ops/ui/SampleSecureApplicationTests.java
View file @
1bcd3de7
...
@@ -57,7 +57,7 @@ public class SampleSecureApplicationTests {
...
@@ -57,7 +57,7 @@ public class SampleSecureApplicationTests {
new
Callable
<
ConfigurableApplicationContext
>()
{
new
Callable
<
ConfigurableApplicationContext
>()
{
@Override
@Override
public
ConfigurableApplicationContext
call
()
throws
Exception
{
public
ConfigurableApplicationContext
call
()
throws
Exception
{
return
(
ConfigurableApplicationContext
)
SpringApplication
return
SpringApplication
.
run
(
SampleSecureApplication
.
class
);
.
run
(
SampleSecureApplication
.
class
);
}
}
});
});
...
...
spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java
View file @
1bcd3de7
...
@@ -32,14 +32,14 @@ import org.springframework.context.annotation.Configuration;
...
@@ -32,14 +32,14 @@ import org.springframework.context.annotation.Configuration;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
public
class
SampleServletApplication
{
public
class
SampleServletApplication
{
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
@Bean
@Bean
public
Servlet
dispatcherServlet
()
{
public
Servlet
dispatcherServlet
()
{
return
new
GenericServlet
()
{
return
new
GenericServlet
()
{
@Override
@Override
public
void
service
(
ServletRequest
req
,
ServletResponse
res
)
throws
ServletException
,
public
void
service
(
ServletRequest
req
,
ServletResponse
res
)
IOException
{
throws
ServletException
,
IOException
{
res
.
setContentType
(
"text/plain"
);
res
.
setContentType
(
"text/plain"
);
res
.
getWriter
().
append
(
"Hello World"
);
res
.
getWriter
().
append
(
"Hello World"
);
}
}
...
...
spring-boot-samples/spring-boot-sample-servlet/src/test/java/sample/servlet/SampleServletApplicationTests.java
View file @
1bcd3de7
...
@@ -67,8 +67,8 @@ public class SampleServletApplicationTests {
...
@@ -67,8 +67,8 @@ public class SampleServletApplicationTests {
@Test
@Test
public
void
testHome
()
throws
Exception
{
public
void
testHome
()
throws
Exception
{
ResponseEntity
<
String
>
entity
=
getRestTemplate
(
"user"
,
getPassword
())
.
getForEntity
(
ResponseEntity
<
String
>
entity
=
getRestTemplate
(
"user"
,
getPassword
())
"http://localhost:8080"
,
String
.
class
);
.
getForEntity
(
"http://localhost:8080"
,
String
.
class
);
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
assertEquals
(
HttpStatus
.
OK
,
entity
.
getStatusCode
());
assertEquals
(
"Hello World"
,
entity
.
getBody
());
assertEquals
(
"Hello World"
,
entity
.
getBody
());
}
}
...
...
spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/NonAutoConfigurationSampleTomcatApplicationTests.java
View file @
1bcd3de7
...
@@ -56,7 +56,8 @@ public class NonAutoConfigurationSampleTomcatApplicationTests {
...
@@ -56,7 +56,8 @@ public class NonAutoConfigurationSampleTomcatApplicationTests {
@Configuration
@Configuration
@Import
({
EmbeddedServletContainerAutoConfiguration
.
class
,
@Import
({
EmbeddedServletContainerAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
DispatcherServletAutoConfiguration
.
class
,
WebMvcAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
PropertyPlaceholderAutoConfiguration
.
class
})
@ComponentScan
(
basePackageClasses
=
{
SampleController
.
class
,
HelloWorldService
.
class
})
@ComponentScan
(
basePackageClasses
=
{
SampleController
.
class
,
HelloWorldService
.
class
})
public
static
class
NonAutoConfigurationSampleTomcatApplication
{
public
static
class
NonAutoConfigurationSampleTomcatApplication
{
...
...
spring-boot-samples/spring-boot-sample-web-jsp/src/main/java/sample/jsp/WelcomeController.java
View file @
1bcd3de7
...
@@ -14,9 +14,9 @@ public class WelcomeController {
...
@@ -14,9 +14,9 @@ public class WelcomeController {
private
String
message
=
"Hello World"
;
private
String
message
=
"Hello World"
;
@RequestMapping
(
"/"
)
@RequestMapping
(
"/"
)
public
String
welcome
(
Map
<
String
,
Object
>
model
)
{
public
String
welcome
(
Map
<
String
,
Object
>
model
)
{
model
.
put
(
"time"
,
new
Date
());
model
.
put
(
"time"
,
new
Date
());
model
.
put
(
"message"
,
message
);
model
.
put
(
"message"
,
message
);
return
"welcome"
;
return
"welcome"
;
}
}
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/SpringBootPlugin.java
View file @
1bcd3de7
...
@@ -43,8 +43,7 @@ public class SpringBootPlugin implements Plugin<Project> {
...
@@ -43,8 +43,7 @@ public class SpringBootPlugin implements Plugin<Project> {
// register BootRepackage so that we can use
// register BootRepackage so that we can use
// task foo(type: BootRepackage) {}
// task foo(type: BootRepackage) {}
project
.
getExtensions
().
getExtraProperties
()
project
.
getExtensions
().
getExtraProperties
().
set
(
"BootRepackage"
,
Repackage
.
class
);
.
set
(
"BootRepackage"
,
Repackage
.
class
);
Repackage
packageTask
=
addRepackageTask
(
project
);
Repackage
packageTask
=
addRepackageTask
(
project
);
ensureTaskRunsOnAssembly
(
project
,
packageTask
);
ensureTaskRunsOnAssembly
(
project
,
packageTask
);
addRunJarTask
(
project
);
addRunJarTask
(
project
);
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/ProjectLibraries.java
View file @
1bcd3de7
package
org
.
springframework
.
boot
.
gradle
.
task
;
package
org
.
springframework
.
boot
.
gradle
.
task
;
import
java.io.File
;
import
java.io.File
;
...
@@ -20,6 +21,7 @@ class ProjectLibraries implements Libraries {
...
@@ -20,6 +21,7 @@ class ProjectLibraries implements Libraries {
private
final
Project
project
;
private
final
Project
project
;
private
String
providedConfigurationName
=
"providedRuntime"
;
private
String
providedConfigurationName
=
"providedRuntime"
;
private
String
customConfigurationName
=
null
;
private
String
customConfigurationName
=
null
;
/**
/**
...
@@ -47,18 +49,16 @@ class ProjectLibraries implements Libraries {
...
@@ -47,18 +49,16 @@ class ProjectLibraries implements Libraries {
@Override
@Override
public
void
doWithLibraries
(
LibraryCallback
callback
)
throws
IOException
{
public
void
doWithLibraries
(
LibraryCallback
callback
)
throws
IOException
{
FileCollection
custom
=
this
.
customConfigurationName
!=
null
?
this
.
project
FileCollection
custom
=
this
.
customConfigurationName
!=
null
?
this
.
project
.
getConfigurations
().
findByName
(
.
getConfigurations
().
findByName
(
this
.
customConfigurationName
)
:
null
;
this
.
customConfigurationName
)
:
null
;
if
(
custom
!=
null
)
{
if
(
custom
!=
null
)
{
libraries
(
LibraryScope
.
CUSTOM
,
custom
,
callback
);
libraries
(
LibraryScope
.
CUSTOM
,
custom
,
callback
);
}
}
else
{
else
{
FileCollection
compile
=
this
.
project
.
getConfigurations
().
getByName
(
"compile"
);
FileCollection
compile
=
this
.
project
.
getConfigurations
()
.
getByName
(
"compile"
);
FileCollection
runtime
=
this
.
project
.
getConfigurations
()
FileCollection
runtime
=
this
.
project
.
getConfigurations
().
getByName
(
"runtime"
);
.
getByName
(
"runtime"
);
runtime
=
runtime
.
minus
(
compile
);
runtime
=
runtime
.
minus
(
compile
);
FileCollection
provided
=
this
.
project
.
getConfigurations
().
findByName
(
FileCollection
provided
=
this
.
project
.
getConfigurations
().
findByName
(
...
...
spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/task/Repackage.java
View file @
1bcd3de7
...
@@ -57,8 +57,7 @@ public class Repackage extends DefaultTask {
...
@@ -57,8 +57,7 @@ public class Repackage extends DefaultTask {
}
}
if
(
this
.
customConfiguration
!=
null
)
{
if
(
this
.
customConfiguration
!=
null
)
{
libraries
.
setCustomConfigurationName
(
this
.
customConfiguration
);
libraries
.
setCustomConfigurationName
(
this
.
customConfiguration
);
}
}
else
if
(
extension
.
getCustomConfiguration
()
!=
null
)
{
else
if
(
extension
.
getCustomConfiguration
()
!=
null
)
{
libraries
.
setCustomConfigurationName
(
extension
.
getCustomConfiguration
());
libraries
.
setCustomConfigurationName
(
extension
.
getCustomConfiguration
());
}
}
project
.
getTasks
().
withType
(
Jar
.
class
,
new
Action
<
Jar
>()
{
project
.
getTasks
().
withType
(
Jar
.
class
,
new
Action
<
Jar
>()
{
...
...
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/archive/ExplodedArchive.java
View file @
1bcd3de7
...
@@ -39,7 +39,7 @@ import org.springframework.boot.loader.AsciiBytes;
...
@@ -39,7 +39,7 @@ import org.springframework.boot.loader.AsciiBytes;
/**
/**
* {@link Archive} implementation backed by an exploded archive directory.
* {@link Archive} implementation backed by an exploded archive directory.
*
*
* @author Phillip Webb
* @author Phillip Webb
*/
*/
public
class
ExplodedArchive
extends
Archive
{
public
class
ExplodedArchive
extends
Archive
{
...
@@ -72,7 +72,8 @@ public class ExplodedArchive extends Archive {
...
@@ -72,7 +72,8 @@ public class ExplodedArchive extends Archive {
private
void
buildEntries
(
File
file
)
{
private
void
buildEntries
(
File
file
)
{
if
(!
file
.
equals
(
this
.
root
))
{
if
(!
file
.
equals
(
this
.
root
))
{
String
name
=
file
.
toURI
().
getPath
().
substring
(
root
.
toURI
().
getPath
().
length
());
String
name
=
file
.
toURI
().
getPath
()
.
substring
(
root
.
toURI
().
getPath
().
length
());
FileEntry
entry
=
new
FileEntry
(
new
AsciiBytes
(
name
),
file
);
FileEntry
entry
=
new
FileEntry
(
new
AsciiBytes
(
name
),
file
);
this
.
entries
.
put
(
entry
.
getName
(),
entry
);
this
.
entries
.
put
(
entry
.
getName
(),
entry
);
}
}
...
@@ -88,7 +89,7 @@ public class ExplodedArchive extends Archive {
...
@@ -88,7 +89,7 @@ public class ExplodedArchive extends Archive {
@Override
@Override
public
URL
getUrl
()
throws
MalformedURLException
{
public
URL
getUrl
()
throws
MalformedURLException
{
FilteredURLStreamHandler
handler
=
new
FilteredURLStreamHandler
();
FilteredURLStreamHandler
handler
=
new
FilteredURLStreamHandler
();
return
new
URL
(
"file"
,
""
,
-
1
,
this
.
root
.
toURI
().
getPath
(),
handler
);
return
new
URL
(
"file"
,
""
,
-
1
,
this
.
root
.
toURI
().
getPath
(),
handler
);
}
}
@Override
@Override
...
...
spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/archive/ExplodedArchiveTests.java
View file @
1bcd3de7
...
@@ -121,8 +121,8 @@ public class ExplodedArchiveTests {
...
@@ -121,8 +121,8 @@ public class ExplodedArchiveTests {
Archive
nested
=
this
.
archive
.
getNestedArchive
(
entry
);
Archive
nested
=
this
.
archive
.
getNestedArchive
(
entry
);
Map
<
String
,
Entry
>
nestedEntries
=
getEntriesMap
(
nested
);
Map
<
String
,
Entry
>
nestedEntries
=
getEntriesMap
(
nested
);
assertThat
(
nestedEntries
.
size
(),
equalTo
(
1
));
assertThat
(
nestedEntries
.
size
(),
equalTo
(
1
));
assertThat
(
nested
.
getUrl
().
toString
(),
assertThat
(
nested
.
getUrl
().
toString
(),
equalTo
(
"file:"
equalTo
(
"file:"
+
this
.
rootFolder
.
toURI
().
getPath
()
+
"d/"
));
+
this
.
rootFolder
.
toURI
().
getPath
()
+
"d/"
));
}
}
@Test
@Test
...
...
spring-boot/src/main/java/org/springframework/boot/config/SimpleJsonParser.java
View file @
1bcd3de7
...
@@ -76,24 +76,29 @@ public class SimpleJsonParser implements JsonParser {
...
@@ -76,24 +76,29 @@ public class SimpleJsonParser implements JsonParser {
if
(
json
.
startsWith
(
"["
))
{
if
(
json
.
startsWith
(
"["
))
{
return
parseListInternal
(
json
);
return
parseListInternal
(
json
);
}
}
if
(
json
.
startsWith
(
"{"
))
{
if
(
json
.
startsWith
(
"{"
))
{
return
parseMapInternal
(
json
);
return
parseMapInternal
(
json
);
}
}
if
(
json
.
startsWith
(
"\""
))
{
if
(
json
.
startsWith
(
"\""
))
{
return
trimTrailingCharacter
(
trimLeadingCharacter
(
json
,
'"'
),
'"'
);
return
trimTrailingCharacter
(
trimLeadingCharacter
(
json
,
'"'
),
'"'
);
}
}
try
{
try
{
return
Long
.
valueOf
(
json
);
return
Long
.
valueOf
(
json
);
}
}
catch
(
NumberFormatException
e
)
{
catch
(
NumberFormatException
e
)
{
// ignore
// ignore
}
}
try
{
try
{
return
Double
.
valueOf
(
json
);
return
Double
.
valueOf
(
json
);
}
}
catch
(
NumberFormatException
e
)
{
catch
(
NumberFormatException
e
)
{
// ignore
// ignore
}
}
return
json
;
return
json
;
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainer.java
View file @
1bcd3de7
...
@@ -45,6 +45,7 @@ public interface EmbeddedServletContainer {
...
@@ -45,6 +45,7 @@ public interface EmbeddedServletContainer {
// Do nothing
// Do nothing
}
}
@Override
public
int
getPort
()
{
public
int
getPort
()
{
return
0
;
return
0
;
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/ConfigurationPropertiesBindingPostProcessor.java
View file @
1bcd3de7
...
@@ -330,7 +330,8 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
...
@@ -330,7 +330,8 @@ public class ConfigurationPropertiesBindingPostProcessor implements BeanPostProc
if
(
resource
!=
null
&&
resource
.
exists
())
{
if
(
resource
!=
null
&&
resource
.
exists
())
{
for
(
PropertySourceLoader
loader
:
loaders
)
{
for
(
PropertySourceLoader
loader
:
loaders
)
{
if
(
loader
.
supports
(
resource
))
{
if
(
loader
.
supports
(
resource
))
{
PropertySource
<?>
propertySource
=
loader
.
load
(
resource
.
getDescription
(),
resource
);
PropertySource
<?>
propertySource
=
loader
.
load
(
resource
.
getDescription
(),
resource
);
propertySources
.
addFirst
(
propertySource
);
propertySources
.
addFirst
(
propertySource
);
}
}
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackLoggingSystem.java
View file @
1bcd3de7
...
@@ -77,11 +77,10 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem {
...
@@ -77,11 +77,10 @@ public class LogbackLoggingSystem extends AbstractLoggingSystem {
Assert
.
notNull
(
configLocation
,
"ConfigLocation must not be null"
);
Assert
.
notNull
(
configLocation
,
"ConfigLocation must not be null"
);
String
resolvedLocation
=
SystemPropertyUtils
.
resolvePlaceholders
(
configLocation
);
String
resolvedLocation
=
SystemPropertyUtils
.
resolvePlaceholders
(
configLocation
);
ILoggerFactory
factory
=
StaticLoggerBinder
.
getSingleton
().
getLoggerFactory
();
ILoggerFactory
factory
=
StaticLoggerBinder
.
getSingleton
().
getLoggerFactory
();
Assert
.
isInstanceOf
(
Assert
.
isInstanceOf
(
LoggerContext
.
class
,
factory
,
LoggerContext
.
class
,
"LoggerFactory is not a Logback LoggerContext but "
factory
,
+
"Logback is on the classpath. Either remove Logback "
"LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation ("
+
"or the competing implementation ("
+
factory
.
getClass
()
+
")"
);
+
factory
.
getClass
()
+
")"
);
LoggerContext
context
=
(
LoggerContext
)
factory
;
LoggerContext
context
=
(
LoggerContext
)
factory
;
context
.
stop
();
context
.
stop
();
try
{
try
{
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/MockEmbeddedServletContainerFactory.java
View file @
1bcd3de7
...
@@ -179,6 +179,7 @@ public class MockEmbeddedServletContainerFactory extends
...
@@ -179,6 +179,7 @@ public class MockEmbeddedServletContainerFactory extends
return
this
.
registeredFilters
;
return
this
.
registeredFilters
;
}
}
@Override
public
int
getPort
()
{
public
int
getPort
()
{
return
this
.
port
;
return
this
.
port
;
}
}
...
...
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