mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
parent
0ec0851a4f
commit
95373af374
@ -42,17 +42,18 @@ public class SpringCompilerAutoConfiguration extends CompilerAutoConfiguration {
|
||||
"org.springframework.bootstrap.SpringApplication").add(
|
||||
"org.springframework.zero", "spring-autoconfigure",
|
||||
"0.5.0.BUILD-SNAPSHOT");
|
||||
dependencies.ifAnyResourcesPresent("logback.xml").add("ch.qos.logback",
|
||||
"logback-classic", "1.0.7");
|
||||
dependencies.ifNotAdded("cg.qos.logback", "logback-classic")
|
||||
.ifAnyResourcesPresent("log4j.properties", "log4j.xml")
|
||||
.add("org.slf4j", "slf4j-log4j12", "1.7.5")
|
||||
.add("log4j", "log4j", "1.2.16")
|
||||
.add("org.slf4j", "jcl-over-slf4j", "1.7.5");
|
||||
dependencies.ifNotAdded("ch.qos.logback", "logback-classic")
|
||||
.ifNotAdded("org.slf4j", "slf4j-log4j12")
|
||||
.add("org.slf4j", "slf4j-jdk14", "1.7.5")
|
||||
.add("org.slf4j", "jcl-over-slf4j", "1.7.5");
|
||||
// FIXME currently broken on CI + decide how relates to logging
|
||||
// dependencies.ifAnyResourcesPresent("logback.xml").add("ch.qos.logback",
|
||||
// "logback-classic", "1.0.7");
|
||||
// dependencies.ifNotAdded("cg.qos.logback", "logback-classic")
|
||||
// .ifAnyResourcesPresent("log4j.properties", "log4j.xml")
|
||||
// .add("org.slf4j", "slf4j-log4j12", "1.7.5")
|
||||
// .add("log4j", "log4j", "1.2.16")
|
||||
// .add("org.slf4j", "jcl-over-slf4j", "1.7.5");
|
||||
// dependencies.ifNotAdded("ch.qos.logback", "logback-classic")
|
||||
// .ifNotAdded("org.slf4j", "slf4j-log4j12")
|
||||
// .add("org.slf4j", "slf4j-jdk14", "1.7.5")
|
||||
// .add("org.slf4j", "jcl-over-slf4j", "1.7.5");
|
||||
// FIXME get the version
|
||||
}
|
||||
|
||||
|
@ -54,16 +54,21 @@ public class SampleIntegrationTests {
|
||||
|
||||
private ByteArrayOutputStream output;
|
||||
|
||||
private PrintStream savedErr;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
this.savedOutput = System.out;
|
||||
this.savedErr = System.err;
|
||||
this.output = new ByteArrayOutputStream();
|
||||
System.setOut(new PrintStream(this.output));
|
||||
System.setErr(new PrintStream(this.output));
|
||||
}
|
||||
|
||||
@After
|
||||
public void clear() {
|
||||
System.setOut(this.savedOutput);
|
||||
System.setErr(this.savedErr);
|
||||
}
|
||||
|
||||
private String getOutput() {
|
||||
|
@ -16,8 +16,9 @@
|
||||
<module>spring-starter</module>
|
||||
<module>spring-starter-actuator</module>
|
||||
<module>spring-starter-batch</module>
|
||||
<module>spring-starter-integration</module>
|
||||
<module>spring-starter-data-jpa</module>
|
||||
<module>spring-starter-integration</module>
|
||||
<module>spring-starter-logging</module>
|
||||
<module>spring-starter-parent</module>
|
||||
<module>spring-starter-security</module>
|
||||
<module>spring-starter-web</module>
|
||||
|
25
spring-starters/spring-starter-logging/pom.xml
Normal file
25
spring-starters/spring-starter-logging/pom.xml
Normal file
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.zero</groupId>
|
||||
<artifactId>spring-starters</artifactId>
|
||||
<version>0.5.0.BUILD-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>spring-starter-logging</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<properties>
|
||||
<main.basedir>${basedir}/../..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-classic</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -13,6 +13,11 @@
|
||||
<main.basedir>${basedir}/../..</main.basedir>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-starter-logging</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>spring-bootstrap</artifactId>
|
||||
|
@ -30,19 +30,22 @@ import static org.junit.Assert.assertTrue;
|
||||
public class SampleBatchApplicationTests {
|
||||
|
||||
private PrintStream savedOutput;
|
||||
private PrintStream savedErr;
|
||||
private ByteArrayOutputStream output;
|
||||
|
||||
@Before
|
||||
public void init() {
|
||||
this.savedOutput = System.err;
|
||||
this.savedOutput = System.out;
|
||||
this.savedErr = System.err;
|
||||
this.output = new ByteArrayOutputStream();
|
||||
// jdk logging goes to syserr by default
|
||||
System.setOut(new PrintStream(this.output));
|
||||
System.setErr(new PrintStream(this.output));
|
||||
}
|
||||
|
||||
@After
|
||||
public void after() {
|
||||
System.setErr(this.savedOutput);
|
||||
System.setOut(this.savedOutput);
|
||||
System.setErr(this.savedErr);
|
||||
}
|
||||
|
||||
private String getOutput() {
|
||||
|
Loading…
Reference in New Issue
Block a user