Have slf4j-simple as an "always there" <scope>test dependency. 82/46882/2
authorMichael Vorburger <vorburger@redhat.com>
Thu, 13 Oct 2016 13:01:03 +0000 (15:01 +0200)
committerRobert Varga <nite@hq.sk>
Thu, 13 Oct 2016 14:45:19 +0000 (14:45 +0000)
The "always there" as in always, literally, not just in
<dependencyManagement>.  This makes sense because in (unit and
component, not integration) tests you want logging to "just work" - you
don't want to have to remember to add slf4j-simple yourself as a
dependency every time (and you certainly don't want to have to add
logback every time, and configure it with an XML or properties; for
every project).

Also the problem with manually adding a slf4j-simple dependency to
projects with tests is that there is a risk of it getting accidentally
removed, because "mvn dependency:analyze" will find it's "not needed";
as happened e.g. in
https://git.opendaylight.org/gerrit/#/c/45090/6/vpnservice/aclservice/impl/pom.xml

Change-Id: I5af53bbd8d69ad5cebac08f97225c2f9cbe60ab7
Signed-off-by: Michael Vorburger <vorburger@redhat.com>
odlparent/pom.xml

index ebcb0f16a53b4124738e6d50364ccdb9d006f81b..b3d92566a661bee3e3b54f9457c0bf6bc9556d5e 100644 (file)
       <scope>provided</scope>
     </dependency>
 
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <scope>test</scope>
+    </dependency>
+
     <!-- Enable JSR-305 annotations everywhere -->
     <dependency>
       <groupId>com.google.code.findbugs</groupId>