<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I thought the &lt;exclusions&gt; would remove the api from classpath..<div><br></div><div><br><div><div><div>On Aug 12, 2011, at 11:30 AM, Chris Pratt wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">If the API exists, programmers can use it, regardless of the jar file name that contains it. &nbsp;So whether it's commons-logging.jar of jcl-over-slf4j.jar the API is available for 3rd party libraries (like Spring) AND your programmers, and (as far as I'm aware) there's nothing Maven can do about that fact. &nbsp;Same for Log4j, since the log4j.jar file has to be there for slf4j-log4j12.jar to work, your programmers can use it as well.<div>

<br></div><div>You might be able to write some awk scripts that scan your code for instantiations of the Loggers from those packages and warns you if someone uses them. &nbsp;You might even be able to get maven to run it during the build process. &nbsp;But other than that, I don't know what to tell you.</div>

<div>&nbsp; (*Chris*)<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 9:18 AM, Douglas Ferguson <span dir="ltr">&lt;<a href="mailto:thedug@gmail.com">thedug@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div style="word-wrap:break-word">So does that mean that:<div><br></div><div>1) mvn dependency tree is lying to me?</div><div>2) If I remove the jcl-over-slf4j.jar &nbsp;that 3rd party libraries, like spring that use commons logging will still be able to log at runtime? Maybe I need to mark it runtime so it is included in the war but not compiled against?</div>

<div><br></div><div><font color="#888888">Douglas</font><div><div></div><div class="h5"><br><div><br></div><div><br><div><div>On Aug 12, 2011, at 11:13 AM, Chris Pratt wrote:</div><br><blockquote type="cite">My guess is you're not seeing the actual inclusion of the commons-logging.jar, but the API's included in that jar. &nbsp;Those API's are replicated by the jcl-over-slf4j.jar file but use the SLF4j API under the covers. &nbsp;If you want to make sure people can't write to that API, remove that jar file.<div>



&nbsp; (*Chris*)<br><br><div class="gmail_quote">On Fri, Aug 12, 2011 at 7:20 AM, Douglas Ferguson <span dir="ltr">&lt;<a href="mailto:thedug@gmail.com" target="_blank">thedug@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">Hi,<div><br></div><div>I'm migrating a spring project from a hybrid of log4j and commons logging. I'd like to make sure that developer don't inadvertently use commons-logging or log4j directly</div>



<div><br></div><div>I ran the migrator. It worked great</div><div><br></div><div>I added exclusions to my pom, <font color="#f60000">but eclipse still finds the commons-logging jar</font> and when a run maven dependency:tree it still shows up:</div>



<div><br></div><div><br></div><div><div>[INFO] +- org.springframework.ws:spring-ws-core:jar:2.0.0.RELEASE:compile</div><div>[INFO] | &nbsp;+- wsdl4j:wsdl4j:jar:1.6.1:compile</div><div>[INFO] | &nbsp;\- commons-logging:commons-logging:jar:1.1.1:compile</div>



</div><div><br></div><div><div><span style="white-space:pre-wrap">                </span>&lt;dependency&gt;</div><div><span style="white-space:pre-wrap">                        </span>&lt;groupId&gt;<a href="http://org.springframework.ws/" target="_blank">org.springframework.ws</a>&lt;/groupId&gt;</div>



<div><span style="white-space:pre-wrap">                        </span>&lt;artifactId&gt;spring-ws-core&lt;/artifactId&gt;</div><div><span style="white-space:pre-wrap">                        </span>&lt;version&gt;${spring-ws-version}&lt;/version&gt;</div><div><span style="white-space:pre-wrap">                        </span>&lt;type&gt;jar&lt;/type&gt;</div>



<div><span style="white-space:pre-wrap">                        </span>&lt;scope&gt;compile&lt;/scope&gt;</div><div><span style="white-space:pre-wrap">                        </span>&lt;exclusions&gt;</div><div><span style="white-space:pre-wrap">                                </span>&lt;exclusion&gt;</div>



<div><span style="white-space:pre-wrap">                                        </span>&lt;groupId&gt;commons-logging&lt;/groupId&gt;</div><div><span style="white-space:pre-wrap">                                        </span>&lt;artifactId&gt;commons-logging&lt;/artifactId&gt;</div><div><span style="white-space:pre-wrap">                                </span>&lt;/exclusion&gt;</div>



<div><span style="white-space:pre-wrap">                        </span>&lt;/exclusions&gt;<span style="white-space:pre-wrap">                        </span></div><div><span style="white-space:pre-wrap">                </span>&lt;/dependency&gt;</div></div><div><br></div><div>


<br>
</div><div><br></div><div>I also added this so that any dependencies that are using commons-logging will be ok</div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)">



<span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;</span>dependency<span style="color:#009494">&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)">



<span style="color:#000000"><span style="white-space:pre-wrap">                </span>&nbsp; </span><span style="color:#009494">&lt;</span>groupId<span style="color:#009494">&gt;</span><span style="color:#000000">org.slf4j</span><span style="color:#009494">&lt;/</span>groupId<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span>&nbsp; </span><span style="color:#009494">&lt;</span>artifactId<span style="color:#009494">&gt;</span><span style="color:#000000">jcl-over-slf4j</span><span style="color:#009494">&lt;/</span>artifactId<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span>&nbsp; </span><span style="color:#009494">&lt;</span>version<span style="color:#009494">&gt;</span><span style="color:#000000">1.6.1</span><span style="color:#009494">&lt;/</span>version<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;/</span>dependency<span style="color:#009494">&gt;</span></div>



</div><div><br></div><div>Here's my other logging dependencies</div><div><br></div><div><br></div><div><br></div><div><br></div><div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(77, 110, 205)">



<span style="color:#000000"><span style="white-space:pre-wrap">                </span></span>&lt;!-- slf4j --&gt;</div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;</span>dependency<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="white-space:pre-wrap">                        </span><span style="text-decoration:underline">&lt;groupId&gt;org.slf4j&lt;/groupId&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">



<span style="text-decoration:underline"><span style="white-space:pre-wrap">                        </span>&lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px">



<span style="text-decoration:underline"><span style="white-space:pre-wrap">                        </span>&lt;version&gt;1.6.1&lt;/version&gt;</span></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)">



<span style="color:#000000"><span style="white-space:pre-wrap">                        </span></span><span style="color:#009494">&lt;</span>type<span style="color:#009494">&gt;</span><span style="color:#000000">jar</span><span style="color:#009494">&lt;/</span>type<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="white-space:pre-wrap">                        </span><span style="color:#009494">&lt;</span><span style="color:#339393">scope</span><span style="color:#009494">&gt;</span>compile<span style="color:#009494">&lt;/</span><span style="color:#339393">scope</span><span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;/</span>dependency<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;</span>dependency<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                        </span></span><span style="color:#009494">&lt;</span>groupId<span style="color:#009494">&gt;</span><span style="color:#000000">org.slf4j</span><span style="color:#009494">&lt;/</span>groupId<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                        </span></span><span style="color:#009494">&lt;</span>artifactId<span style="color:#009494">&gt;</span><span style="color:#000000">slf4j-log4j12</span><span style="color:#009494">&lt;/</span>artifactId<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                        </span></span><span style="color:#009494">&lt;</span>version<span style="color:#009494">&gt;</span><span style="color:#000000">1.6.1</span><span style="color:#009494">&lt;/</span>version<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                        </span></span><span style="color:#009494">&lt;</span>type<span style="color:#009494">&gt;</span><span style="color:#000000">jar</span><span style="color:#009494">&lt;/</span>type<span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px"><span style="white-space:pre-wrap">                        </span><span style="color:#009494">&lt;</span><span style="color:#339393">scope</span><span style="color:#009494">&gt;</span>compile<span style="color:#009494">&lt;/</span><span style="color:#339393">scope</span><span style="color:#009494">&gt;</span></div>



<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(51, 147, 147)"><span style="color:#000000"><span style="white-space:pre-wrap">                </span></span><span style="color:#009494">&lt;/</span>dependency<span style="color:#009494">&gt;</span></div>



</div></div><br>_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://qos.ch/mailman/listinfo/slf4j-user</a><br></blockquote></div><br></div>
_______________________________________________<br>slf4j-user mailing list<br><a href="mailto:slf4j-user@qos.ch" target="_blank">slf4j-user@qos.ch</a><br><a href="http://qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://qos.ch/mailman/listinfo/slf4j-user</a></blockquote>

</div><br></div></div></div></div></div><br>_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://qos.ch/mailman/listinfo/slf4j-user</a><br></blockquote></div><br></div>
_______________________________________________<br>slf4j-user mailing list<br><a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>http://qos.ch/mailman/listinfo/slf4j-user</blockquote></div><br></div></div></body></html>