maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ifedore...@apache.org
Subject git commit: MPLUGINTESTING-40 setup aether repository system session
Date Wed, 02 Jul 2014 19:45:05 GMT
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 <ifedorenko@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 <ifedorenko@apache.org>
Authored: Wed Jul 2 23:43:31 2014 +0400
Committer: Igor Fedorenko <ifedorenko@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;


Mime
View raw message