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
7a8be3d6
Commit
7a8be3d6
authored
May 28, 2014
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Spring Framework bom and fully exclude commons-logging
Closes #955 Closes #978
parent
6fbafc3c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
113 deletions
+78
-113
AutoConfigurationReportLoggingInitializerTests.java
...gging/AutoConfigurationReportLoggingInitializerTests.java
+23
-7
pom.xml
spring-boot-cli/pom.xml
+12
-7
pom.xml
spring-boot-dependencies/pom.xml
+31
-93
pom.xml
spring-boot-parent/pom.xml
+6
-0
LogbackInitializer.java
...springframework/boot/loader/tools/LogbackInitializer.java
+2
-1
pom.xml
spring-boot/pom.xml
+4
-5
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/AutoConfigurationReportLoggingInitializerTests.java
View file @
7a8be3d6
...
...
@@ -16,14 +16,15 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
logging
;
import
java.lang.reflect.Field
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogConfigurationException
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.impl.LogFactoryImpl
;
import
org.apache.commons.logging.impl.NoOpLog
;
import
org.apache.commons.logging.impl.SLF4JLogFactory
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Test
;
...
...
@@ -41,6 +42,7 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.context.annotation.Import
;
import
org.springframework.context.event.ContextRefreshedEvent
;
import
org.springframework.mock.web.MockServletContext
;
import
org.springframework.util.ReflectionUtils
;
import
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
;
import
static
org
.
hamcrest
.
Matchers
.
containsString
;
...
...
@@ -56,7 +58,7 @@ import static org.mockito.Mockito.mock;
/**
* Tests for {@link AutoConfigurationReportLoggingInitializer}.
*
*
* @author Phillip Webb
*/
public
class
AutoConfigurationReportLoggingInitializerTests
{
...
...
@@ -71,6 +73,10 @@ public class AutoConfigurationReportLoggingInitializerTests {
protected
List
<
String
>
infoLog
=
new
ArrayList
<
String
>();
private
Field
logFactoryField
;
private
LogFactory
originalLogFactory
;
@Before
public
void
setup
()
{
setupLogging
(
true
,
true
);
...
...
@@ -98,15 +104,25 @@ public class AutoConfigurationReportLoggingInitializerTests {
}
}).
given
(
this
.
log
).
info
(
anyObject
());
LogFactory
.
releaseAll
();
System
.
setProperty
(
LogFactory
.
FACTORY_PROPERTY
,
MockLogFactory
.
class
.
getName
());
try
{
this
.
logFactoryField
=
LogFactory
.
class
.
getDeclaredField
(
"logFactory"
);
ReflectionUtils
.
makeAccessible
(
this
.
logFactoryField
);
this
.
originalLogFactory
=
(
LogFactory
)
ReflectionUtils
.
getField
(
this
.
logFactoryField
,
null
);
ReflectionUtils
.
setField
(
this
.
logFactoryField
,
null
,
new
MockLogFactory
());
}
catch
(
Exception
e
)
{
throw
new
IllegalStateException
(
"Failed to set logFactory"
,
e
);
}
this
.
initializer
=
new
AutoConfigurationReportLoggingInitializer
();
}
@After
public
void
cleanup
()
{
System
.
clearProperty
(
LogFactory
.
FACTORY_PROPERTIES
);
LogFactory
.
releaseAll
();
ReflectionUtils
.
setField
(
this
.
logFactoryField
,
null
,
this
.
originalLogFactory
);
}
@Test
...
...
@@ -199,7 +215,7 @@ public class AutoConfigurationReportLoggingInitializerTests {
containsString
(
"Unable to provide auto-configuration report"
));
}
public
static
class
MockLogFactory
extends
LogFactoryImpl
{
public
static
class
MockLogFactory
extends
SLF4JLogFactory
{
@Override
public
Log
getInstance
(
String
name
)
throws
LogConfigurationException
{
if
(
AutoConfigurationReportLoggingInitializer
.
class
.
getName
().
equals
(
name
))
{
...
...
spring-boot-cli/pom.xml
View file @
7a8be3d6
...
...
@@ -104,17 +104,22 @@
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-transport-http
</artifactId>
<exclusions>
<exclusion>
<artifactId>
jcl-over-slf4j
</artifactId>
<groupId>
org.slf4j
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.eclipse.aether
</groupId>
<artifactId>
aether-util
</artifactId>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<!-- Runtime -->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-nop
</artifactId>
<version>
1.7.7
</version>
<scope>
runtime
</scope>
</dependency>
<!-- Provided -->
<dependency>
<groupId>
org.codehaus.groovy
</groupId>
...
...
@@ -125,7 +130,7 @@
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependency>
</dependencies>
<build>
<plugins>
...
...
spring-boot-dependencies/pom.xml
View file @
7a8be3d6
...
...
@@ -474,6 +474,12 @@
<groupId>
org.apache.velocity
</groupId>
<artifactId>
velocity-tools
</artifactId>
<version>
${velocity-tools.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.aspectj
</groupId>
...
...
@@ -594,6 +600,12 @@
<groupId>
org.crashub
</groupId>
<artifactId>
crash.connectors.ssh
</artifactId>
<version>
${crashub.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.crashub
</groupId>
...
...
@@ -804,111 +816,22 @@
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-aop
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-aspects
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-beans
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-context-support
</artifactId>
<artifactId>
spring-framework-bom
</artifactId>
<version>
${spring.version}
</version>
<scope>
import
</scope>
<type>
pom
</type>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-core
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-expression
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-instrument
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jdbc
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-jms
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-messaging
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-orm
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-oxm
</artifactId>
<version>
${spring.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-lang
</groupId>
<artifactId>
commons-lang
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-test
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-tx
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-web
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc
</artifactId>
<version>
${spring.version}
</version>
<exclusions>
<exclusion>
<artifactId>
commons-logging
</artifactId>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-webmvc-portlet
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-websocket
</artifactId>
<version>
${spring.version}
</version>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
springloaded
</artifactId>
...
...
@@ -968,6 +891,21 @@
<scope>
import
</scope>
<type>
pom
</type>
</dependency>
<dependency>
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-http
</artifactId>
<version>
${spring-integration.version}
</version>
<exclusions>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging
</artifactId>
</exclusion>
<exclusion>
<groupId>
commons-logging
</groupId>
<artifactId>
commons-logging-api
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.springframework.mobile
</groupId>
<artifactId>
spring-mobile-device
</artifactId>
...
...
spring-boot-parent/pom.xml
View file @
7a8be3d6
...
...
@@ -369,6 +369,12 @@
<requireJavaVersion>
<version>
1.7
</version>
</requireJavaVersion>
<bannedDependencies>
<excludes>
<exclude>
commons-logging:commons-logging:*:compile
</exclude>
</excludes>
<searchTransitive>
true
</searchTransitive>
</bannedDependencies>
</rules>
</configuration>
</execution>
...
...
spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/LogbackInitializer.java
View file @
7a8be3d6
...
...
@@ -29,7 +29,8 @@ import ch.qos.logback.classic.Level;
public
class
LogbackInitializer
{
public
static
void
initialize
()
{
if
(
ClassUtils
.
isPresent
(
"org.slf4j.impl.StaticLoggerBinder"
,
null
))
{
if
(
ClassUtils
.
isPresent
(
"org.slf4j.impl.StaticLoggerBinder"
,
null
)
&&
ClassUtils
.
isPresent
(
"ch.qos.logback.classic.Logger"
,
null
))
{
new
Initializer
().
setRootLogLevel
();
}
}
...
...
spring-boot/pom.xml
View file @
7a8be3d6
...
...
@@ -20,6 +20,10 @@
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-core
</artifactId>
...
...
@@ -150,11 +154,6 @@
<artifactId>
spring-webmvc
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.slf4j
</groupId>
<artifactId>
jcl-over-slf4j
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
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