title: How to configure Maven2 to publish to Artifactory?
body: <p>Currently I have a Maven2 project that builds a JAR when you run:</p>
  
  <pre><code>mvn clean package
  </code></pre>
  
  <p>I need to now tweak the <code>pom.xml</code> to publish this JAR (<code>myapp.jar</code>) to an Artifactory server running at:</p>
  
  <pre><code>http://myartifactory/artifactory/simple/myorg/myapp/0.1
  </code></pre>
  
  <p>I tried adding a <code>&lt;repositories&gt;</code> element to my <code>pom.xml</code> but nothing is being published with this config:</p>
  
  <pre><code>&lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;myartifactory&lt;/id&gt;
          &lt;url&gt;http://myartifactory/artifactory/simple/&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  </code></pre>
  
  <p>Any ideas as to how I could get publishing to work?  For simplicity's sake, pretend that this Artifactory repo is authenticated to accept publishes/writes from a user with a <code>username=foo</code> and <code>password=bar</code>.</p>