Skip to content

Commit 8808ff0

Browse files
committed
fix LOGBACK-1157
1 parent d8b428b commit 8808ff0

File tree

7 files changed

+214
-123
lines changed

7 files changed

+214
-123
lines changed

logback-bom/pom.xml

Lines changed: 5 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,20 @@
1212
<description>LOGBACK Bill of Materials</description>
1313

1414
<properties>
15-
<maven.compiler.source>1.6</maven.compiler.source>
16-
<maven.compiler.target>1.6</maven.compiler.target>
17-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18-
<!-- slf4j.version property is used below, in
19-
logback-classic/pom.xml and in setClasspath.cmd -->
2015
<slf4j.version>1.7.20</slf4j.version>
21-
<junit.version>4.10</junit.version>
22-
<javax.mail.version>1.4</javax.mail.version>
23-
<janino.version>2.7.8</janino.version>
24-
<groovy.version>2.4.0</groovy.version>
25-
26-
<consolePlugin.version>1.1.0</consolePlugin.version>
27-
<tomcat.version>7.0.59</tomcat.version>
28-
<jetty.version>7.5.1.v20110908</jetty.version>
29-
<jansi.version>1.9</jansi.version>
30-
<javadoc.plugin.version>2.9.1</javadoc.plugin.version>
31-
<cobertura.maven.plugin.version>2.6</cobertura.maven.plugin.version>
32-
<maven-license-plugin.version>1.9.0</maven-license-plugin.version>
3316
</properties>
34-
35-
<dependencyManagement>
17+
18+
<dependencyManagement>
3619
<dependencies>
37-
<!-- Project modules -->
3820
<dependency>
39-
<groupId>ch.qos.logback</groupId>
40-
<artifactId>logback-core</artifactId>
41-
<version>${project.version}</version>
21+
<groupId>org.slf4j</groupId>
22+
<artifactId>slf4j-api</artifactId>
23+
<version>${slf4j.version}</version>
4224
</dependency>
4325
<dependency>
4426
<groupId>ch.qos.logback</groupId>
4527
<artifactId>logback-core</artifactId>
4628
<version>${project.version}</version>
47-
<type>test-jar</type>
4829
</dependency>
4930
<dependency>
5031
<groupId>ch.qos.logback</groupId>
@@ -56,88 +37,7 @@
5637
<artifactId>logback-access</artifactId>
5738
<version>${project.version}</version>
5839
</dependency>
59-
<dependency>
60-
<groupId>org.slf4j</groupId>
61-
<artifactId>slf4j-api</artifactId>
62-
<version>${slf4j.version}</version>
63-
</dependency>
64-
<dependency>
65-
<groupId>org.codehaus.janino</groupId>
66-
<artifactId>janino</artifactId>
67-
<version>${janino.version}</version>
68-
</dependency>
69-
<dependency>
70-
<groupId>org.codehaus.groovy</groupId>
71-
<artifactId>groovy-all</artifactId>
72-
<version>${groovy.version}</version>
73-
</dependency>
74-
<dependency>
75-
<groupId>org.fusesource.jansi</groupId>
76-
<artifactId>jansi</artifactId>
77-
<version>${jansi.version}</version>
78-
</dependency>
79-
<dependency>
80-
<groupId>javax.mail</groupId>
81-
<artifactId>mail</artifactId>
82-
<version>${javax.mail.version}</version>
83-
</dependency>
84-
<dependency>
85-
<groupId>dom4j</groupId>
86-
<artifactId>dom4j</artifactId>
87-
<version>1.6.1</version>
88-
</dependency>
89-
<dependency>
90-
<groupId>hsqldb</groupId>
91-
<artifactId>hsqldb</artifactId>
92-
<version>1.8.0.7</version>
93-
</dependency>
94-
<dependency>
95-
<groupId>com.h2database</groupId>
96-
<artifactId>h2</artifactId>
97-
<version>1.2.132</version>
98-
</dependency>
99-
<dependency>
100-
<groupId>postgresql</groupId>
101-
<artifactId>postgresql</artifactId>
102-
<version>8.4-701.jdbc4</version>
103-
</dependency>
104-
<dependency>
105-
<groupId>mysql</groupId>
106-
<artifactId>mysql-connector-java</artifactId>
107-
<version>5.1.9</version>
108-
</dependency>
109-
<dependency>
110-
<groupId>org.apache.tomcat</groupId>
111-
<artifactId>tomcat-catalina</artifactId>
112-
<version>${tomcat.version}</version>
113-
</dependency>
114-
<dependency>
115-
<groupId>org.apache.tomcat</groupId>
116-
<artifactId>tomcat-coyote</artifactId>
117-
<version>${tomcat.version}</version>
118-
</dependency>
119-
<dependency>
120-
<groupId>org.eclipse.jetty</groupId>
121-
<artifactId>jetty-server</artifactId>
122-
<version>${jetty.version}</version>
123-
</dependency>
124-
<dependency>
125-
<groupId>org.apache.geronimo.specs</groupId>
126-
<artifactId>geronimo-jms_1.1_spec</artifactId>
127-
<version>1.0</version>
128-
</dependency>
129-
<dependency>
130-
<groupId>javax.servlet</groupId>
131-
<artifactId>servlet-api</artifactId>
132-
<version>2.5</version>
133-
</dependency>
134-
<dependency>
135-
<groupId>joda-time</groupId>
136-
<artifactId>joda-time</artifactId>
137-
<version>2.9.2</version>
138-
</dependency>
13940
</dependencies>
14041
</dependencyManagement>
14142

142-
14343
</project>

logback-site/pom.xml

100644100755
File mode changed.

logback-site/src/site/pages/news.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ <h2>Logback News</h2>
3131
announce</a> mailing list.</p>
3232

3333

34+
3435
<hr width="80%" align="center" />
3536

3637
<h3>March 31st, 2016, Release of version 1.1.8</h3>
@@ -42,6 +43,11 @@ <h3>March 31st, 2016, Release of version 1.1.8</h3>
4243
Christian H&uuml;bner.
4344
</p>
4445

46+
<p>Added logback-bom module for use as a Maven "Bill of Materials"
47+
<em>pom</em> file. This was requested in <a
48+
href="http://jira.qos.ch/browse/LOGBACK-1157">LOGBACK-1157</a>
49+
Joerg Sesterhenn.</p>
50+
4551
<hr width="80%" align="center" />
4652

4753
<h3>March 29th, 2016, Release of version 1.1.7</h3>

logback-site/src/site/pages/setup.html

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ <h2 class="doAnchor">Classpath Setup</h2>
4343
</p>
4444

4545

46-
4746
<h3 class="doAnchor" name="commandLine">Running from the command
4847
line</h3>
4948

50-
<p>Assuming your current directory is
49+
<p>You can launch the first sample application,
50+
<em>chapters.introduction.HelloWord1</em> with the following
51+
command. This assumes that your current directory is
5152
<em>$LOGBACK_HOME/logback-examples</em>, where
5253
<em>$LOGBACK_HOME</em> stands for the directory where you
53-
installed logback, you can launch the first sample application,
54-
<em>chapters.introduction.HelloWord1</em> with the following command:
54+
installed logback:
5555
</p>
5656

5757
<p class="source">java -cp lib/slf4j-api-${slf4j.version}.jar;../logback-core-${project.version}.jar;\
@@ -78,6 +78,76 @@ <h3 class="doAnchor" name="commandLine">Running from the command
7878
<em>$LOGBACK_HOME/logback-examples</em> directory.
7979
</p>
8080

81+
82+
<h2 class="doAnchor" name="mavenBuild">Maven dependency
83+
declaration</h2>
84+
85+
<p>To use logback-classic in your Maven project, declare the
86+
following dependency in your project's <em>pom</em> file.</p>
87+
88+
<pre class="prettyprint source">&lt;dependency>
89+
&lt;groupId>ch.qos.logback&lt;/groupId>
90+
&lt;artifactId>logback-classic&lt;/artifactId>
91+
&lt;version>${project.version}&lt;/version>
92+
&lt;/dependency></pre>
93+
94+
<p><span class="label notice">TRANSITIVITY</span> Note that in
95+
addition to <em>logback-classic.jar</em>, the above declaration
96+
will automatically pull-in <em>slf4j-api.jar</em> and
97+
<em>logback-core.jar</em> into your project by virtue of Maven's
98+
transitivity rules.</p>
99+
100+
101+
<p>To include logback-access in your Maven project, declare the following
102+
dependency in your project's <em>pom</em> file.</p>
103+
104+
<pre class="prettyprint source">&lt;dependency>
105+
&lt;groupId>ch.qos.logback&lt;/groupId>
106+
&lt;artifactId>logback-access&lt;/artifactId>
107+
&lt;version>${project.version}&lt;/version>
108+
&lt;/dependency></pre>
109+
110+
<h4>Maven "Bill of materials" (useful for large teams)</h4>
111+
112+
<p>To facilitate the synchronization of logback and slf4j modules,
113+
we provide a "Bill of materials" pom file. It can be imported in
114+
the <code>dependencyManagement</code> section of your parent
115+
<code>pom</code> file, as shown below.
116+
</p>
117+
118+
<pre class="prettyprint source">&lt;dependencyManagement>
119+
&lt;dependencies>
120+
&lt;dependency>
121+
&lt;groupId>ch.qos.logback&lt;/groupId>
122+
&lt;artifactId>logback-bom&lt;/artifactId>
123+
&lt;version>${project.version}&lt;/version>
124+
&lt;type>pom&lt;/type>
125+
&lt;scope>import&lt;/scope>
126+
&lt;dependency>
127+
...
128+
&lt;/dependencies>
129+
&lt;/dependencyManagement></pre>
130+
131+
<p>Importing logback-bom as shown above allows you to declare the
132+
version for logback/slf4j modules in one step and keep them in
133+
sync. This can be convenient particularly in larger software
134+
teams.</p>
135+
136+
<p>Note that you still need to declare a dependency on
137+
logback-classic (or logback-access). However, you no longer will
138+
have to specify the version.</p>
139+
140+
<p>After logback-bom is imported, the previous dependency declaration
141+
becomes:</p>
142+
143+
<pre class="prettyprint source">&lt;dependency>
144+
&lt;groupId>ch.qos.logback&lt;/groupId>
145+
&lt;artifactId>logback-classic&lt;/artifactId>
146+
&lt;!-- Look mom, no version! -->
147+
&lt;/dependency></pre>
148+
149+
<h2 class="doAnchor" name="optionalDeps">Optional dependencies</h2>
150+
81151
<h3 class="doAnchor" name="SMTP"><code>SMTPAppender</code> requires
82152
JavaMail API</h3>
83153

@@ -156,7 +226,7 @@ <h3 class="doAnchor" name="janino">Conditional processing and
156226

157227

158228

159-
<h3 class="doAnchor" name="ide">Building with an IDE</h3>
229+
<h2 class="doAnchor" name="ide">Building with an IDE</h2>
160230

161231
<p>If you wish to contribute to the project or just hack for fun,
162232
you will probably want to import logback as a project into your

0 commit comments

Comments
 (0)