You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2019/12/07 12:12:36 UTC

[maven] branch MODELTESTS_IMPROVEMENT updated (2f2437e -> 56118d6)

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

khmarbaise pushed a change to branch MODELTESTS_IMPROVEMENT
in repository https://gitbox.apache.org/repos/asf/maven.git.


 discard 2f2437e  Removing code redundancy Using assertj, JUnit Jupiter
     add 6f5f1f1  updated GitHub repository description
     add 56d4ea5  added link to documentation
     add 00654c2  [MNG-6810] - Remove profiles in maven-model
     add 0022733  Added .asf.yaml to be ignored by apache-rat-plguin.
     new 20455b2  Removing code redundancy Using assertj, JUnit Jupiter
     new da2902a  Safe State.
     new 56118d6  Fixed.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (2f2437e)
            \
             N -- N -- N   refs/heads/MODELTESTS_IMPROVEMENT (56118d6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 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:
 .asf.yaml                                          |   8 +
 .../maven/project/DefaultProjectBuilder.java       | 337 ++++++++++-----------
 .../maven/cli/event/ExecutionEventLogger.java      | 100 +++---
 maven-model/pom.xml                                |  42 ---
 pom.xml                                            |   1 +
 5 files changed, 209 insertions(+), 279 deletions(-)
 create mode 100644 .asf.yaml


[maven] 01/03: Removing code redundancy Using assertj, JUnit Jupiter

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

khmarbaise pushed a commit to branch MODELTESTS_IMPROVEMENT
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 20455b234813f1b72470d598b9c11912e20a57a6
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Nov 29 00:25:33 2019 +0100

    Removing code redundancy
    Using assertj, JUnit Jupiter
---
 maven-artifact/pom.xml                             |  5 ++
 maven-model/pom.xml                                | 23 +++++++-
 .../org/apache/maven/model/ActivationFileTest.java | 31 ++---------
 .../org/apache/maven/model/ActivationOSTest.java   | 29 +---------
 .../apache/maven/model/ActivationPropertyTest.java | 31 ++---------
 .../org/apache/maven/model/ActivationTest.java     | 31 ++---------
 .../java/org/apache/maven/model/BuildTest.java     | 31 ++---------
 .../org/apache/maven/model/CiManagementTest.java   | 31 ++---------
 .../org/apache/maven/model/ContributorTest.java    | 30 +---------
 .../maven/model/DependencyManagementTest.java      | 29 +---------
 .../org/apache/maven/model/DependencyTest.java     | 29 +---------
 .../maven/model/DeploymentRepositoryTest.java      | 29 +---------
 .../java/org/apache/maven/model/DeveloperTest.java | 29 +---------
 .../maven/model/DistributionManagementTest.java    | 29 +---------
 .../java/org/apache/maven/model/ExclusionTest.java | 29 +---------
 .../java/org/apache/maven/model/ExtensionTest.java | 29 +---------
 .../apache/maven/model/IssueManagementTest.java    | 29 +---------
 .../java/org/apache/maven/model/LicenseTest.java   | 29 +---------
 .../org/apache/maven/model/MailingListTest.java    | 29 +---------
 .../java/org/apache/maven/model/ModelTest.java     | 29 +---------
 .../org/apache/maven/model/ModelTestInterface.java | 65 ++++++++++++++++++++++
 .../java/org/apache/maven/model/NotifierTest.java  | 30 +---------
 .../org/apache/maven/model/OrganizationTest.java   | 30 +---------
 .../java/org/apache/maven/model/ParentTest.java    | 30 +---------
 .../maven/model/PluginConfigurationTest.java       | 29 +---------
 .../apache/maven/model/PluginContainerTest.java    | 29 +---------
 .../apache/maven/model/PluginExecutionTest.java    | 29 +---------
 .../apache/maven/model/PluginManagementTest.java   | 30 +---------
 .../java/org/apache/maven/model/PluginTest.java    | 30 +---------
 .../org/apache/maven/model/PrerequisitesTest.java  | 30 +---------
 .../java/org/apache/maven/model/ProfileTest.java   | 29 +---------
 .../org/apache/maven/model/RelocationTest.java     | 30 +---------
 .../org/apache/maven/model/ReportPluginTest.java   | 30 +---------
 .../java/org/apache/maven/model/ReportSetTest.java | 29 +---------
 .../java/org/apache/maven/model/ReportingTest.java | 30 +---------
 .../apache/maven/model/RepositoryPolicyTest.java   | 29 +---------
 .../org/apache/maven/model/RepositoryTest.java     | 31 ++---------
 .../java/org/apache/maven/model/ResourceTest.java  | 31 ++---------
 .../test/java/org/apache/maven/model/ScmTest.java  | 29 ++--------
 .../test/java/org/apache/maven/model/SiteTest.java | 30 +---------
 pom.xml                                            | 13 +++++
 41 files changed, 224 insertions(+), 980 deletions(-)

diff --git a/maven-artifact/pom.xml b/maven-artifact/pom.xml
index 336505b..5e7b339 100644
--- a/maven-artifact/pom.xml
+++ b/maven-artifact/pom.xml
@@ -41,6 +41,11 @@ under the License.
       <groupId>org.apache.commons</groupId>
       <artifactId>commons-lang3</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/maven-model/pom.xml b/maven-model/pom.xml
index 1a853f7..7a4e756 100644
--- a/maven-model/pom.xml
+++ b/maven-model/pom.xml
@@ -19,7 +19,8 @@ specific language governing permissions and limitations
 under the License.
 -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
@@ -42,11 +43,31 @@ under the License.
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.junit.jupiter</groupId>
+      <artifactId>junit-jupiter-engine</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.assertj</groupId>
+      <artifactId>assertj-core</artifactId>
+      <scope>test</scope>
+    </dependency>
+
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <compilerArgs>
+            <arg>-Xlint:deprecation</arg>
+            <arg>-Xlint:unchecked</arg>
+          </compilerArgs>
+        </configuration>
+      </plugin>
+      <plugin>
         <groupId>org.codehaus.modello</groupId>
         <artifactId>modello-maven-plugin</artifactId>
         <configuration>
diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java
index f88da58..d86651d 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ActivationFileTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code ActivationFile}.
  *
  * @author Benjamin Bentmann
  */
-public class ActivationFileTest
-    extends TestCase
+@DisplayName( "ActivationFile" )
+class ActivationFileTest implements ModelTestInterface< ActivationFile >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new ActivationFile().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new ActivationFile().equals( null ) );
-
-        new ActivationFile().equals( new ActivationFile() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        ActivationFile thing = new ActivationFile();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new ActivationFile().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java
index f0d3045..5820aed 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ActivationOSTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code ActivationOS}.
  *
  * @author Benjamin Bentmann
  */
-public class ActivationOSTest
-    extends TestCase
+@DisplayName( "ActivationOS" )
+class ActivationOSTest implements ModelTestInterface< ActivationOS >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new ActivationOS().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new ActivationOS().equals( null ) );
-
-        new ActivationOS().equals( new ActivationOS() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        ActivationOS thing = new ActivationOS();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new ActivationOS().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java
index 5f5e048..1727d29 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ActivationPropertyTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code ActivationProperty}.
  *
  * @author Benjamin Bentmann
  */
-public class ActivationPropertyTest
-    extends TestCase
+@DisplayName( "ActivationProperty" )
+class ActivationPropertyTest implements ModelTestInterface< ActivationProperty >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new ActivationProperty().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new ActivationProperty().equals( null ) );
-
-        new ActivationProperty().equals( new ActivationProperty() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        ActivationProperty thing = new ActivationProperty();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new ActivationProperty().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java b/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java
index f6d0f91..34d82e1 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ActivationTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Activation}.
  *
  * @author Benjamin Bentmann
  */
-public class ActivationTest
-    extends TestCase
+@DisplayName( "Activation" )
+class ActivationTest implements ModelTestInterface< Activation >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Activation().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Activation().equals( null ) );
-
-        new Activation().equals( new Activation() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Activation thing = new Activation();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Activation().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
index 80a60d5..e1488ad 100644
--- a/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/BuildTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Build}.
  *
  * @author Benjamin Bentmann
  */
-public class BuildTest
-    extends TestCase
+@DisplayName( "Build" )
+class BuildTest implements ModelTestInterface< Build >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Build().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Build().equals( null ) );
-
-        new Build().equals( new Build() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Build thing = new Build();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Build().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java
index 7194c84..5dacbfd 100644
--- a/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/CiManagementTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code CiManagement}.
  *
  * @author Benjamin Bentmann
  */
-public class CiManagementTest
-    extends TestCase
+@DisplayName( "CiManagement" )
+class CiManagementTest implements ModelTestInterface< CiManagement >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new CiManagement().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new CiManagement().equals( null ) );
-
-        new CiManagement().equals( new CiManagement() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        CiManagement thing = new CiManagement();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new CiManagement().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java b/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java
index 491b99a..3853cd1 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ContributorTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Contributor}.
  *
  * @author Benjamin Bentmann
  */
-public class ContributorTest
-    extends TestCase
+@DisplayName( "Contributore" )
+class ContributorTest implements ModelTestInterface< Contributor >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Contributor().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Contributor().equals( null ) );
-
-        new Contributor().equals( new Contributor() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Contributor thing = new Contributor();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Contributor().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java
index 7702c62..d4fd03a 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DependencyManagementTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code DependencyManagement}.
  *
  * @author Benjamin Bentmann
  */
-public class DependencyManagementTest
-    extends TestCase
+@DisplayName( "DependencyManagement" )
+class DependencyManagementTest implements ModelTestInterface< DependencyManagement >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new DependencyManagement().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new DependencyManagement().equals( null ) );
-
-        new DependencyManagement().equals( new DependencyManagement() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        DependencyManagement thing = new DependencyManagement();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new DependencyManagement().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java b/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java
index ec0a833..9438b97 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DependencyTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Dependency}.
  *
  * @author Benjamin Bentmann
  */
-public class DependencyTest
-    extends TestCase
+@DisplayName( "Dependency" )
+class DependencyTest implements ModelTestInterface< Dependency >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Dependency().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Dependency().equals( null ) );
-
-        new Dependency().equals( new Dependency() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Dependency thing = new Dependency();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Dependency().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java b/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java
index 169ec65..d598f6d 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DeploymentRepositoryTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code DeploymentRepository}.
  *
  * @author Benjamin Bentmann
  */
-public class DeploymentRepositoryTest
-    extends TestCase
+@DisplayName( "DeploymentRepository" )
+class DeploymentRepositoryTest implements ModelTestInterface< DeploymentRepository >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new DeploymentRepository().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new DeploymentRepository().equals( null ) );
-
-        new DeploymentRepository().equals( new DeploymentRepository() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        DeploymentRepository thing = new DeploymentRepository();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new DeploymentRepository().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
index c0dfe56..daa0e68 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DeveloperTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Developer}.
  *
  * @author Benjamin Bentmann
  */
-public class DeveloperTest
-    extends TestCase
+@DisplayName( "Developer" )
+class DeveloperTest implements ModelTestInterface< Developer >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Developer().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Developer().equals( null ) );
-
-        new Developer().equals( new Developer() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Developer thing = new Developer();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Developer().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java
index 0314d61..c514ca0 100644
--- a/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/DistributionManagementTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code DistributionManagement}.
  *
  * @author Benjamin Bentmann
  */
-public class DistributionManagementTest
-    extends TestCase
+@DisplayName( "DistributionManagement" )
+class DistributionManagementTest implements ModelTestInterface< DistributionManagement >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new DistributionManagement().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new DistributionManagement().equals( null ) );
-
-        new DistributionManagement().equals( new DistributionManagement() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        DistributionManagement thing = new DistributionManagement();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new DistributionManagement().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java b/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java
index 6febace..7595866 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ExclusionTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Exclusion}.
  *
  * @author Benjamin Bentmann
  */
-public class ExclusionTest
-    extends TestCase
+@DisplayName( "Exclusion" )
+class ExclusionTest implements ModelTestInterface< Exclusion >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Exclusion().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Exclusion().equals( null ) );
-
-        new Exclusion().equals( new Exclusion() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Exclusion thing = new Exclusion();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Exclusion().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java b/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java
index 4b8cd8a..ed39bb5 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ExtensionTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Extension}.
  *
  * @author Benjamin Bentmann
  */
-public class ExtensionTest
-    extends TestCase
+@DisplayName( "Extension" )
+class ExtensionTest implements ModelTestInterface< Extension >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Extension().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Extension().equals( null ) );
-
-        new Extension().equals( new Extension() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Extension thing = new Extension();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Extension().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
index 5e50c15..bdd0b9f 100644
--- a/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/IssueManagementTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code IssueManagement}.
  *
  * @author Benjamin Bentmann
  */
-public class IssueManagementTest
-    extends TestCase
+@DisplayName( "IssueManagement" )
+class IssueManagementTest implements ModelTestInterface< IssueManagement >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new IssueManagement().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new IssueManagement().equals( null ) );
-
-        new IssueManagement().equals( new IssueManagement() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        IssueManagement thing = new IssueManagement();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new IssueManagement().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
index 179921b..5fef64a 100644
--- a/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/LicenseTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code License}.
  *
  * @author Benjamin Bentmann
  */
-public class LicenseTest
-    extends TestCase
+@DisplayName( "License" )
+class LicenseTest implements ModelTestInterface< License >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new License().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new License().equals( null ) );
-
-        new License().equals( new License() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        License thing = new License();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new License().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
index 6129695..b2f3ebe 100644
--- a/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/MailingListTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code MailingList}.
  *
  * @author Benjamin Bentmann
  */
-public class MailingListTest
-    extends TestCase
+@DisplayName( "MailingList" )
+class MailingListTest implements ModelTestInterface< MailingList >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new MailingList().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new MailingList().equals( null ) );
-
-        new MailingList().equals( new MailingList() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        MailingList thing = new MailingList();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new MailingList().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ModelTest.java b/maven-model/src/test/java/org/apache/maven/model/ModelTest.java
index c9ec4da..2a16ba5 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ModelTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ModelTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Model}.
  *
  * @author Benjamin Bentmann
  */
-public class ModelTest
-    extends TestCase
+@DisplayName( "Model" )
+class ModelTest implements ModelTestInterface< Model >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Model().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Model().equals( null ) );
-
-        new Model().equals( new Model() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Model thing = new Model();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Model().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java b/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java
new file mode 100644
index 0000000..d8108de
--- /dev/null
+++ b/maven-model/src/test/java/org/apache/maven/model/ModelTestInterface.java
@@ -0,0 +1,65 @@
+package org.apache.maven.model;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatCode;
+
+interface ModelTestInterface< T >
+{
+    @SuppressWarnings( "unchecked" )
+    default T createNewInstance(Class< ? > x) throws ReflectiveOperationException
+    {
+        return ( T ) x.getDeclaredConstructor().newInstance();
+    }
+
+    @Test
+    @DisplayName( "hashCode should not fail with null." )
+    default void hashCodeNullSafe()
+    {
+        assertThatCode( () -> createNewInstance( this.getClass() ).hashCode() ).doesNotThrowAnyException();
+    }
+
+    @Test
+    @DisplayName( "equals should not fail with null." )
+    default void equalsNullSafe() throws ReflectiveOperationException
+    {
+        assertThat( createNewInstance( this.getClass() ).equals( null ) ).isFalse();
+    }
+
+    @Test
+    @DisplayName( "equals should result in false for two different instances." )
+    default void equalsSameToBeFalse() throws ReflectiveOperationException
+    {
+        T firstInstance = createNewInstance( this.getClass() );
+        T secondInstance = createNewInstance( this.getClass() );
+        assertThat( firstInstance.equals( secondInstance ) ).isFalse();
+    }
+
+    @Test
+    @DisplayName( "toString should not be null." )
+    default void toStringNullSafe() throws ReflectiveOperationException
+    {
+        assertThat( createNewInstance( this.getClass() ).toString() ).isNotNull();
+    }
+}
diff --git a/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java b/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java
index 4e5d068..ab4defb 100644
--- a/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/NotifierTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Notifier}.
  *
  * @author Benjamin Bentmann
  */
-public class NotifierTest
-    extends TestCase
+@DisplayName( "Notifier" )
+class NotifierTest implements ModelTestInterface< Notifier >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Notifier().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Notifier().equals( null ) );
-
-        new Notifier().equals( new Notifier() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Notifier thing = new Notifier();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Notifier().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
index 48abe77..ef5eb4f 100644
--- a/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/OrganizationTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Organization}.
  *
  * @author Benjamin Bentmann
  */
-public class OrganizationTest
-    extends TestCase
+@DisplayName( "Organization" )
+class OrganizationTest implements ModelTestInterface< Organization >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Organization().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Organization().equals( null ) );
-
-        new Organization().equals( new Organization() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Organization thing = new Organization();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Organization().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ParentTest.java b/maven-model/src/test/java/org/apache/maven/model/ParentTest.java
index 78d4567..3419438 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ParentTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ParentTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Parent}.
  *
  * @author Benjamin Bentmann
  */
-public class ParentTest
-    extends TestCase
+@DisplayName( "Parent" )
+class ParentTest implements ModelTestInterface< Parent >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Parent().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Parent().equals( null ) );
-
-        new Parent().equals( new Parent() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Parent thing = new Parent();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Parent().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java
index cbb123d..39642ba 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PluginConfigurationTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code PluginConfiguration}.
  *
  * @author Benjamin Bentmann
  */
-public class PluginConfigurationTest
-    extends TestCase
+@DisplayName( "PluginConfiguration" )
+class PluginConfigurationTest implements ModelTestInterface< PluginConfiguration >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new PluginConfiguration().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new PluginConfiguration().equals( null ) );
-
-        new PluginConfiguration().equals( new PluginConfiguration() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        PluginConfiguration thing = new PluginConfiguration();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new PluginConfiguration().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java
index 878298c..9aab597 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PluginContainerTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code PluginContainer}.
  *
  * @author Benjamin Bentmann
  */
-public class PluginContainerTest
-    extends TestCase
+@DisplayName( "PluginContainer" )
+class PluginContainerTest implements ModelTestInterface< PluginContainer >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new PluginContainer().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new PluginContainer().equals( null ) );
-
-        new PluginContainer().equals( new PluginContainer() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        PluginContainer thing = new PluginContainer();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new PluginContainer().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java
index e8fff51..8bd1241 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PluginExecutionTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code PluginExecution}.
  *
  * @author Benjamin Bentmann
  */
-public class PluginExecutionTest
-    extends TestCase
+@DisplayName( "PluginExecution" )
+class PluginExecutionTest implements ModelTestInterface< PluginExecution >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new PluginExecution().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new PluginExecution().equals( null ) );
-
-        new PluginExecution().equals( new PluginExecution() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        PluginExecution thing = new PluginExecution();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new PluginExecution().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java
index 571399f..d53450a 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PluginManagementTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code PluginManagement}.
  *
  * @author Benjamin Bentmann
  */
-public class PluginManagementTest
-    extends TestCase
+@DisplayName( "PluginManagement" )
+class PluginManagementTest implements ModelTestInterface< PluginManagement >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new PluginManagement().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new PluginManagement().equals( null ) );
-
-        new PluginManagement().equals( new PluginManagement() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        PluginManagement thing = new PluginManagement();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new PluginManagement().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PluginTest.java b/maven-model/src/test/java/org/apache/maven/model/PluginTest.java
index 582145e..f75a9f1 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PluginTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PluginTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Plugin}.
  *
  * @author Benjamin Bentmann
  */
-public class PluginTest
-    extends TestCase
+@DisplayName( "Plugin" )
+class PluginTest implements ModelTestInterface< Plugin >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Plugin().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Plugin().equals( null ) );
-
-        new Plugin().equals( new Plugin() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Plugin thing = new Plugin();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Plugin().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java b/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java
index 727f2c3..c3b3150 100644
--- a/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/PrerequisitesTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Prerequisites}.
  *
  * @author Benjamin Bentmann
  */
-public class PrerequisitesTest
-    extends TestCase
+@DisplayName( "Prerequisites" )
+class PrerequisitesTest implements ModelTestInterface< Prerequisites >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Prerequisites().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Prerequisites().equals( null ) );
-
-        new Prerequisites().equals( new Prerequisites() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Prerequisites thing = new Prerequisites();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Prerequisites().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java b/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java
index 512e2a8..921fca3 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ProfileTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Profile}.
  *
  * @author Benjamin Bentmann
  */
-public class ProfileTest
-    extends TestCase
+@DisplayName( "Profile" )
+class ProfileTest implements ModelTestInterface< Profile >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Profile().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Profile().equals( null ) );
-
-        new Profile().equals( new Profile() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Profile thing = new Profile();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Profile().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java b/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java
index 265304d..92dd309 100644
--- a/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/RelocationTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Relocation}.
  *
  * @author Benjamin Bentmann
  */
-public class RelocationTest
-    extends TestCase
+@DisplayName( "Relocation" )
+class RelocationTest implements ModelTestInterface< Relocation >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Relocation().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Relocation().equals( null ) );
-
-        new Relocation().equals( new Relocation() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Relocation thing = new Relocation();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Relocation().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java
index d10cb79..15c6586 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ReportPluginTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code ReportPlugin}.
  *
  * @author Benjamin Bentmann
  */
-public class ReportPluginTest
-    extends TestCase
+@DisplayName( "ReportPlugin" )
+class ReportPluginTest implements ModelTestInterface< ReportPlugin >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new ReportPlugin().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new ReportPlugin().equals( null ) );
-
-        new ReportPlugin().equals( new ReportPlugin() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        ReportPlugin thing = new ReportPlugin();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new ReportPlugin().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java
index 2f51415..864c9c9 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ReportSetTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code ReportSet}.
  *
  * @author Benjamin Bentmann
  */
-public class ReportSetTest
-    extends TestCase
+@DisplayName( "ReportSet" )
+class ReportSetTest implements ModelTestInterface< ReportSet >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new ReportSet().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new ReportSet().equals( null ) );
-
-        new ReportSet().equals( new ReportSet() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        ReportSet thing = new ReportSet();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new ReportSet().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java b/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java
index dbc0fa2..063b1e5 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ReportingTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Reporting}.
  *
  * @author Benjamin Bentmann
  */
-public class ReportingTest
-    extends TestCase
+@DisplayName( "Reporting" )
+class ReportingTest implements ModelTestInterface< Reporting >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Reporting().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Reporting().equals( null ) );
-
-        new Reporting().equals( new Reporting() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Reporting thing = new Reporting();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Reporting().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java b/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java
index 3ae3435..71c2b71 100644
--- a/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/RepositoryPolicyTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code RepositoryPolicy}.
  *
  * @author Benjamin Bentmann
  */
-public class RepositoryPolicyTest
-    extends TestCase
+@DisplayName( "RepositoryPolicy" )
+class RepositoryPolicyTest implements ModelTestInterface< RepositoryPolicy >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new RepositoryPolicy().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new RepositoryPolicy().equals( null ) );
-
-        new RepositoryPolicy().equals( new RepositoryPolicy() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        RepositoryPolicy thing = new RepositoryPolicy();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new RepositoryPolicy().toString() );
-    }
-
 }
diff --git a/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java b/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java
index b68b70a..713fa4a 100644
--- a/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/RepositoryTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Repository}.
  *
  * @author Benjamin Bentmann
  */
-public class RepositoryTest
-    extends TestCase
+@DisplayName( "Repository" )
+class RepositoryTest implements ModelTestInterface< Repository >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Repository().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Repository().equals( null ) );
-
-        new Repository().equals( new Repository() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Repository thing = new Repository();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Repository().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java b/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java
index fa40ab4..d09a3c6 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ResourceTest.java
@@ -19,38 +19,15 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Resource}.
  *
  * @author Benjamin Bentmann
  */
-public class ResourceTest
-    extends TestCase
+@DisplayName( "Resource" )
+class ResourceTest implements ModelTestInterface< Resource >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Resource().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Resource().equals( null ) );
-
-        new Resource().equals( new Resource() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Resource thing = new Resource();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Resource().toString() );
-    }
-
 }
+
diff --git a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
index 4d76993..b244fb5 100644
--- a/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/ScmTest.java
@@ -19,38 +19,17 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Scm}.
  *
  * @author Benjamin Bentmann
  */
-public class ScmTest
-    extends TestCase
+@DisplayName( "Scm" )
+class ScmTest implements ModelTestInterface< Scm >
 {
 
-    public void testHashCodeNullSafe()
-    {
-        new Scm().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Scm().equals( null ) );
-
-        new Scm().equals( new Scm() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Scm thing = new Scm();
-        assertTrue( thing.equals( thing ) );
-    }
+}
 
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Scm().toString() );
-    }
 
-}
diff --git a/maven-model/src/test/java/org/apache/maven/model/SiteTest.java b/maven-model/src/test/java/org/apache/maven/model/SiteTest.java
index 84896bb..1d96718 100644
--- a/maven-model/src/test/java/org/apache/maven/model/SiteTest.java
+++ b/maven-model/src/test/java/org/apache/maven/model/SiteTest.java
@@ -19,38 +19,14 @@ package org.apache.maven.model;
  * under the License.
  */
 
-import junit.framework.TestCase;
+import org.junit.jupiter.api.DisplayName;
 
 /**
  * Tests {@code Site}.
  *
  * @author Benjamin Bentmann
  */
-public class SiteTest
-    extends TestCase
+@DisplayName( "Site" )
+class SiteTest implements ModelTestInterface< Site >
 {
-
-    public void testHashCodeNullSafe()
-    {
-        new Site().hashCode();
-    }
-
-    public void testEqualsNullSafe()
-    {
-        assertFalse( new Site().equals( null ) );
-
-        new Site().equals( new Site() );
-    }
-
-    public void testEqualsIdentity()
-    {
-        Site thing = new Site();
-        assertTrue( thing.equals( thing ) );
-    }
-
-    public void testToStringNullSafe()
-    {
-        assertNotNull( new Site().toString() );
-    }
-
 }
diff --git a/pom.xml b/pom.xml
index 10a26dd..3d541be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -446,6 +446,19 @@ under the License.
         <version>1.3</version>
         <scope>test</scope>
       </dependency>
+      <dependency>
+        <groupId>org.assertj</groupId>
+        <artifactId>assertj-core</artifactId>
+        <version>3.14.0</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.junit</groupId>
+        <artifactId>junit-bom</artifactId>
+        <version>5.5.2</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
     </dependencies>
     <!--bootstrap-start-comment-->
   </dependencyManagement>


[maven] 03/03: Fixed.

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

khmarbaise pushed a commit to branch MODELTESTS_IMPROVEMENT
in repository https://gitbox.apache.org/repos/asf/maven.git

commit 56118d6888291c80d96becc18d20f3b113224dfa
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Mon Dec 2 18:44:31 2019 +0100

    Fixed.
---
 .../src/main/java/org/apache/maven/project/DefaultProjectBuilder.java   | 2 --
 1 file changed, 2 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index d764f8a..793df20 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -717,8 +717,6 @@ public class DefaultProjectBuilder
         project.setPluginArtifacts( pluginArtifacts );
 
         // reportArtifacts
-        project.getReportPlugins().stream()
-                .map;
         Set< Artifact > reportArtifacts = new HashSet<>();
         for ( ReportPlugin report : project.getReportPlugins() )
         {


[maven] 02/03: Safe State.

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

khmarbaise pushed a commit to branch MODELTESTS_IMPROVEMENT
in repository https://gitbox.apache.org/repos/asf/maven.git

commit da2902a994fc267cff3163949b82b48a993c0930
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Fri Nov 29 18:51:50 2019 +0100

    Safe State.
---
 .../maven/project/DefaultProjectBuilder.java       | 339 ++++++++++-----------
 .../maven/cli/event/ExecutionEventLogger.java      | 100 +++---
 2 files changed, 202 insertions(+), 237 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
index 7e18f1e..d764f8a 100644
--- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
+++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java
@@ -19,20 +19,6 @@ package org.apache.maven.project;
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.util.AbstractMap;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.InvalidArtifactRTException;
@@ -76,12 +62,27 @@ import org.eclipse.aether.repository.WorkspaceRepository;
 import org.eclipse.aether.resolution.ArtifactRequest;
 import org.eclipse.aether.resolution.ArtifactResult;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.AbstractMap;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
 /**
  * DefaultProjectBuilder
  */
 @Component( role = ProjectBuilder.class )
 public class DefaultProjectBuilder
-    implements ProjectBuilder
+        implements ProjectBuilder
 {
 
     public static final String DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY =
@@ -118,8 +119,8 @@ public class DefaultProjectBuilder
     // ----------------------------------------------------------------------
 
     @Override
-    public ProjectBuildingResult build( File pomFile, ProjectBuildingRequest request )
-        throws ProjectBuildingException
+    public ProjectBuildingResult build(File pomFile, ProjectBuildingRequest request)
+            throws ProjectBuildingException
     {
         return build( pomFile, new FileModelSource( pomFile ),
                 new InternalConfig( request, null, useGlobalModelCache() ? getModelCache() : null ) );
@@ -131,15 +132,15 @@ public class DefaultProjectBuilder
     }
 
     @Override
-    public ProjectBuildingResult build( ModelSource modelSource, ProjectBuildingRequest request )
-        throws ProjectBuildingException
+    public ProjectBuildingResult build(ModelSource modelSource, ProjectBuildingRequest request)
+            throws ProjectBuildingException
     {
         return build( null, modelSource,
-                 new InternalConfig( request, null, useGlobalModelCache() ? getModelCache() : null ) );
+                new InternalConfig( request, null, useGlobalModelCache() ? getModelCache() : null ) );
     }
 
-    private ProjectBuildingResult build( File pomFile, ModelSource modelSource, InternalConfig config )
-        throws ProjectBuildingException
+    private ProjectBuildingResult build(File pomFile, ModelSource modelSource, InternalConfig config)
+            throws ProjectBuildingException
     {
         ClassLoader oldContextClassLoader = Thread.currentThread().getContextClassLoader();
 
@@ -149,7 +150,7 @@ public class DefaultProjectBuilder
 
             MavenProject project = projectBuildingRequest.getProject();
 
-            List<ModelProblem> modelProblems = null;
+            List< ModelProblem > modelProblems = null;
             Throwable error = null;
 
             if ( project == null )
@@ -160,7 +161,7 @@ public class DefaultProjectBuilder
                 project.setFile( pomFile );
 
                 DefaultModelBuildingListener listener =
-                    new DefaultModelBuildingListener( project, projectBuildingHelper, projectBuildingRequest );
+                        new DefaultModelBuildingListener( project, projectBuildingHelper, projectBuildingRequest );
                 request.setModelBuildingListener( listener );
 
                 request.setPomFile( pomFile );
@@ -171,8 +172,7 @@ public class DefaultProjectBuilder
                 try
                 {
                     result = modelBuilder.build( request );
-                }
-                catch ( ModelBuildingException e )
+                } catch (ModelBuildingException e)
                 {
                     result = e.getResult();
                     if ( result == null || result.getEffectiveModel() == null )
@@ -185,10 +185,9 @@ public class DefaultProjectBuilder
 
                 modelProblems = result.getProblems();
 
-                initProject( project, Collections.<String, MavenProject>emptyMap(), true,
-                             result, new HashMap<File, Boolean>(), projectBuildingRequest );
-            }
-            else if ( projectBuildingRequest.isResolveDependencies() )
+                initProject( project, Collections.< String, MavenProject >emptyMap(), true,
+                        result, new HashMap< File, Boolean >(), projectBuildingRequest );
+            } else if ( projectBuildingRequest.isResolveDependencies() )
             {
                 projectBuildingHelper.selectProjectRealm( project );
             }
@@ -210,14 +209,13 @@ public class DefaultProjectBuilder
             }
 
             return result;
-        }
-        finally
+        } finally
         {
             Thread.currentThread().setContextClassLoader( oldContextClassLoader );
         }
     }
 
-    private DependencyResolutionResult resolveDependencies( MavenProject project, RepositorySystemSession session )
+    private DependencyResolutionResult resolveDependencies(MavenProject project, RepositorySystemSession session)
     {
         DependencyResolutionResult resolutionResult;
 
@@ -225,17 +223,16 @@ public class DefaultProjectBuilder
         {
             DefaultDependencyResolutionRequest resolution = new DefaultDependencyResolutionRequest( project, session );
             resolutionResult = dependencyResolver.resolve( resolution );
-        }
-        catch ( DependencyResolutionException e )
+        } catch (DependencyResolutionException e)
         {
             resolutionResult = e.getResult();
         }
 
-        Set<Artifact> artifacts = new LinkedHashSet<>();
+        Set< Artifact > artifacts = new LinkedHashSet<>();
         if ( resolutionResult.getDependencyGraph() != null )
         {
             RepositoryUtils.toArtifacts( artifacts, resolutionResult.getDependencyGraph().getChildren(),
-                                         Collections.singletonList( project.getArtifact().getId() ), null );
+                    Collections.singletonList( project.getArtifact().getId() ), null );
 
             // Maven 2.x quirk: an artifact always points at the local repo, regardless whether resolved or not
             LocalRepositoryManager lrm = session.getLocalRepositoryManager();
@@ -254,9 +251,9 @@ public class DefaultProjectBuilder
         return resolutionResult;
     }
 
-    private List<String> getProfileIds( List<Profile> profiles )
+    private List< String > getProfileIds(List< Profile > profiles)
     {
-        List<String> ids = new ArrayList<>( profiles.size() );
+        List< String > ids = new ArrayList<>( profiles.size() );
 
         for ( Profile profile : profiles )
         {
@@ -266,7 +263,7 @@ public class DefaultProjectBuilder
         return ids;
     }
 
-    private ModelBuildingRequest getModelBuildingRequest( InternalConfig config )
+    private ModelBuildingRequest getModelBuildingRequest(InternalConfig config)
     {
         ProjectBuildingRequest configuration = config.request;
 
@@ -275,8 +272,8 @@ public class DefaultProjectBuilder
         RequestTrace trace = RequestTrace.newChild( null, configuration ).newChild( request );
 
         ModelResolver resolver =
-            new ProjectModelResolver( config.session, trace, repoSystem, repositoryManager, config.repositories,
-                                      configuration.getRepositoryMerging(), config.modelPool );
+                new ProjectModelResolver( config.session, trace, repoSystem, repositoryManager, config.repositories,
+                        configuration.getRepositoryMerging(), config.modelPool );
 
         request.setValidationLevel( configuration.getValidationLevel() );
         request.setProcessPlugins( configuration.isProcessPlugins() );
@@ -293,15 +290,15 @@ public class DefaultProjectBuilder
     }
 
     @Override
-    public ProjectBuildingResult build( Artifact artifact, ProjectBuildingRequest request )
-        throws ProjectBuildingException
+    public ProjectBuildingResult build(Artifact artifact, ProjectBuildingRequest request)
+            throws ProjectBuildingException
     {
         return build( artifact, false, request );
     }
 
     @Override
-    public ProjectBuildingResult build( Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request )
-        throws ProjectBuildingException
+    public ProjectBuildingResult build(Artifact artifact, boolean allowStubModel, ProjectBuildingRequest request)
+            throws ProjectBuildingException
     {
         org.eclipse.aether.artifact.Artifact pomArtifact = RepositoryUtils.toArtifact( artifact );
         pomArtifact = ArtifactDescriptorUtils.toPomArtifact( pomArtifact );
@@ -319,15 +316,14 @@ public class DefaultProjectBuilder
 
             pomArtifact = pomResult.getArtifact();
             localProject = pomResult.getRepository() instanceof WorkspaceRepository;
-        }
-        catch ( org.eclipse.aether.resolution.ArtifactResolutionException e )
+        } catch (org.eclipse.aether.resolution.ArtifactResolutionException e)
         {
             if ( e.getResults().get( 0 ).isMissing() && allowStubModel )
             {
                 return build( null, createStubModelSource( artifact ), config );
             }
             throw new ProjectBuildingException( artifact.getId(),
-                                                "Error resolving project artifact: " + e.getMessage(), e );
+                    "Error resolving project artifact: " + e.getMessage(), e );
         }
 
         File pomFile = pomArtifact.getFile();
@@ -342,7 +338,7 @@ public class DefaultProjectBuilder
         return build( localProject ? pomFile : null, new FileModelSource( pomFile ), config );
     }
 
-    private ModelSource createStubModelSource( Artifact artifact )
+    private ModelSource createStubModelSource(Artifact artifact)
     {
         StringBuilder buffer = new StringBuilder( 1024 );
 
@@ -359,23 +355,23 @@ public class DefaultProjectBuilder
     }
 
     @Override
-    public List<ProjectBuildingResult> build( List<File> pomFiles, boolean recursive, ProjectBuildingRequest request )
-        throws ProjectBuildingException
+    public List< ProjectBuildingResult > build(List< File > pomFiles, boolean recursive, ProjectBuildingRequest request)
+            throws ProjectBuildingException
     {
-        List<ProjectBuildingResult> results = new ArrayList<>();
+        List< ProjectBuildingResult > results = new ArrayList<>();
 
-        List<InterimResult> interimResults = new ArrayList<>();
+        List< InterimResult > interimResults = new ArrayList<>();
 
         ReactorModelPool modelPool = new ReactorModelPool();
 
         InternalConfig config = new InternalConfig( request, modelPool,
                 useGlobalModelCache() ? getModelCache() : new ReactorModelCache() );
 
-        Map<String, MavenProject> projectIndex = new HashMap<>( 256 );
+        Map< String, MavenProject > projectIndex = new HashMap<>( 256 );
 
         boolean noErrors =
-            build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet<File>(), true, recursive,
-                   config );
+                build( results, interimResults, projectIndex, pomFiles, new LinkedHashSet< File >(), true, recursive,
+                        config );
 
         populateReactorModelPool( modelPool, interimResults );
 
@@ -384,10 +380,9 @@ public class DefaultProjectBuilder
         try
         {
             noErrors =
-                build( results, new ArrayList<MavenProject>(), projectIndex, interimResults, request,
-                       new HashMap<File, Boolean>(), config.session ) && noErrors;
-        }
-        finally
+                    build( results, new ArrayList< MavenProject >(), projectIndex, interimResults, request,
+                            new HashMap< File, Boolean >(), config.session ) && noErrors;
+        } finally
         {
             Thread.currentThread().setContextClassLoader( oldContextClassLoader );
         }
@@ -401,9 +396,9 @@ public class DefaultProjectBuilder
     }
 
     @SuppressWarnings( "checkstyle:parameternumber" )
-    private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults,
-                           Map<String, MavenProject> projectIndex, List<File> pomFiles, Set<File> aggregatorFiles,
-                           boolean isRoot, boolean recursive, InternalConfig config )
+    private boolean build(List< ProjectBuildingResult > results, List< InterimResult > interimResults,
+                          Map< String, MavenProject > projectIndex, List< File > pomFiles, Set< File > aggregatorFiles,
+                          boolean isRoot, boolean recursive, InternalConfig config)
     {
         boolean noErrors = true;
 
@@ -423,9 +418,9 @@ public class DefaultProjectBuilder
     }
 
     @SuppressWarnings( "checkstyle:parameternumber" )
-    private boolean build( List<ProjectBuildingResult> results, List<InterimResult> interimResults,
-                           Map<String, MavenProject> projectIndex, File pomFile, Set<File> aggregatorFiles,
-                           boolean isRoot, boolean recursive, InternalConfig config )
+    private boolean build(List< ProjectBuildingResult > results, List< InterimResult > interimResults,
+                          Map< String, MavenProject > projectIndex, File pomFile, Set< File > aggregatorFiles,
+                          boolean isRoot, boolean recursive, InternalConfig config)
     {
         boolean noErrors = true;
 
@@ -439,22 +434,21 @@ public class DefaultProjectBuilder
         request.setLocationTracking( true );
 
         DefaultModelBuildingListener listener =
-            new DefaultModelBuildingListener( project, projectBuildingHelper, config.request );
+                new DefaultModelBuildingListener( project, projectBuildingHelper, config.request );
         request.setModelBuildingListener( listener );
 
         ModelBuildingResult result;
         try
         {
             result = modelBuilder.build( request );
-        }
-        catch ( ModelBuildingException e )
+        } catch (ModelBuildingException e)
         {
             result = e.getResult();
             if ( result == null || result.getEffectiveModel() == null )
             {
-                 results.add( new DefaultProjectBuildingResult( e.getModelId(), pomFile, e.getProblems() ) );
+                results.add( new DefaultProjectBuildingResult( e.getModelId(), pomFile, e.getProblems() ) );
 
-                 return false;
+                return false;
             }
             // validation error, continue project building and delay failing to help IDEs
             // result.getProblems().addAll(e.getProblems()) ?
@@ -465,12 +459,11 @@ public class DefaultProjectBuilder
         try
         {
             // first pass: build without building parent.
-            initProject( project, projectIndex, false, result, new HashMap<File, Boolean>( 0 ), config.request );
-        }
-        catch ( InvalidArtifactRTException iarte )
+            initProject( project, projectIndex, false, result, new HashMap< File, Boolean >( 0 ), config.request );
+        } catch (InvalidArtifactRTException iarte)
         {
             result.getProblems().add( new DefaultModelProblem( null, ModelProblem.Severity.ERROR, null, model, -1, -1,
-                  iarte ) );
+                    iarte ) );
         }
 
         projectIndex.put( result.getModelIds().get( 0 ), project );
@@ -482,7 +475,7 @@ public class DefaultProjectBuilder
         {
             File basedir = pomFile.getParentFile();
 
-            List<File> moduleFiles = new ArrayList<>();
+            List< File > moduleFiles = new ArrayList<>();
 
             for ( String module : model.getModules() )
             {
@@ -503,9 +496,9 @@ public class DefaultProjectBuilder
                 if ( !moduleFile.isFile() )
                 {
                     ModelProblem problem =
-                        new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile
-                            + " does not exist", ModelProblem.Severity.ERROR, ModelProblem.Version.BASE, model, -1,
-                                                 -1, null );
+                            new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile
+                                    + " does not exist", ModelProblem.Severity.ERROR, ModelProblem.Version.BASE, model, -1,
+                                    -1, null );
                     result.getProblems().add( problem );
 
                     noErrors = false;
@@ -519,13 +512,11 @@ public class DefaultProjectBuilder
                     try
                     {
                         moduleFile = moduleFile.getCanonicalFile();
-                    }
-                    catch ( IOException e )
+                    } catch (IOException e)
                     {
                         moduleFile = moduleFile.getAbsoluteFile();
                     }
-                }
-                else
+                } else
                 {
                     moduleFile = new File( moduleFile.toURI().normalize() );
                 }
@@ -540,9 +531,9 @@ public class DefaultProjectBuilder
                     buffer.append( moduleFile );
 
                     ModelProblem problem =
-                        new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile
-                            + " forms aggregation cycle " + buffer, ModelProblem.Severity.ERROR,
-                                                 ModelProblem.Version.BASE, model, -1, -1, null );
+                            new DefaultModelProblem( "Child module " + moduleFile + " of " + pomFile
+                                    + " forms aggregation cycle " + buffer, ModelProblem.Severity.ERROR,
+                                    ModelProblem.Version.BASE, model, -1, -1, null );
                     result.getProblems().add( problem );
 
                     noErrors = false;
@@ -556,7 +547,7 @@ public class DefaultProjectBuilder
             interimResult.modules = new ArrayList<>();
 
             if ( !build( results, interimResult.modules, projectIndex, moduleFiles, aggregatorFiles, false,
-                         recursive, config ) )
+                    recursive, config ) )
             {
                 noErrors = false;
             }
@@ -578,10 +569,10 @@ public class DefaultProjectBuilder
 
         boolean root;
 
-        List<InterimResult> modules = Collections.emptyList();
+        List< InterimResult > modules = Collections.emptyList();
 
-        InterimResult( File pomFile, ModelBuildingRequest request, ModelBuildingResult result,
-                       DefaultModelBuildingListener listener, boolean root )
+        InterimResult(File pomFile, ModelBuildingRequest request, ModelBuildingResult result,
+                      DefaultModelBuildingListener listener, boolean root)
         {
             this.pomFile = pomFile;
             this.request = request;
@@ -592,7 +583,7 @@ public class DefaultProjectBuilder
 
     }
 
-    private void populateReactorModelPool( ReactorModelPool reactorModelPool, List<InterimResult> interimResults )
+    private void populateReactorModelPool(ReactorModelPool reactorModelPool, List< InterimResult > interimResults)
     {
         for ( InterimResult interimResult : interimResults )
         {
@@ -603,10 +594,10 @@ public class DefaultProjectBuilder
         }
     }
 
-    private boolean build( List<ProjectBuildingResult> results, List<MavenProject> projects,
-                           Map<String, MavenProject> projectIndex, List<InterimResult> interimResults,
-                           ProjectBuildingRequest request, Map<File, Boolean> profilesXmls,
-                           RepositorySystemSession session )
+    private boolean build(List< ProjectBuildingResult > results, List< MavenProject > projects,
+                          Map< String, MavenProject > projectIndex, List< InterimResult > interimResults,
+                          ProjectBuildingRequest request, Map< File, Boolean > profilesXmls,
+                          RepositorySystemSession session)
     {
         boolean noErrors = true;
 
@@ -621,17 +612,16 @@ public class DefaultProjectBuilder
                 try
                 {
                     initProject( project, projectIndex, true, result, profilesXmls, request );
-                }
-                catch ( InvalidArtifactRTException iarte )
+                } catch (InvalidArtifactRTException iarte)
                 {
                     result.getProblems().add( new DefaultModelProblem( null, ModelProblem.Severity.ERROR, null,
                             result.getEffectiveModel(), -1, -1, iarte ) );
                 }
 
-                List<MavenProject> modules = new ArrayList<>();
+                List< MavenProject > modules = new ArrayList<>();
                 noErrors =
-                    build( results, modules, projectIndex, interimResult.modules, request, profilesXmls, session )
-                    && noErrors;
+                        build( results, modules, projectIndex, interimResult.modules, request, profilesXmls, session )
+                                && noErrors;
 
                 projects.addAll( modules );
                 projects.add( project );
@@ -645,15 +635,13 @@ public class DefaultProjectBuilder
                 }
 
                 results.add( new DefaultProjectBuildingResult( project, result.getProblems(), resolutionResult ) );
-            }
-            catch ( ModelBuildingException e )
+            } catch (ModelBuildingException e)
             {
                 DefaultProjectBuildingResult result = null;
                 if ( project == null )
                 {
                     result = new DefaultProjectBuildingResult( e.getModelId(), interimResult.pomFile, e.getProblems() );
-                }
-                else
+                } else
                 {
                     result = new DefaultProjectBuildingResult( project, e.getProblems(), null );
                 }
@@ -667,9 +655,9 @@ public class DefaultProjectBuilder
     }
 
     @SuppressWarnings( "checkstyle:methodlength" )
-    private void initProject( MavenProject project, Map<String, MavenProject> projects,
-                              boolean buildParentIfNotExisting, ModelBuildingResult result,
-                              Map<File, Boolean> profilesXmls, ProjectBuildingRequest projectBuildingRequest )
+    private void initProject(MavenProject project, Map< String, MavenProject > projects,
+                             boolean buildParentIfNotExisting, ModelBuildingResult result,
+                             Map< File, Boolean > profilesXmls, ProjectBuildingRequest projectBuildingRequest)
     {
         Model model = result.getEffectiveModel();
 
@@ -680,8 +668,8 @@ public class DefaultProjectBuilder
         initParent( project, projects, buildParentIfNotExisting, result, projectBuildingRequest );
 
         Artifact projectArtifact =
-            repositorySystem.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null,
-                                             project.getPackaging() );
+                repositorySystem.createArtifact( project.getGroupId(), project.getArtifactId(), project.getVersion(), null,
+                        project.getPackaging() );
         project.setArtifact( projectArtifact );
 
         if ( project.getFile() != null && buildParentIfNotExisting ) // only set those on 2nd phase, ignore on 1st pass
@@ -692,7 +680,7 @@ public class DefaultProjectBuilder
             project.addTestCompileSourceRoot( build.getTestSourceDirectory() );
         }
 
-        List<Profile> activeProfiles = new ArrayList<>();
+        List< Profile > activeProfiles = new ArrayList<>();
         activeProfiles.addAll( result.getActivePomProfiles( result.getModelIds().get( 0 ) ) );
         activeProfiles.addAll( result.getActiveExternalProfiles() );
         project.setActiveProfiles( activeProfiles );
@@ -707,9 +695,9 @@ public class DefaultProjectBuilder
         if ( modelId != null )
         {
             ModelProblem problem =
-                new DefaultModelProblem( "Detected profiles.xml alongside " + modelId
-                    + ", this file is no longer supported and was ignored" + ", please use the settings.xml instead",
-                                         ModelProblem.Severity.WARNING, ModelProblem.Version.V30, model, -1, -1, null );
+                    new DefaultModelProblem( "Detected profiles.xml alongside " + modelId
+                            + ", this file is no longer supported and was ignored" + ", please use the settings.xml instead",
+                            ModelProblem.Severity.WARNING, ModelProblem.Version.V30, model, -1, -1, null );
             result.getProblems().add( problem );
         }
 
@@ -720,20 +708,18 @@ public class DefaultProjectBuilder
         project.setProjectBuildingRequest( projectBuildingRequest );
 
         // pluginArtifacts
-        Set<Artifact> pluginArtifacts = new HashSet<>();
-        for ( Plugin plugin : project.getBuildPlugins() )
-        {
-            Artifact artifact = repositorySystem.createPluginArtifact( plugin );
+        Set< Artifact > pluginArtifacts = project.getBuildPlugins()
+                .stream()
+                .map( plugin -> repositorySystem.createPluginArtifact( plugin ) )
+                .filter( artifact -> artifact != null )
+                .collect( Collectors.toSet() );
 
-            if ( artifact != null )
-            {
-                pluginArtifacts.add( artifact );
-            }
-        }
         project.setPluginArtifacts( pluginArtifacts );
 
         // reportArtifacts
-        Set<Artifact> reportArtifacts = new HashSet<>();
+        project.getReportPlugins().stream()
+                .map;
+        Set< Artifact > reportArtifacts = new HashSet<>();
         for ( ReportPlugin report : project.getReportPlugins() )
         {
             Plugin pp = new Plugin();
@@ -751,8 +737,8 @@ public class DefaultProjectBuilder
         project.setReportArtifacts( reportArtifacts );
 
         // extensionArtifacts
-        Set<Artifact> extensionArtifacts = new HashSet<>();
-        List<Extension> extensions = project.getBuildExtensions();
+        Set< Artifact > extensionArtifacts = new HashSet<>();
+        List< Extension > extensions = project.getBuildExtensions();
         if ( extensions != null )
         {
             for ( Extension ext : extensions )
@@ -761,14 +747,13 @@ public class DefaultProjectBuilder
                 if ( StringUtils.isEmpty( ext.getVersion() ) )
                 {
                     version = "RELEASE";
-                }
-                else
+                } else
                 {
                     version = ext.getVersion();
                 }
 
                 Artifact artifact =
-                    repositorySystem.createArtifact( ext.getGroupId(), ext.getArtifactId(), version, null, "jar" );
+                        repositorySystem.createArtifact( ext.getGroupId(), ext.getArtifactId(), version, null, "jar" );
 
                 if ( artifact != null )
                 {
@@ -779,54 +764,54 @@ public class DefaultProjectBuilder
         project.setExtensionArtifacts( extensionArtifacts );
 
         // managedVersionMap
-        Map<String, Artifact> map = null;
+        Map< String, Artifact > map = null;
         if ( repositorySystem != null )
         {
             final DependencyManagement dependencyManagement = project.getDependencyManagement();
             if ( ( dependencyManagement != null ) && ( ( dependencyManagement.getDependencies() ) != null )
-                && ( dependencyManagement.getDependencies().size() > 0 ) )
+                    && ( dependencyManagement.getDependencies().size() > 0 ) )
             {
-                map = new AbstractMap<String, Artifact>()
+                map = new AbstractMap< String, Artifact >()
                 {
-                    HashMap<String, Artifact> delegate;
+                    HashMap< String, Artifact > delegate;
 
                     @Override
-                    public Set<Entry<String, Artifact>> entrySet()
+                    public Set< Entry< String, Artifact > > entrySet()
                     {
                         return Collections.unmodifiableSet( compute().entrySet() );
                     }
 
                     @Override
-                    public Set<String> keySet()
+                    public Set< String > keySet()
                     {
                         return Collections.unmodifiableSet( compute().keySet() );
                     }
 
                     @Override
-                    public Collection<Artifact> values()
+                    public Collection< Artifact > values()
                     {
                         return Collections.unmodifiableCollection( compute().values() );
                     }
 
                     @Override
-                    public boolean containsValue( Object value )
+                    public boolean containsValue(Object value)
                     {
                         return compute().containsValue( value );
                     }
 
                     @Override
-                    public boolean containsKey( Object key )
+                    public boolean containsKey(Object key)
                     {
                         return compute().containsKey( key );
                     }
 
                     @Override
-                    public Artifact get( Object key )
+                    public Artifact get(Object key)
                     {
                         return compute().get( key );
                     }
 
-                    HashMap<String, Artifact> compute()
+                    HashMap< String, Artifact > compute()
                     {
                         if ( delegate == null )
                         {
@@ -845,8 +830,7 @@ public class DefaultProjectBuilder
                         return delegate;
                     }
                 };
-            }
-            else
+            } else
             {
                 map = Collections.emptyMap();
             }
@@ -855,7 +839,7 @@ public class DefaultProjectBuilder
 
         // release artifact repository
         if ( project.getDistributionManagement() != null
-                        && project.getDistributionManagement().getRepository() != null )
+                && project.getDistributionManagement().getRepository() != null )
         {
             try
             {
@@ -864,22 +848,21 @@ public class DefaultProjectBuilder
                 {
                     ArtifactRepository repo = repositorySystem.buildArtifactRepository( r );
                     repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(),
-                                                  Arrays.asList( repo ) );
+                            Arrays.asList( repo ) );
                     repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(),
-                                                           Arrays.asList( repo ) );
+                            Arrays.asList( repo ) );
                     project.setReleaseArtifactRepository( repo );
                 }
-            }
-            catch ( InvalidRepositoryException e )
+            } catch (InvalidRepositoryException e)
             {
                 throw new IllegalStateException( "Failed to create release distribution repository for "
-                    + project.getId(), e );
+                        + project.getId(), e );
             }
         }
 
         // snapshot artifact repository
         if ( project.getDistributionManagement() != null
-            && project.getDistributionManagement().getSnapshotRepository() != null )
+                && project.getDistributionManagement().getSnapshotRepository() != null )
         {
             try
             {
@@ -888,26 +871,25 @@ public class DefaultProjectBuilder
                 {
                     ArtifactRepository repo = repositorySystem.buildArtifactRepository( r );
                     repositorySystem.injectProxy( projectBuildingRequest.getRepositorySession(),
-                                                  Arrays.asList( repo ) );
+                            Arrays.asList( repo ) );
                     repositorySystem.injectAuthentication( projectBuildingRequest.getRepositorySession(),
-                                                           Arrays.asList( repo ) );
+                            Arrays.asList( repo ) );
                     project.setSnapshotArtifactRepository( repo );
                 }
-            }
-            catch ( InvalidRepositoryException e )
+            } catch (InvalidRepositoryException e)
             {
                 throw new IllegalStateException( "Failed to create snapshot distribution repository for "
-                    + project.getId(), e );
+                        + project.getId(), e );
             }
         }
     }
 
-    private void initParent( MavenProject project, Map<String, MavenProject> projects, boolean buildParentIfNotExisting,
-                             ModelBuildingResult result, ProjectBuildingRequest projectBuildingRequest )
+    private void initParent(MavenProject project, Map< String, MavenProject > projects, boolean buildParentIfNotExisting,
+                            ModelBuildingResult result, ProjectBuildingRequest projectBuildingRequest)
     {
         Model parentModel = result.getModelIds().size() > 1 && !result.getModelIds().get( 1 ).isEmpty()
-                                ? result.getRawModel( result.getModelIds().get( 1 ) )
-                                : null;
+                ? result.getRawModel( result.getModelIds().get( 1 ) )
+                : null;
 
         if ( parentModel != null )
         {
@@ -915,8 +897,8 @@ public class DefaultProjectBuilder
             final String parentVersion = inheritedVersion( result, 1 );
 
             project.setParentArtifact( repositorySystem.createProjectArtifact( parentGroupId,
-                                                                               parentModel.getArtifactId(),
-                                                                               parentVersion ) );
+                    parentModel.getArtifactId(),
+                    parentVersion ) );
 
             // org.apache.maven.its.mng4834:parent:0.1
             String parentModelId = result.getModelIds().get( 1 );
@@ -936,38 +918,33 @@ public class DefaultProjectBuilder
                     try
                     {
                         parent = build( parentPomFile, projectBuildingRequest ).getProject();
-                    }
-                    catch ( ProjectBuildingException e )
+                    } catch (ProjectBuildingException e)
                     {
                         // MNG-4488 where let invalid parents slide on by
                         if ( logger.isDebugEnabled() )
                         {
                             // Message below is checked for in the MNG-2199 core IT.
                             logger.warn( "Failed to build parent project for " + project.getId(), e );
-                        }
-                        else
+                        } else
                         {
                             // Message below is checked for in the MNG-2199 core IT.
                             logger.warn( "Failed to build parent project for " + project.getId() );
                         }
                     }
-                }
-                else
+                } else
                 {
                     Artifact parentArtifact = project.getParentArtifact();
                     try
                     {
                         parent = build( parentArtifact, projectBuildingRequest ).getProject();
-                    }
-                    catch ( ProjectBuildingException e )
+                    } catch (ProjectBuildingException e)
                     {
                         // MNG-4488 where let invalid parents slide on by
                         if ( logger.isDebugEnabled() )
                         {
                             // Message below is checked for in the MNG-2199 core IT.
                             logger.warn( "Failed to build parent project for " + project.getId(), e );
-                        }
-                        else
+                        } else
                         {
                             // Message below is checked for in the MNG-2199 core IT.
                             logger.warn( "Failed to build parent project for " + project.getId() );
@@ -983,7 +960,7 @@ public class DefaultProjectBuilder
         }
     }
 
-    private static String inheritedGroupId( final ModelBuildingResult result, final int modelIndex )
+    private static String inheritedGroupId(final ModelBuildingResult result, final int modelIndex)
     {
         String groupId = null;
         final String modelId = result.getModelIds().get( modelIndex );
@@ -992,15 +969,15 @@ public class DefaultProjectBuilder
         {
             final Model model = result.getRawModel( modelId );
             groupId = model.getGroupId() != null
-                          ? model.getGroupId()
-                          : inheritedGroupId( result, modelIndex + 1 );
+                    ? model.getGroupId()
+                    : inheritedGroupId( result, modelIndex + 1 );
 
         }
 
         return groupId;
     }
 
-    private static String inheritedVersion( final ModelBuildingResult result, final int modelIndex )
+    private static String inheritedVersion(final ModelBuildingResult result, final int modelIndex)
     {
         String version = null;
         final String modelId = result.getModelIds().get( modelIndex );
@@ -1009,15 +986,15 @@ public class DefaultProjectBuilder
         {
             final Model model = result.getRawModel( modelId );
             version = model.getVersion() != null
-                          ? model.getVersion()
-                          : inheritedVersion( result, modelIndex + 1 );
+                    ? model.getVersion()
+                    : inheritedVersion( result, modelIndex + 1 );
 
         }
 
         return version;
     }
 
-    private String findProfilesXml( ModelBuildingResult result, Map<File, Boolean> profilesXmls )
+    private String findProfilesXml(ModelBuildingResult result, Map< File, Boolean > profilesXmls)
     {
         for ( String modelId : result.getModelIds() )
         {
@@ -1054,20 +1031,20 @@ public class DefaultProjectBuilder
 
         private final RepositorySystemSession session;
 
-        private final List<RemoteRepository> repositories;
+        private final List< RemoteRepository > repositories;
 
         private final ReactorModelPool modelPool;
 
         private final ReactorModelCache modelCache;
 
-        InternalConfig( ProjectBuildingRequest request, ReactorModelPool modelPool, ReactorModelCache modelCache )
+        InternalConfig(ProjectBuildingRequest request, ReactorModelPool modelPool, ReactorModelCache modelCache)
         {
             this.request = request;
             this.modelPool = modelPool;
             this.modelCache = modelCache;
             session =
-                LegacyLocalRepositoryManager.overlay( request.getLocalRepository(), request.getRepositorySession(),
-                                                      repoSystem );
+                    LegacyLocalRepositoryManager.overlay( request.getLocalRepository(), request.getRepositorySession(),
+                            repoSystem );
             repositories = RepositoryUtils.toRepos( request.getRemoteRepositories() );
         }
 
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
index 17da655..ca4d1e7 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/event/ExecutionEventLogger.java
@@ -19,13 +19,6 @@ package org.apache.maven.cli.event;
  * under the License.
  */
 
-import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
-import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
-import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
-
-import java.util.List;
-import java.util.Objects;
-
 import org.apache.maven.execution.AbstractExecutionListener;
 import org.apache.maven.execution.BuildFailure;
 import org.apache.maven.execution.BuildSuccess;
@@ -41,13 +34,20 @@ import org.codehaus.plexus.util.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.List;
+import java.util.Objects;
+
+import static org.apache.maven.cli.CLIReportingUtils.formatDuration;
+import static org.apache.maven.cli.CLIReportingUtils.formatTimestamp;
+import static org.apache.maven.shared.utils.logging.MessageUtils.buffer;
+
 /**
  * Logs execution events to logger, eventually user-supplied.
  *
  * @author Benjamin Bentmann
  */
 public class ExecutionEventLogger
-    extends AbstractExecutionListener
+        extends AbstractExecutionListener
 {
     private final Logger logger;
 
@@ -64,12 +64,12 @@ public class ExecutionEventLogger
     }
 
     // TODO should we deprecate?
-    public ExecutionEventLogger( Logger logger )
+    public ExecutionEventLogger(Logger logger)
     {
         this.logger = Objects.requireNonNull( logger, "logger cannot be null" );
     }
 
-    private static String chars( char c, int count )
+    private static String chars(char c, int count)
     {
         StringBuilder buffer = new StringBuilder( count );
 
@@ -81,18 +81,18 @@ public class ExecutionEventLogger
         return buffer.toString();
     }
 
-    private void infoLine( char c )
+    private void infoLine(char c)
     {
         infoMain( chars( c, LINE_LENGTH ) );
     }
 
-    private void infoMain( String msg )
+    private void infoMain(String msg)
     {
         logger.info( buffer().strong( msg ).toString() );
     }
 
     @Override
-    public void projectDiscoveryStarted( ExecutionEvent event )
+    public void projectDiscoveryStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -101,7 +101,7 @@ public class ExecutionEventLogger
     }
 
     @Override
-    public void sessionStarted( ExecutionEvent event )
+    public void sessionStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() && event.getSession().getProjects().size() > 1 )
         {
@@ -111,7 +111,7 @@ public class ExecutionEventLogger
 
             logger.info( "" );
 
-            final List<MavenProject> projects = event.getSession().getProjects();
+            final List< MavenProject > projects = event.getSession().getProjects();
             for ( MavenProject project : projects )
             {
                 int len = LINE_LENGTH - project.getName().length() - project.getPackaging().length() - 2;
@@ -124,7 +124,7 @@ public class ExecutionEventLogger
     }
 
     @Override
-    public void sessionEnded( ExecutionEvent event )
+    public void sessionEnded(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -141,25 +141,16 @@ public class ExecutionEventLogger
         }
     }
 
-    private boolean isSingleVersionedReactor( MavenSession session )
+    private boolean isSingleVersionedReactor(MavenSession session)
     {
-        boolean result = true;
-
         MavenProject topProject = session.getTopLevelProject();
-        List<MavenProject> sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
-        for ( MavenProject mavenProject : sortedProjects )
-        {
-            if ( !topProject.getVersion().equals( mavenProject.getVersion() ) )
-            {
-                result = false;
-                break;
-            }
-        }
+        List< MavenProject > sortedProjects = session.getProjectDependencyGraph().getSortedProjects();
 
-        return result;
+        return sortedProjects.stream()
+                .anyMatch( mavenProject -> !topProject.getVersion().equals( mavenProject.getVersion() ) );
     }
 
-    private void logReactorSummary( MavenSession session )
+    private void logReactorSummary(MavenSession session)
     {
         boolean isSingleVersion = isSingleVersionedReactor( session );
 
@@ -180,7 +171,7 @@ public class ExecutionEventLogger
 
         MavenExecutionResult result = session.getResult();
 
-        List<MavenProject> projects = session.getProjects();
+        List< MavenProject > projects = session.getProjects();
 
         for ( MavenProject project : projects )
         {
@@ -209,8 +200,7 @@ public class ExecutionEventLogger
             if ( buildSummary == null )
             {
                 buffer.append( buffer().warning( "SKIPPED" ) );
-            }
-            else if ( buildSummary instanceof BuildSuccess )
+            } else if ( buildSummary instanceof BuildSuccess )
             {
                 buffer.append( buffer().success( "SUCCESS" ) );
                 buffer.append( " [" );
@@ -222,8 +212,7 @@ public class ExecutionEventLogger
                 }
                 buffer.append( buildTimeDuration );
                 buffer.append( ']' );
-            }
-            else if ( buildSummary instanceof BuildFailure )
+            } else if ( buildSummary instanceof BuildFailure )
             {
                 buffer.append( buffer().failure( "FAILURE" ) );
                 buffer.append( " [" );
@@ -241,7 +230,7 @@ public class ExecutionEventLogger
         }
     }
 
-    private void logResult( MavenSession session )
+    private void logResult(MavenSession session)
     {
         infoLine( '-' );
         MessageBuilder buffer = buffer();
@@ -249,15 +238,14 @@ public class ExecutionEventLogger
         if ( session.getResult().hasExceptions() )
         {
             buffer.failure( "BUILD FAILURE" );
-        }
-        else
+        } else
         {
             buffer.success( "BUILD SUCCESS" );
         }
         logger.info( buffer.toString() );
     }
 
-    private void logStats( MavenSession session )
+    private void logStats(MavenSession session)
     {
         infoLine( '-' );
 
@@ -273,7 +261,7 @@ public class ExecutionEventLogger
     }
 
     @Override
-    public void projectSkipped( ExecutionEvent event )
+    public void projectSkipped(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -288,7 +276,7 @@ public class ExecutionEventLogger
     }
 
     @Override
-    public void projectStarted( ExecutionEvent event )
+    public void projectStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -298,8 +286,8 @@ public class ExecutionEventLogger
 
             // -------< groupId:artifactId >-------
             String projectKey = project.getGroupId() + ':' + project.getArtifactId();
-            
-            final String preHeader  = "--< ";
+
+            final String preHeader = "--< ";
             final String postHeader = " >--";
 
             final int headerLen = preHeader.length() + projectKey.length() + postHeader.length();
@@ -307,7 +295,7 @@ public class ExecutionEventLogger
             String prefix = chars( '-', Math.max( 0, ( LINE_LENGTH - headerLen ) / 2 ) ) + preHeader;
 
             String suffix = postHeader
-                + chars( '-', Math.max( 0, LINE_LENGTH - headerLen - prefix.length() + preHeader.length() ) );
+                    + chars( '-', Math.max( 0, LINE_LENGTH - headerLen - prefix.length() + preHeader.length() ) );
 
             logger.info( buffer().strong( prefix ).project( projectKey ).strong( suffix ).toString() );
 
@@ -317,8 +305,7 @@ public class ExecutionEventLogger
             if ( totalProjects <= 1 )
             {
                 infoMain( building );
-            }
-            else
+            } else
             {
                 // display progress [i/n]
                 int number;
@@ -341,7 +328,7 @@ public class ExecutionEventLogger
     }
 
     @Override
-    public void mojoSkipped( ExecutionEvent event )
+    public void mojoSkipped(ExecutionEvent event)
     {
         if ( logger.isWarnEnabled() )
         {
@@ -354,7 +341,7 @@ public class ExecutionEventLogger
      * <pre>--- mojo-artifactId:version:goal (mojo-executionId) @ project-artifactId ---</pre>
      */
     @Override
-    public void mojoStarted( ExecutionEvent event )
+    public void mojoStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -370,13 +357,14 @@ public class ExecutionEventLogger
     }
 
     // CHECKSTYLE_OFF: LineLength
+
     /**
      * <pre>&gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; :forked-goal @ project-artifactId &gt;&gt;&gt;</pre>
      * <pre>&gt;&gt;&gt; mojo-artifactId:version:goal (mojo-executionId) &gt; [lifecycle]phase @ project-artifactId &gt;&gt;&gt;</pre>
      */
     // CHECKSTYLE_ON: LineLength
     @Override
-    public void forkStarted( ExecutionEvent event )
+    public void forkStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -394,13 +382,14 @@ public class ExecutionEventLogger
     }
 
     // CHECKSTYLE_OFF: LineLength
+
     /**
      * <pre>&lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; :forked-goal @ project-artifactId &lt;&lt;&lt;</pre>
      * <pre>&lt;&lt;&lt; mojo-artifactId:version:goal (mojo-executionId) &lt; [lifecycle]phase @ project-artifactId &lt;&lt;&lt;</pre>
      */
     // CHECKSTYLE_ON: LineLength
     @Override
-    public void forkSucceeded( ExecutionEvent event )
+    public void forkSucceeded(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() )
         {
@@ -419,7 +408,7 @@ public class ExecutionEventLogger
         }
     }
 
-    private void append( MessageBuilder buffer, MojoExecution me )
+    private void append(MessageBuilder buffer, MojoExecution me)
     {
         buffer.mojo( me.getArtifactId() + ':' + me.getVersion() + ':' + me.getGoal() );
         if ( me.getExecutionId() != null )
@@ -428,7 +417,7 @@ public class ExecutionEventLogger
         }
     }
 
-    private void appendForkInfo( MessageBuilder buffer, MojoDescriptor md )
+    private void appendForkInfo(MessageBuilder buffer, MojoDescriptor md)
     {
         StringBuilder buff = new StringBuilder();
         if ( StringUtils.isNotEmpty( md.getExecutePhase() ) )
@@ -441,8 +430,7 @@ public class ExecutionEventLogger
                 buff.append( ']' );
             }
             buff.append( md.getExecutePhase() );
-        }
-        else
+        } else
         {
             // forked goal
             buff.append( ':' );
@@ -451,13 +439,13 @@ public class ExecutionEventLogger
         buffer.strong( buff.toString() );
     }
 
-    private void append( MessageBuilder buffer, MavenProject project )
+    private void append(MessageBuilder buffer, MavenProject project)
     {
         buffer.a( " @ " ).project( project.getArtifactId() );
     }
 
     @Override
-    public void forkedProjectStarted( ExecutionEvent event )
+    public void forkedProjectStarted(ExecutionEvent event)
     {
         if ( logger.isInfoEnabled() && event.getMojoExecution().getForkedExecutions().size() > 1 )
         {