title: Deploying a Maven one-jar deploys wrong artifact
body: <p>I am trying to build a single-jar Java utility.  In <a href="https://stackoverflow.com/a/11160606/827480">this previous SO post</a>, someone recommended using the <a href="http://code.google.com/p/onejar-maven-plugin/" rel="nofollow noreferrer">onejar-maven-plugin</a> plugin.  I have tried it, but the problem I am encountering is that the plugin (1.4.4) is creates a new artifact with a one-jar.jar extension.  Consequently, I end up with 2 jars in my target folder and when I try to install and/or deploy, it deploys the original jar (not the one-jar).</p>
  
  <p>I have run the one-jar.jar artifact from the target folder and it works exactly as expected, so I am quite content with that.  However, if I cannot deploy it properly using standard <code>mvn deploy</code> command syntax, the plugin doesn't really perform as expected or as required.</p>
  
  <p>Is there a way to properly structure the pom configuration to avoid this issue?</p>
  
  <p>My current pom reads:</p>
  
  <pre><code>                &lt;plugin&gt;
                      &lt;groupId&gt;com.jolira&lt;/groupId&gt;
                      &lt;artifactId&gt;onejar-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;1.4.4&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;configuration&gt;
                                  &lt;mainClass&gt;com.nbfg.cws.cs.lendingsimulationservice.Client&lt;/mainClass&gt;
                                  &lt;onejarVersion&gt;0.97&lt;/onejarVersion&gt;
                                  &lt;attachToBuild&gt;true&lt;/attachToBuild&gt;
                              &lt;/configuration&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;one-jar&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
  </code></pre>
  
  <p>Maven output when running <code>mvn deploy</code>:</p>
  
  <p>Tests run: 0, Failures: 0, Errors: 0, Skipped: 0</p>
  
  <pre><code>[INFO]
  [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ lss-client ---
  [INFO]
  [INFO] --- onejar-maven-plugin:1.4.4:one-jar (default) @ lss-client ---
  [INFO] Using One-Jar to create a single-file distribution
  [INFO] Implementation Version: 0.0.1-SNAPSHOT
  [INFO] Using One-Jar version: 0.97
  [INFO] More info on One-Jar: http://one-jar.sourceforge.net/
  [INFO] License for One-Jar:  http://one-jar.sourceforge.net/one-jar-license.txt
  [INFO] One-Jar file: C:\Dev\Eclipse Indigo\lssClient\target\lss-client-0.0.1-SNAPSHOT.one-jar.jar
  [INFO]
  [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ lss-client ---
  [INFO] Installing C:\Dev\Eclipse Indigo\lssClient\target\lss-client-0.0.1-SNAPSHOT.jar to C:\Users\C61271B4\.m2\repository\com\cws\cs\lss\lss-client\0.0.1-SNAPSHOT\lss-client-0.0.1-SNAPSHOT.jar
  [INFO] Installing C:\Dev\Eclipse Indigo\lssClient\pom.xml to C:\Users\C61271B4\.m2\repository\com\cws\cs\lss\lss-client\0.0.1-SNAPSHOT\lss-client-0.0.1-SNAPSHOT.pom
  [INFO] Installing C:\Dev\Eclipse Indigo\lssClient\target\lss-client-0.0.1-SNAPSHOT.one-jar.jar to C:\Users\C61271B4\.m2\repository\com\cws\cs\lss\lss-client\0.0.1-SNAPSHOT\lss-client-0.0.1-SNAPSHOT-onejar.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.874s
  [INFO] Finished at: Tue Jun 26 13:08:34 EDT 2012
  [INFO] Final Memory: 21M/512M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>Eric</p>