Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you already have a web server set up pointing on a web folder, a simple way to deploy your custom JAR would to use the <a href="http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html" rel="noreferrer"><code>deploy:deploy-file</code></a> Mojo. As documented in the <a href="http://maven.apache.org/plugins/maven-deploy-plugin/usage.html" rel="noreferrer">Usage</a> page of the Maven Deploy Plugin:</p> <blockquote> <p>The <code>deploy:deploy-file</code> mojo is used primarily for deploying artifacts to which were not built by Maven. The project's development team may or may not provide a POM for the artifact, and in some cases you may want to deploy the artifact to an internal remote repository. The deploy-file mojo provides functionality covering all of these use cases, and offers a wide range of configurability for generating a POM on-the-fly. Additionally, you can specify what layout your repository uses. The full usage statement of the deploy-file mojo can be described as:</p> <pre><code>mvn deploy:deploy-file -Durl=file://C:\m2-repo \ -DrepositoryId=some.id \ -Dfile=your-artifact-1.0.jar \ [-DpomFile=your-pom.xml] \ [-DgroupId=org.some.group] \ [-DartifactId=your-artifact] \ [-Dversion=1.0] \ [-Dpackaging=jar] \ [-Dclassifier=test] \ [-DgeneratePom=true] \ [-DgeneratePom.description="My Project Description"] \ [-DrepositoryLayout=legacy] \ [-DuniqueVersion=false] </code></pre> </blockquote> <p>Only the 3 first parameters are mandatory (short version). If you wonder what the <a href="http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html#repositoryId" rel="noreferrer">repositoryId</a> is, the documentation of the Mojo says:</p> <blockquote> <p>Server Id to map on the <code>&lt;id&gt;</code> under <code>&lt;server&gt;</code> section of <code>settings.xml</code> In most cases, this parameter will be required for authentication. Default value is: remote-repository.</p> </blockquote> <p>In other words, the simplest way to use this would be to copy your custom JAR on the machine hosting the web server and to use the <code>file://</code> protocol when specifying the URL. There is no additional setup required. If you want to deploy remotely, then <code>scp://</code> is often the preferred protocol (there are others but this one is pretty easy to setup). Below, an example using scp:</p> <pre><code>mvn deploy:deploy-file -DgroupId=my.group -DartifactId=myartifact -Dversion=1.0 \ -DgeneratePom=true \ -Dpackaging=jar \ -Dfile=custom.jar \ -DrepositoryId=some.id \ -Durl=scp://REMOTEMACHINE/PATH/TO/WEB_ROOT/maven2_repository </code></pre> <p>Actually, using a web server to host your own Maven repository is perfectly fine but it can be a bit painful to initialize. One solution to solve this issue is to use a Maven proxy (like <a href="http://nexus.sonatype.org/" rel="noreferrer">Nexus</a> for example) instead of just a Maven repository. But this goes beyond your question. </p> <p>For more resources on this, check (the principles are still valid even if the implementation solutions are a bit outdated):</p> <ul> <li><a href="http://docs.codehaus.org/display/MAVENUSER/Using+Maven+in+a+corporate+environment#UsingMaveninacorporateenvironment-internalrepository" rel="noreferrer">Using Maven in a corporate environment</a></li> <li><a href="http://docs.codehaus.org/display/MAVENUSER/Creating+the+repositories" rel="noreferrer">Creating the repositories</a></li> <li><a href="http://www.sonatype.com/books/nexus-book/reference/" rel="noreferrer">Nexus Book: Repository Management with Nexus</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    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