Skip to content

Commit

Permalink
JENKINS-55472 bump integration of the Maven Invoker Plugin to v2.x an…
Browse files Browse the repository at this point in the history
…d support node path naming #196

Squash commits from olivier lamy <olamy@apache.org>
  • Loading branch information
olamy authored and Cyrille Le Clerc committed Jan 9, 2019
1 parent 5439ad3 commit 1cd7e00
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 5 deletions.
68 changes: 65 additions & 3 deletions jenkins-plugin/pom.xml
Expand Up @@ -69,7 +69,7 @@
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>3.1.2</version>
<version>3.2</version>
<!--
Discussed on https://github.com/jenkinsci/pipeline-maven-plugin/pull/48
Keep the dependency optional
Expand All @@ -87,6 +87,68 @@
</exclusion>
</exclusions>
</dependency>
<!-- we need to force some dependencies introduced by plugin depending on maven-plugin such jacoco or invoker-->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
<version>3.5.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.5.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.2.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-sink-api</artifactId>
<version>1.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-logging-api</artifactId>
<version>1.7</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-site-renderer</artifactId>
<version>1.7.4</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.4.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<optional>true</optional>
</dependency>
<!-- END -->
<dependency>
<!-- temporarily use the database-mysql to load mysql-connector jar but it would be better,
less intrusive, to have a plugin dedicated to the mysql jdbc driver, without the load JPA...-->
Expand Down Expand Up @@ -204,7 +266,7 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.3</version>
<version>2.3</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
Expand Down Expand Up @@ -480,7 +542,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>2.5</version>
</dependency>
<dependency>
<groupId>org.jvnet.localizer</groupId>
Expand Down
Expand Up @@ -37,6 +37,7 @@
import org.jenkinsci.plugins.pipeline.maven.MavenPublisher;
import org.jenkinsci.plugins.pipeline.maven.util.FileUtils;
import org.jenkinsci.plugins.pipeline.maven.util.XmlUtils;
import org.jenkinsci.plugins.workflow.graph.FlowNode;
import org.jenkinsci.plugins.workflow.steps.StepContext;
import org.kohsuke.stapler.DataBoundConstructor;
import org.w3c.dom.Element;
Expand Down Expand Up @@ -136,8 +137,10 @@ private void executeReporter(StepContext context, TaskListener listener, List<El
pluginInvocation + ": " + testResults);
MavenInvokerRecorder archiver = new MavenInvokerRecorder("**/" + reportsDirectory + "/BUILD*.xml", "**/" + (cloneProjectsTo != null ? cloneProjectsTo : projectsDirectory));

FlowNode node = context.get( FlowNode.class);

try {
archiver.perform(run, workspace, launcher, listener);
archiver.perform(run, workspace, launcher, listener, node);
} catch (Exception e) {
listener.error("[withMaven] invokerPublisher - Silently ignore exception archiving Invoker runs for Maven artifact " + mavenArtifact.toString() + " generated by " + pluginInvocation + ": " + e);
LOGGER.log(Level.WARNING, "Exception processing " + XmlUtils.toString(testEvent), e);
Expand Down
@@ -1,11 +1,11 @@
package org.jenkinsci.plugins.pipeline.maven.cause;

import edu.emory.mathcs.backport.java.util.Arrays;
import org.hamcrest.Matchers;
import org.jenkinsci.plugins.pipeline.maven.MavenArtifact;
import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

Expand Down

0 comments on commit 1cd7e00

Please sign in to comment.