Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This can be easily solved in a few steps.</p> <ol> <li><p>run <code>mvn dependency:list -DoutputFile=dep.list -DoutputAbsoluteArtifactFilename=true</code> in your shell</p> <p>you will receive a file like this: <code><pre>The following files have been resolved: ch.qos.logback:logback-classic:jar:0.9.30:test:C:\Dokumente und Einstellungen\michael-o.m2\repository\ch\qos\logback\logback-classic\0.9.30\logback-classic-0.9.30.jar ch.qos.logback:logback-core:jar:0.9.30:test:C:\Dokumente und Einstellungen\michael-o.m2\repository\ch\qos\logback\logback-core\0.9.30\logback-core-0.9.30.jar classworlds:classworlds:jar:1.1-alpha-2:compile:C:\Dokumente und Einstellungen\michael-o.m2\repository\classworlds\classworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar </pre></code></p> <p>The important information is indented by 4 spaces in the file.</p></li> <li><p>Now grep out the important information and do not forget to limit to compile and runtime scope.</p></li> <li>split columns with <code>cut -d ':' -f &lt;colNum&gt;</code> and get the last column.</li> <li>Get the filename after the last (back)slash.</li> <li>Now build an XML file with the information.</li> </ol> <p>Every can be packed in a nice shell script.</p> <p>See the <a href="http://maven.apache.org/plugins/maven-dependency-plugin/list-mojo.html" rel="nofollow"><code>maven-dependency-plugin</code></a> for reference.</p> <p>A quick command looks like this: <code>cat dep.list | grep -E ':(compile|runtime):' | cut -d ':' -f 7 | sed -e 's/\///g' | xargs -I {} basename '{}' | xargs -I {} echo "&lt;resource-root path=\"{}\" />"</code></p> <p>The output contains the jar files names:</p> <pre><code>&lt;resource-root path="classworlds-1.1-alpha-2.jar" /&gt; &lt;resource-root path="jsr305-1.3.9.jar" /&gt; &lt;resource-root path="guava-10.0.1.jar" /&gt; &lt;resource-root path="commons-codec-1.3.jar" /&gt; &lt;resource-root path="commons-io-2.0.1.jar" /&gt; &lt;resource-root path="commons-lang-2.6.jar" /&gt; &lt;resource-root path="junit-4.9.jar" /&gt; </code></pre> <p>Now wrap with XML header and footer, and you are done!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

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