Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to set classpath in pom.xml?
    text
    copied!<p>When running tests using <code>maven</code>, i'd like to see output on my screen.</p> <p>After putting the <code>log4j.xml</code> into my project's dir (src/test/resources/cfg/), i updated my <code>pom</code> to include</p> <pre class="lang-xml prettyprint-override"><code>235 &lt;plugin&gt; 236 &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; 237 &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt; 238 &lt;configuration&gt; 239 &lt;skipTests&gt;false&lt;/skipTests&gt; 240 &lt;excludes&gt; 241 &lt;exclude&gt;**/*$*.java&lt;/exclude&gt; 242 &lt;/excludes&gt; 243 &lt;systemProperties&gt; 244 &lt;property&gt; 245 &lt;name&gt;-Dlog4j.configuration&lt;/name&gt; 246 &lt;value&gt;file:src/test/resources/cfg/log4j.xml&lt;/value&gt; 247 &lt;/property&gt; 248 &lt;/systemProperties&gt; 249 &lt;additionalClasspathElements&gt; 250 &lt;additionalClasspathElement&gt;src/test/resources/cfg/&lt;/additionalClasspathElement&gt; 251 &lt;/additionalClasspathElements&gt; 252 &lt;/configuration&gt; 253 &lt;/plugin&gt; </code></pre> <p>The above does not work. When tests run, i still see the following message</p> <pre><code>log4j:WARN Please initialize the log4j system properly. </code></pre> <p>For the record, the following is the log4j</p> <pre class="lang-xml prettyprint-override"><code> 1 &lt;?xml version="1.0" encoding="UTF-8" ?&gt; 2 &lt;!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"&gt; 3 4 &lt;log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"&gt; 5 &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt; 6 &lt;param name="Target" value="System.out"/&gt; 7 &lt;layout class="org.apache.log4j.PatternLayout"&gt; 8 &lt;param name="ConversionPattern" value="%-5p %c{1} - %m%n"/&gt; 9 &lt;/layout&gt; 10 &lt;/appender&gt; 11 12 &lt;root&gt; 13 &lt;priority value ="debug" /&gt; 14 &lt;appender-ref ref="console" /&gt; 15 &lt;/root&gt; 16 17 &lt;/log4j:configuration&gt; </code></pre> <p><strong>What am i missing please?</strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload