You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by if...@apache.org on 2014/07/02 21:45:05 UTC
git commit: MPLUGINTESTING-40 setup aether repository system session
Repository: maven-plugin-testing
Updated Branches:
refs/heads/master d090e4ec5 -> 3cd5f47c5
MPLUGINTESTING-40 setup aether repository system session
This solves NPE when running tests with maven 3.2.2 core libraries
but still compatible with maven 3.1.1 and 3.2.1.
Signed-off-by: Igor Fedorenko <if...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/commit/3cd5f47c
Tree: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/tree/3cd5f47c
Diff: http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/diff/3cd5f47c
Branch: refs/heads/master
Commit: 3cd5f47c586499e438a3f9393304ac9d1f9a7f53
Parents: d090e4e
Author: Igor Fedorenko <if...@apache.org>
Authored: Wed Jul 2 23:43:31 2014 +0400
Committer: Igor Fedorenko <if...@apache.org>
Committed: Wed Jul 2 23:43:37 2014 +0400
----------------------------------------------------------------------
.../src/main/java/org/apache/maven/plugin/testing/MojoRule.java | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/maven-plugin-testing/blob/3cd5f47c/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java
----------------------------------------------------------------------
diff --git a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java
index 858cfe1..30d2073 100644
--- a/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java
+++ b/maven-plugin-testing-harness/src/main/java/org/apache/maven/plugin/testing/MojoRule.java
@@ -37,6 +37,7 @@ import org.codehaus.plexus.component.configurator.ComponentConfigurationExceptio
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.configuration.PlexusConfiguration;
import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.eclipse.aether.DefaultRepositorySystemSession;
import org.junit.Assert;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
@@ -320,6 +321,7 @@ public class MojoRule
MavenExecutionRequest request = new DefaultMavenExecutionRequest();
request.setBaseDirectory( basedir );
ProjectBuildingRequest configuration = request.getProjectBuildingRequest();
+ configuration.setRepositorySession( new DefaultRepositorySystemSession() );
MavenProject project = lookup( ProjectBuilder.class ).build( pom, configuration ).getProject();
Assert.assertNotNull( project );
return project;