Snipt.net is closing on December 31st, 2016

For more information, please visit this blog post.

snipt

Ctrl+h for KB shortcuts

XML

maven file dependency

1
2
3
4
5
6
<dependency>
    <artifactId>..</artifactId>
    <groupId>..</groupId>
    <scope>system</scope>
    <systemPath>${basedir}/lib/dependency.jar</systemPath>
</dependency>
https://snipt.net/embed/6556d6f758fe77870930d7f6489d06b1/
https://snipt.net/raw/6556d6f758fe77870930d7f6489d06b1/
6556d6f758fe77870930d7f6489d06b1
xml
XML
6
2016-12-04T12:00:49
True
False
False
Jan 09, 2016 at 03:27 AM
/api/public/snipt/143483/
maven-file-dependency
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">&lt;dependency&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nt">&lt;artifactId&gt;</span>..<span class="nt">&lt;/artifactId&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nt">&lt;groupId&gt;</span>..<span class="nt">&lt;/groupId&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nt">&lt;scope&gt;</span>system<span class="nt">&lt;/scope&gt;</span> </span><span id="L-5"><a name="L-5"></a> <span class="nt">&lt;systemPath&gt;</span>${basedir}/lib/dependency.jar<span class="nt">&lt;/systemPath&gt;</span> </span><span id="L-6"><a name="L-6"></a><span class="nt">&lt;/dependency&gt;</span> </span></pre></div> </td></tr></table>
dependency, file, maven, mvn, pom

Bash

Useful bash command snippets

1
2
3
4
5
6
# Clean all dirs that have mvn builds in them to 
# recover space taken up by /target dirs that are not used
for foo in *; do cd $foo; mvn clean; cd ..; done

# clean all SNAPSHOT items from the local maven repo
cd .m2/repository && find . -name '*-SNAPSHOT' -print0 | xargs -0 rm -rf
https://snipt.net/embed/b52b012c361bfbb20511292c266400c9/
https://snipt.net/raw/b52b012c361bfbb20511292c266400c9/
b52b012c361bfbb20511292c266400c9
bash
Bash
6
2016-12-08T04:18:14
True
False
False
/api/public/snipt/136637/
useful-bash-command-snippets-3c6e6349
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Clean all dirs that have mvn builds in them to </span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># recover space taken up by /target dirs that are not used</span> </span><span id="L-3"><a name="L-3"></a><span class="k">for</span> foo in *<span class="p">;</span> <span class="k">do</span> <span class="nb">cd</span> <span class="nv">$foo</span><span class="p">;</span> mvn clean<span class="p">;</span> <span class="nb">cd</span> ..<span class="p">;</span> <span class="k">done</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1"># clean all SNAPSHOT items from the local maven repo</span> </span><span id="L-6"><a name="L-6"></a><span class="nb">cd</span> .m2/repository <span class="o">&amp;&amp;</span> find . -name <span class="s1">&#39;*-SNAPSHOT&#39;</span> -print0 <span class="p">|</span> xargs -0 rm -rf </span></pre></div> </td></tr></table>
bash, cleanup, maven, shell
Copyrighted, illegal, or inappropriate content? Email [email protected].