snipt

Ctrl+h for KB shortcuts

Bash

Install maven artifact - remote and local

mvn deploy:deploy-file -DgroupId=<group-id> \
  -DartifactId=<artifact-id> \
  -Dversion=<version> \
  -Dpackaging=<type-of-packaging> \
  -Dfile=<path-to-file> \
  -DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
  -Durl=<url-of-the-repository-to-deploy>
  
Or setting up a Run Configuration in Eclipse as:

Main > Base directory: C:/path-to/project
Main > Goals: deploy:deploy-file

JRE > VM Arguments:
-DrepositoryId=nexus-snapshots 
-Dfile=./target/app-beans.jar 
-Durl=https://nexus.company.com/artifactory/PROJ-SNAPSHOT 
-DpomFile=./pom.xml

Description

To deploy an artifact to both local and remote maven repositories (like Nexus or Artifactory).
https://snipt.net/embed/f2841a3638ef3980cf2edb56d6592e94/
/raw/f2841a3638ef3980cf2edb56d6592e94/
f2841a3638ef3980cf2edb56d6592e94
bash
Bash
18
2019-07-24T00:14:33
True
False
False
Jul 01, 2014 at 05:19 PM
/api/public/snipt/55630/
-1761
<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> <a href="#L-7"> 7</a> <a href="#L-8"> 8</a> <a href="#L-9"> 9</a> <a href="#L-10">10</a> <a href="#L-11">11</a> <a href="#L-12">12</a> <a href="#L-13">13</a> <a href="#L-14">14</a> <a href="#L-15">15</a> <a href="#L-16">16</a> <a href="#L-17">17</a> <a href="#L-18">18</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>mvn deploy:deploy-file -DgroupId<span class="o">=</span>&lt;group-id&gt; <span class="se">\</span> </span><span id="L-2"><a name="L-2"></a> -DartifactId<span class="o">=</span>&lt;artifact-id&gt; <span class="se">\</span> </span><span id="L-3"><a name="L-3"></a> -Dversion<span class="o">=</span>&lt;version&gt; <span class="se">\</span> </span><span id="L-4"><a name="L-4"></a> -Dpackaging<span class="o">=</span>&lt;type-of-packaging&gt; <span class="se">\</span> </span><span id="L-5"><a name="L-5"></a> -Dfile<span class="o">=</span>&lt;path-to-file&gt; <span class="se">\</span> </span><span id="L-6"><a name="L-6"></a> -DrepositoryId<span class="o">=</span>&lt;id-to-map-on-server-section-of-settings.xml&gt; <span class="se">\</span> </span><span id="L-7"><a name="L-7"></a> -Durl<span class="o">=</span>&lt;url-of-the-repository-to-deploy&gt; </span><span id="L-8"><a name="L-8"></a> </span><span id="L-9"><a name="L-9"></a>Or setting up a Run Configuration in Eclipse as: </span><span id="L-10"><a name="L-10"></a> </span><span id="L-11"><a name="L-11"></a>Main &gt; Base directory: C:/path-to/project </span><span id="L-12"><a name="L-12"></a>Main &gt; Goals: deploy:deploy-file </span><span id="L-13"><a name="L-13"></a> </span><span id="L-14"><a name="L-14"></a>JRE &gt; VM Arguments: </span><span id="L-15"><a name="L-15"></a>-DrepositoryId<span class="o">=</span>nexus-snapshots </span><span id="L-16"><a name="L-16"></a>-Dfile<span class="o">=</span>./target/app-beans.jar </span><span id="L-17"><a name="L-17"></a>-Durl<span class="o">=</span>https://nexus.company.com/artifactory/PROJ-SNAPSHOT </span><span id="L-18"><a name="L-18"></a>-DpomFile<span class="o">=</span>./pom.xml </span></pre></div> </td></tr></table>
artifact, deploy, maven