title: How to split maven tasks between tasks and pipelines without running redundant maven tasks
body: <p>I'm trying to set up a deployment pipeline using GoCD as follows:</p>
  
  <ol>
  <li>Compile, test and deploy to Maven repo
  
  <ol>
  <li>Check out source code from SVN</li>
  <li>Run mvn clean compile test install</li>
  <li>Run mvn deploy to deploy the WAR artifact to Sonatype repo</li>
  </ol></li>
  <li>Deploy to Tomcat server
  
  <ol>
  <li>Retrieve WAR artifact from Sonatype repo</li>
  <li>Run mvn tomcat7:redeploy to deploy it to the Tomcat instance I have running</li>
  </ol></li>
  </ol>
  
  <p>The thing is, I can't seem to split 1.2 and 1.3 (for example) without having to rerun the whole the entire source code checkout again in 1.3. This seems redundant to me as I had already gotten it up to the package stage and should be able to just continue to run from there.</p>
  
  <p>Between 1.3 and 2.2, I can see that it can retrieve the WAR artifact from Sonatype, but I can't do much with it with maven because there's just no pom.xml for me to execute the maven task with. Of course, I can just add the source code material and run the entire mvn package tomcat7:redeploy cycle again, but I'm pretty sure that's not what this was designed for initially. </p>
  
  <p>I can also write a shell script and ask Go to run it to copy the WAR file to the right location, but again, I could have done everything in one maven pass and save myself some effort but that would just reduce the entire pipeline to a single box which isn't much help to help visualize the deployment pipeline.</p>
  
  <p>Can I get some advice on how I should be designing this pipeline if I wanted to split a maven task flow into different Go tasks / pipelines?</p>
  
  <p>Thanks
  Wong</p>