title: Jenkins Pipeline Plugin -- getting and building dependencies
body: <p>I'm brand new to Jenkins, and my searches are turning up so little that I think I just don't get the terminology yet.</p>
  
  <p>I have a project I want to build with Jenkins Pipelines. It's a Java/maven project, in a GIT repository. It depends on two other Java/maven projects of mine, also in GIT repositories.</p>
  
  <p><strong>How do I explain this relationship to Jenkins?</strong></p>
  
  <p>Let's simplify. Say I have ProjectA that depends on ProjectB. I can get Jenkins to build ProjectB no problem. I can even archive the jar if I want, so a compiled copy of ProjectB is stored in my Jenkins server. </p>
  
  <p>But no matter what I do, ProjectA fails to build with </p>
  
  <blockquote>
    <p>[ERROR] Failed to execute goal on project ProjectA: Could not resolve dependencies for project ProjectA: The following artifacts could not be resolved: ProjectB:jar:0.9: Failure to find ProjectB:jar:0.9 in <a href="https://repo.maven.apache.org/maven2" rel="nofollow noreferrer">https://repo.maven.apache.org/maven2</a> was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]</p>
  </blockquote>
  
  <p>This HAS to be super simple, I just can't figure out what I even need to search for.</p>
  
  <p>My Jenkinsfile in ProjectA looks like this right now:</p>
  
  <pre><code>pipeline {
  agent {
      docker {
          image 'maven:3-alpine'
          args '-v /root/.m2:/root/.m2'
      }
  }
  stages {
      stage('Build') {
          steps {
              build 'ProjectB'
              sh 'mvn -B -DskipTests clean package'
          }
      }
  }
  </code></pre>
  
  <p>}</p>