title: Building Maven Projects with Jenkins
body: <p>I'm new to both Maven and Jenkins so bear with me here...</p>
  
  <p>I've got a Maven project that builds correctly when I run <strong>mvn install</strong> from within the project folder, but when I attempt to build via Jenkins, no dependencies can be resolved at all. Am I missing something/screwed something up in my Maven or Jenkins settings?</p>
  
  <p>Project POM and .m2/settings.xml are below...</p>
  
  <p><strong>pom.xml</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0  http://maven.apache.org/xsd/maven-    4.0.0.xsd"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;project&lt;/groupId&gt;
  &lt;artifactId&gt;ProjectGUI&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;name&gt;ProjectGUI&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;repositories&gt;
  &lt;repository&gt;
    &lt;id&gt;central&lt;/id&gt;
    &lt;url&gt;http://server:8081/nexus/content/groups/public&lt;/url&gt;
    &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
    &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
  &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
              &lt;configuration&gt;                   
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;package-jar-with-dependencies&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;single&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                             &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                          &lt;archive&gt;
                                                          &lt;manifestEntries&gt;
                                                              &lt;Manifest-   Version&gt;1.0&lt;/Manifest-Version&gt;
                                                              &lt;Main-Class&gt;project.Main&lt;/Main-Class&gt;
                                                              &lt;SplashScreen-    Image&gt;splash.png&lt;/SplashScreen-Image&gt;
                                                          &lt;/manifestEntries&gt;
                                                      &lt;/archive&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifestEntries&gt;
                          &lt;Manifest-Version&gt;1.0&lt;/Manifest-Version&gt;
                          &lt;Main-Class&gt;project.Main&lt;/Main-Class&gt;
                          &lt;SplashScreen-Image&gt;splash.png&lt;/SplashScreen-Image&gt;
                      &lt;/manifestEntries&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;    
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;properties&gt;
  &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.googlecode.lambdaj&lt;/groupId&gt;
    &lt;artifactId&gt;lambdaj&lt;/artifactId&gt;
    &lt;version&gt;2.3.3&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.hamcrest&lt;/groupId&gt;
    &lt;artifactId&gt;hamcrest-all&lt;/artifactId&gt;
    &lt;version&gt;1.3&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;javax.media&lt;/groupId&gt;
    &lt;artifactId&gt;jmf&lt;/artifactId&gt;
    &lt;version&gt;2.1.1e&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
    &lt;artifactId&gt;logback-classic&lt;/artifactId&gt;
    &lt;version&gt;1.0.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;jfree&lt;/groupId&gt;
    &lt;artifactId&gt;jfreechart&lt;/artifactId&gt;
    &lt;version&gt;1.0.13&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.jidesoft&lt;/groupId&gt;
    &lt;artifactId&gt;jide-charts&lt;/artifactId&gt;
    &lt;version&gt;3.4.8&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;com.jidesoft&lt;/groupId&gt;
    &lt;artifactId&gt;jide-common&lt;/artifactId&gt;
    &lt;version&gt;3.4.8&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.jogamp.gluegen&lt;/groupId&gt;
    &lt;artifactId&gt;gluegen-rt-main&lt;/artifactId&gt;
    &lt;version&gt;2.0-rc11&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.jogamp.jogl&lt;/groupId&gt;
    &lt;artifactId&gt;jogl-all-main&lt;/artifactId&gt;
    &lt;version&gt;2.0-rc11&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.jzy3d&lt;/groupId&gt;
      &lt;artifactId&gt;jzy3d&lt;/artifactId&gt;
      &lt;version&gt;0.9&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
    &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
    &lt;version&gt;1.7.2&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>.m2/settings.xml</strong></p>
  
  <pre><code>&lt;settings&gt;
  &lt;mirrors&gt;
  &lt;mirror&gt;
    &lt;!--This sends everything else to /public --&gt;
    &lt;id&gt;nexus&lt;/id&gt;
    &lt;mirrorOf&gt;central&lt;/mirrorOf&gt;
    &lt;url&gt;http://server:8081/nexus/content/groups/public&lt;/url&gt;
  &lt;/mirror&gt;
  &lt;/mirrors&gt;
  &lt;profiles&gt;
  &lt;profile&gt;
    &lt;id&gt;nexus&lt;/id&gt;
    &lt;!--Enable snapshots for the built in central repo to direct --&gt;
    &lt;!--all requests to nexus via the mirror --&gt;
    &lt;repositories&gt;
      &lt;repository&gt;
        &lt;id&gt;central&lt;/id&gt;
        &lt;url&gt;http://central&lt;/url&gt;
        &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
        &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/repository&gt;
    &lt;/repositories&gt;
   &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
        &lt;id&gt;central&lt;/id&gt;
        &lt;url&gt;http://central&lt;/url&gt;
        &lt;releases&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/releases&gt;
        &lt;snapshots&gt;&lt;enabled&gt;true&lt;/enabled&gt;&lt;/snapshots&gt;
      &lt;/pluginRepository&gt;
    &lt;/pluginRepositories&gt;
  &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;activeProfiles&gt;
  &lt;!--make the profile active all the time --&gt;
  &lt;activeProfile&gt;nexus&lt;/activeProfile&gt;
  &lt;/activeProfiles&gt;
  &lt;/settings&gt;
  </code></pre>