maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1748771 - in /maven/plugins/trunk/maven-assembly-plugin/src: main/java/org/apache/maven/plugins/assembly/archive/task/ test/java/org/apache/maven/plugins/assembly/archive/task/testutils/
Date Thu, 16 Jun 2016 18:49:59 GMT
Author: rfscholte
Date: Thu Jun 16 18:49:59 2016
New Revision: 1748771

URL: http://svn.apache.org/viewvc?rev=1748771&view=rev
Log:
Simplify code, no need to check Aether implementation when working with projectBuildingRequest


Removed:
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/ProjectBuildingRequestCreator.java
Modified:
    maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java
    maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugins/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java

Modified: maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java?rev=1748771&r1=1748770&r2=1748771&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/main/java/org/apache/maven/plugins/assembly/archive/task/AddDependencySetsTask.java
Thu Jun 16 18:49:59 2016
@@ -20,7 +20,6 @@ package org.apache.maven.plugins.assembl
  */
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.Model;
 import org.apache.maven.plugins.assembly.AssemblerConfigurationSource;
@@ -179,12 +178,7 @@ public class AddDependencySetsTask
 
     private ProjectBuildingRequest getProjectBuildingRequest( AssemblerConfigurationSource
configSource )
     {
-        MavenSession session = configSource.getMavenSession();
-        ProjectBuildingRequest pbr = ProjectBuildingRequestCreator.create( session );
-        pbr.setRemoteRepositories( configSource.getRemoteRepositories() );
-        pbr.setLocalRepository( configSource.getLocalRepository() );
-        //pbr.setRepositorySession(  configSource.getR''  )
-        return pbr;
+        return configSource.getMavenSession().getProjectBuildingRequest();
     }
 
     private boolean isUnpackWithOptions( DependencySet dependencySet )

Modified: maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugins/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugins/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java?rev=1748771&r1=1748770&r2=1748771&view=diff
==============================================================================
--- maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugins/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
(original)
+++ maven/plugins/trunk/maven-assembly-plugin/src/test/java/org/apache/maven/plugins/assembly/archive/task/testutils/MockAndControlForAddDependencySetsTask.java
Thu Jun 16 18:49:59 2016
@@ -41,7 +41,6 @@ import org.codehaus.plexus.archiver.Arch
 import org.codehaus.plexus.archiver.manager.ArchiverManager;
 import org.easymock.EasyMock;
 import org.easymock.classextension.EasyMockSupport;
-import org.sonatype.aether.RepositorySystemSession;
 
 import java.io.File;
 import java.nio.charset.Charset;
@@ -70,9 +69,8 @@ public class MockAndControlForAddDepende
     private final MavenProject project;
 
     private final MavenSession session;
-
-    private final RepositorySystemSession repositorySession;
-
+    
+    private final ProjectBuildingRequest projectBuildingRequest;
 
     public MockAndControlForAddDependencySetsTask( final EasyMockSupport mockManager )
     {
@@ -84,8 +82,11 @@ public class MockAndControlForAddDepende
         this.project = project;
 
         this.session = mockManager.createMock( MavenSession.class );
-        this.repositorySession = mockManager.createMock( RepositorySystemSession.class );
+        
+        this.projectBuildingRequest = mockManager.createMock( ProjectBuildingRequest.class
);
+
         archiver = mockManager.createMock( Archiver.class );
+        
         configSource = mockManager.createMock( AssemblerConfigurationSource.class );
 
         projectBuilder = mockManager.createMock( ProjectBuilder.class );
@@ -100,7 +101,7 @@ public class MockAndControlForAddDepende
     private void enableDefaultExpectations()
     {
         expect( configSource.getProject() ).andReturn( project ).anyTimes();
-        expect( session.getRepositorySession() ).andReturn( repositorySession ).anyTimes();
+        expect( session.getProjectBuildingRequest() ).andReturn( projectBuildingRequest ).anyTimes();
         expect( session.getSystemProperties() ).andReturn( new Properties() ).anyTimes();
         expect( session.getUserProperties() ).andReturn( new Properties() ).anyTimes();
         expect( session.getExecutionProperties() ).andReturn( new Properties() ).anyTimes();



Mime
View raw message