You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/02/29 20:05:23 UTC

[maven] branch MNG-6656 updated (475fca2 -> a94e2d1)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch MNG-6656
in repository https://gitbox.apache.org/repos/asf/maven.git.


    from 475fca2  [MNG-6656] Replace CacheManager with already existing ReactorModelPool
     add b0d2846  [MNG-6859] Build not reproducible when built from source release
     add d9bf929  [MNG-6562] added WARNING on default bindings plugins unlocked versions
     add 9ae008a  use https://repository.a.o/ for Apache SNAPSHOT plugins
     add f2e9afd  Refactor getLocalRepository() in tests by using the repositorySystem
     new 1218fe3  Merge branch 'master' into MNG-6656
     new a94e2d1  Revert tests with unneeded changes

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 apache-maven/pom.xml                               |  2 +-
 maven-core/pom.xml                                 | 37 +--------------------
 .../plugin/DefaultLifecycleBindingsInjector.java   | 36 +++++++++++++++++---
 .../project/AbstractMavenProjectTestCase.java      |  7 +---
 .../project/DefaultMavenProjectBuilderTest.java    |  6 +---
 .../apache/maven/project/ProjectBuilderTest.java   | 24 +++++++-------
 .../test/projects/project-builder/MNG-6723/pom.xml | 38 ++++++++++++++++++++++
 7 files changed, 86 insertions(+), 64 deletions(-)


[maven] 02/02: Revert tests with unneeded changes

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-6656
in repository https://gitbox.apache.org/repos/asf/maven.git

commit a94e2d15c6e590cc008c8551d1e9ee4e44a250c9
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Feb 29 21:05:12 2020 +0100

    Revert tests with unneeded changes
---
 .../apache/maven/project/ProjectBuilderTest.java   | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
index 4833b00..6c7fbf9 100644
--- a/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/ProjectBuilderTest.java
@@ -26,6 +26,8 @@ import static org.hamcrest.Matchers.is;
 import static org.junit.Assert.assertThat;
 
 import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -39,7 +41,6 @@ import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.model.building.ModelSource;
 import org.apache.maven.shared.utils.io.FileUtils;
 
-import com.google.common.io.Files;
 
 public class ProjectBuilderTest
     extends AbstractCoreMavenComponentTestCase
@@ -142,22 +143,23 @@ public class ProjectBuilderTest
         String initialValue = System.setProperty( DefaultProjectBuilder.DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY, Boolean.toString( true ) );
         // TODO a similar test should be created to test the dependency management (basically all usages
         // of DefaultModelBuilder.getCache() are affected by MNG-6530
-        File tempDir = Files.createTempDir();
-        FileUtils.copyDirectoryStructure (new File( "src/test/resources/projects/grandchild-check"), tempDir );
+
+        Path tempDir = Files.createTempDirectory( null );
+        FileUtils.copyDirectoryStructure ( new File( "src/test/resources/projects/grandchild-check" ), tempDir.toFile() );
         try
         {
             MavenSession mavenSession = createMavenSession( null );
             ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
             configuration.setRepositorySession( mavenSession.getRepositorySession() );
             org.apache.maven.project.ProjectBuilder projectBuilder = lookup( org.apache.maven.project.ProjectBuilder.class );
-            File child = new File( tempDir, "child/pom.xml" );
+            File child = new File( tempDir.toFile(), "child/pom.xml" );
             // build project once
             projectBuilder.build( child, configuration );
             // modify parent
-            File parent = new File( tempDir, "pom.xml" );
+            File parent = new File( tempDir.toFile(), "pom.xml" );
             String parentContent = FileUtils.fileRead( parent );
             parentContent = parentContent.replaceAll( "<packaging>pom</packaging>",
-            		"<packaging>pom</packaging><properties><addedProperty>addedValue</addedProperty></properties>" );
+                    "<packaging>pom</packaging><properties><addedProperty>addedValue</addedProperty></properties>" );
             FileUtils.fileWrite( parent, "UTF-8", parentContent );
             // re-build pom with modified parent
             ProjectBuildingResult result = projectBuilder.build( child, configuration );
@@ -173,7 +175,7 @@ public class ProjectBuilderTest
             {
                 System.setProperty( DefaultProjectBuilder.DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY, initialValue );
             }
-            FileUtils.deleteDirectory( tempDir );
+            FileUtils.deleteDirectory( tempDir.toFile() );
         }
     }
 
@@ -303,7 +305,7 @@ public class ProjectBuilderTest
         return null;
     }
 
-    private void assertResultShowNoError(List<ProjectBuildingResult> results)
+    private void assertResultShowNoError( List<ProjectBuildingResult> results )
     {
         for ( ProjectBuildingResult result : results )
         {
@@ -320,12 +322,12 @@ public class ProjectBuilderTest
         ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
         configuration.setRepositorySession( mavenSession.getRepositorySession() );
         configuration.setResolveDependencies( true );
-        List<ProjectBuildingResult> result = projectBuilder.build( Collections.singletonList(file), true, configuration );
-        MavenProject project = result.get(0).getProject();
+        List<ProjectBuildingResult> result = projectBuilder.build( Collections.singletonList( file ), true, configuration );
+        MavenProject project = result.get( 0 ).getProject();
         // verify a few typical parameters are not duplicated
         assertEquals( 1, project.getTestCompileSourceRoots().size() );
         assertEquals( 1, project.getCompileSourceRoots().size() );
         assertEquals( 1, project.getMailingLists().size() );
         assertEquals( 1, project.getResources().size() );
     }
-}
+}
\ No newline at end of file


[maven] 01/02: Merge branch 'master' into MNG-6656

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-6656
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 1218fe3fd4824f62ca19cd9e0f1a28f783e224c1
Merge: 475fca2 f2e9afd
Author: rfscholte <rf...@apache.org>
AuthorDate: Sat Feb 29 21:02:02 2020 +0100

    Merge branch 'master' into MNG-6656

 apache-maven/pom.xml                               |  2 +-
 maven-core/pom.xml                                 | 37 +--------------------
 .../plugin/DefaultLifecycleBindingsInjector.java   | 36 +++++++++++++++++---
 .../project/AbstractMavenProjectTestCase.java      |  7 +---
 .../project/DefaultMavenProjectBuilderTest.java    |  6 +---
 .../test/projects/project-builder/MNG-6723/pom.xml | 38 ++++++++++++++++++++++
 6 files changed, 73 insertions(+), 53 deletions(-)