Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Simple - add the element <code>&lt;packaging&gt;jar&lt;/packaging&gt;</code> to your <code>pom.xml</code> and invoke the following:</p> <pre><code>mvn package </code></pre> <p>See <a href="http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html" rel="nofollow" title="Maven Build Lifecycle">Maven build lifecycle</a> for more information. It really is a must-read if you're planning to use Maven for you project.</p> <p><strong>Edit</strong></p> <p>Thanks for the update, I know understand what you mean. There may be a better way to do this, but this is what I use:</p> <p>Maven will automatically include this jar if you add it as a dependency in the usual way, i.e:</p> <pre><code>&lt;dependencies&gt; ... &lt;dependency&gt; &lt;groupId&gt;some.group&lt;/groupId&gt; &lt;artifactId&gt;contribution&lt;/artifactId&gt; &lt;version&gt;1.0.0&lt;/version&gt; &lt;/dependency&gt; ... &lt;/dependencies&gt; </code></pre> <p>The question is how to ensure that maven can find the jar? If the jar were in the Maven Global repository it would find it automatically, so always check this first. If not, then you will have to <strong>create your own repository to store custom jars</strong>. This may not be the most clever way to do it, but it's how I do it. Note that this is <strong>not</strong> the same thing as the cache stored in the <code>.m2</code> folder.</p> <p>Let's say we want to use c:\maven\repo as our local. To do this, first ensure the folder exists then add the following lines to your <code>pom.xml</code>:</p> <pre><code>&lt;repositories&gt; &lt;repository&gt; &lt;id&gt;my-repo&lt;/id&gt; &lt;url&gt;file://c:\maven\repo&lt;/url&gt; &lt;/repository&gt; &lt;/repositories&gt; </code></pre> <p>Next, you will need to manually add the contribution jar to this repo. To do this execute the <code>mvn deploy:deploy-file</code> command and give it the appropriate values. See <a href="http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html" rel="nofollow" title="Maven Deploy Plugin">here</a> for more information.</p> <p>Now when build/compile/package your original project, it should include contribution.jar in the packaging as it is a dependency.</p> <p>Hope this helps :)</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. 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.
 

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