title: How can I have CloudBees Jenkins Grails build pick up a JAR from the private maven repository?
body: <p>I have a Grails (2.2.3) project which I am trying to build on CloudBees.  The project uses a third party library which is not currently hosted in any public maven repo.  I therefore need to publish this library jar to a private maven repo that the Jenkins build on CLoudbees can access.</p>
  
  <p>I have successfuly built the third-party jar and published it to my local maven repo on my computer.</p>
  
  <p>As per directions at <a href="http://wiki.cloudbees.com/bin/view/DEV/CloudBees+Private+Maven+Repository" rel="nofollow">http://wiki.cloudbees.com/bin/view/DEV/CloudBees+Private+Maven+Repository</a> , I have published the third party jar to my cloudbees release and snapshot repositories.</p>
  
  <p>However, this is not enough for the Cloudbees Jenkins build to fetch the singly jar.</p>
  
  <p>I know that everything else in my build setup is fine, because if I add the third-party jar into the /lib/ folder of my grails app, the build goes through, but adding dependencies into the /lib/ folder is not good practice, so I want to avoid it. </p>
  
  <p>Here is the error I see when trying to build:</p>
  
  <pre><code>| Loading Grails 2.2.3
  | Configuring classpath
  :: problems summary ::
  :::: WARNINGS
          module not found: com.singly#singly-sdk;1.0.0-SNAPSHOT
      ==== grailsPlugins: tried
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /scratch/jenkins/workspace/foobarapp master/foobarapp/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/cache-1.0.0/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/hibernate-2.2.3/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/webxml-1.4.1/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/jquery-1.8.0/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/tomcat-2.2.3/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/database-migration-1.1/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/resources-1.1.6/lib/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/2.2.3/projects/foobarapp/plugins/rest-0.7/lib/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsHome: tried
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/ivy-1.0.0-SNAPSHOT.xml
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/jars/singly-sdk-1.0.0-SNAPSHOT.jar
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/lib/com.singly/singly-sdk/bundles/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsHome: tried
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/src/libs/singly-sdk-1.0.0-SNAPSHOT.xml
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/src/libs/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsHome: tried
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/dist/singly-sdk-1.0.0-SNAPSHOT.xml
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/dist/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsHome: tried
        /home/jenkins/.grails/2.2.3/cached-installed-plugins/singly-sdk-1.0.0-SNAPSHOT.xml
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.grails/2.2.3/cached-installed-plugins/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsHome: tried
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/plugins/singly-sdk-1.0.0-SNAPSHOT.pom
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.grails/wrapper/2.2.3/grails-2.2.3/plugins/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== grailsCentral: tried
        http://grails.org/plugins/grails-singly-sdk/tags/RELEASE_1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        http://grails.org/plugins/grails-singly-sdk/tags/RELEASE_1.0.0-SNAPSHOT/grails-singly-sdk-1.0.0-SNAPSHOT.jar
      ==== localMavenResolver: tried
        /home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== mavenCentral: tried
        http://repo1.maven.org/maven2/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        http://repo1.maven.org/maven2/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
      ==== localMavenResolver: tried
        /home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.pom
        -- artifact com.singly#singly-sdk;1.0.0-SNAPSHOT!singly-sdk.jar:
        /home/jenkins/.m2/repository/com/singly/singly-sdk/1.0.0-SNAPSHOT/singly-sdk-1.0.0-SNAPSHOT.jar
          ::::::::::::::::::::::::::::::::::::::::::::::
          ::          UNRESOLVED DEPENDENCIES         ::
          ::::::::::::::::::::::::::::::::::::::::::::::
          :: com.singly#singly-sdk;1.0.0-SNAPSHOT: not found
          ::::::::::::::::::::::::::::::::::::::::::::::
  </code></pre>
  
  <p>Essentially, Jenkins does not know that it has to look in the Cloudbees snapshot or release repositories as well.</p>
  
  <p>This document: <a href="http://wiki.cloudbees.com/bin/view/DEV/Sharing+Files+with+Build+Executors" rel="nofollow">http://wiki.cloudbees.com/bin/view/DEV/Sharing+Files+with+Build+Executors</a>
  says that you can configure a CloudBees Jenkins build to use a maven settings.xml file of your choice, but the CloudBees <em>grails</em> Jeknins build does not seem to provide a way of  setting up a custom maven settings.xml</p>
  
  <p>What do I need to do to get the Cloudbees Grails Jenikns Build to fetch jars from the cloudbees snapshot or release repositories?</p>