Exposing maven integration test phase to pipeline

13 views
Skip to first unread message

taroc...@gmail.com

unread,
Nov 9, 2016, 1:58:48 PM11/9/16
to Jenkins Users
I have a pipeline which does a maven build. During the integration test phase I invoke another Jenkins job. 

Is there a way to expose parts of the build process while I'm inside a Maven build?

// Jenkinsfile
node {
  stage(‘Compile’) {
    sh ‘mvn clean install’
  }
}
 
// pom.xml
<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-antrun-plugin</artifactId>
       <executions>
         <execution>
           <phase>integration-test</phase>
            <configuration>
              <target>
                <exec executable="java">
                  <arg value="-jar jenkins-cli.jar -s http://localhost:8080/jenkins/ build 'foo' -s" />
                </exec>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    ...

  Instead of this:

  Stage View:
  Compile -> End 

  I would like to see:

  Stage View:
  Compile -> Integration Test -> End

  And so I would like to somehow communicate to Jenkins, from within the pom file, that I am in another stage.
Reply all
Reply to author
Forward
0 new messages