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

[maven] branch MNG-5693 updated (79230ad -> 2d88cbc)

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

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


 discard 79230ad  [MNG-5693] Change logging of MojoExceptions to console
     add e4b53d3  [MNG-6490] Maven shall not fail reporting circular dependency when the dependency is a classified secondary artifact
     add ba74b96  [MNG-6492] - Minor improvement on Array construction, conversion performance
     add 6688d76  [MNG-6497] - Upgrade guava / guice
     add 97c98ec  [maven-release-plugin] prepare release maven-3.6.0
     add 6e376d4  [maven-release-plugin] prepare for next development iteration
     add b5014bf  removed extra # in generated content
     add 0ee5dfb  Updated DOAP for Maven Core Release 3.6.0
     add 114a0e9  Updated Quick Build information.
     add db462ae  [MNG-6059] renamed attributes to get more flexibility for scm urls
     add f97316c  [MNG-6505] inherit child.x.y.inherit.append.path values
     add 07bd550  [MNG-6505] tweaked distributionManagement.site inheritance
     add 78f605e  [MNG-6515] Fix Javadoc build errors
     add f92bd9e  [MNG-6481] Run Maven Core Integration Tests with Java 7, 8 and 11
     add 86d4a91  [MNGSITE-357] README.md: Maven user list link not working
     add 9f07b03  [MNG-6261] - using File apis to compare
     add e4e33f7  [MNG-6261] Relative parent POM resolution failing in 3.5.0 with complex multimodule builds
     add 732e7de  [MNG-6529] ProjectBuilder.build(List<Project> ...) honor request.isResolveDependency
     add c6bdafe  [MNG-5965] Parallel build multiplies work if multiple goals are given
     add 6c4c2e3  Change to keep only 5 artifacts on master and on branches only 1 artifact.
     add c7ab987  [MNG-6544] Replace CacheUtils#{eq,hash} with Objects
     add 71128cb  spelling: vertices
     add 9c94626  [MNG-6213] Validate scope in dependencyManagement
     new 2d88cbc  [MNG-5693] Change logging of MojoExceptions to console

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   (79230ad)
            \
             N -- N -- N   refs/heads/MNG-5693 (2d88cbc)

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 1 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:
 Jenkinsfile                                        |   4 +-
 README.md                                          |   4 +-
 apache-maven/pom.xml                               |   2 +-
 .../main/appended-resources/META-INF/LICENSE.vm    |   2 +-
 doap_Maven.rdf                                     |  11 ++
 maven-artifact/pom.xml                             |   2 +-
 maven-builder-support/pom.xml                      |   2 +-
 maven-compat/pom.xml                               |   2 +-
 .../java/org/apache/maven/project/ModelUtils.java  |   6 +-
 .../metadata/DefaultClasspathTransformation.java   |   2 +-
 maven-core/pom.xml                                 |   2 +-
 .../repository/MavenArtifactRepository.java        |   2 +-
 .../multithreaded/ConcurrencyDependencyGraph.java  |   9 +-
 .../multithreaded/MultiThreadedBuilder.java        |  10 +-
 .../java/org/apache/maven/plugin/CacheUtils.java   |  53 +++++----
 .../plugin/PluginParameterExpressionEvaluator.java |   4 +-
 .../maven/project/DefaultProjectBuilder.java       |  15 ++-
 .../apache/maven/project/ProjectModelResolver.java |   5 +-
 .../org/apache/maven/project/ProjectSorter.java    |   2 +-
 .../toolchain/DefaultToolchainManagerPrivate.java  |   2 +-
 .../internal/ConcurrencyDependencyGraphTest.java   |   2 +-
 .../lifecycle/internal/stub/MojoExecutorStub.java  |   5 +-
 .../apache/maven/project/ProjectBuilderTest.java   |  42 +++++++
 .../projects/basic-resolveDependencies.xml         |  15 +++
 maven-embedder/pom.xml                             |   2 +-
 .../java/org/apache/maven/cli/CleanArgument.java   |   2 +-
 .../main/java/org/apache/maven/cli/MavenCli.java   |   4 +-
 maven-model-builder/pom.xml                        |   2 +-
 .../maven/model/building/DefaultModelBuilder.java  |   3 +-
 .../maven/model/building/FileModelSource.java      |  23 ++++
 .../model/interpolation/ModelInterpolator.java     |   2 +-
 .../StringSearchModelInterpolator.java             |   3 +-
 .../apache/maven/model/merge/MavenModelMerger.java |  42 +++++--
 .../model/validation/DefaultModelValidator.java    |  32 +++--
 maven-model-builder/src/site/apt/index.apt         |   8 ++
 .../maven/model/building/FileModelSourceTest.java  |  75 ++++++++++++
 .../DefaultInheritanceAssemblerTest.java           |  22 +++-
 .../validation/DefaultModelValidatorTest.java      |  17 +++
 .../poms/inheritance/no-append-urls-expected.xml   |  11 +-
 .../poms/inheritance/no-append-urls-parent.xml     |  10 +-
 ...at-urls-child.xml => no-append-urls2-child.xml} |   9 ++
 ...s-expected.xml => no-append-urls2-expected.xml} |  16 +--
 ...-urls-parent.xml => no-append-urls2-parent.xml} |  18 ++-
 ...at-urls-child.xml => no-append-urls3-child.xml} |   7 ++
 ...s-expected.xml => no-append-urls3-expected.xml} |  12 +-
 ...-urls-parent.xml => no-append-urls3-parent.xml} |  18 ++-
 ...ier.xml => bad-dependency-management-scope.xml} |  38 +++++-
 .../raw-model/self-referencing-classifier.xml      |  28 ++---
 maven-model/pom.xml                                |   2 +-
 .../org/apache/maven/model/merge/ModelMerger.java  |  81 +++++++++++++
 maven-model/src/main/mdo/maven.mdo                 | 131 +++++++++++++++------
 maven-plugin-api/pom.xml                           |   2 +-
 .../java/org/apache/maven/plugin/AbstractMojo.java |   5 +-
 maven-repository-metadata/pom.xml                  |   2 +-
 maven-resolver-provider/pom.xml                    |   2 +-
 .../repository/internal/DefaultModelResolver.java  |   4 +-
 maven-settings-builder/pom.xml                     |   2 +-
 maven-settings/pom.xml                             |   2 +-
 maven-settings/src/main/mdo/settings.mdo           |   2 +-
 maven-slf4j-provider/pom.xml                       |   2 +-
 pom.xml                                            |   9 +-
 61 files changed, 647 insertions(+), 208 deletions(-)
 create mode 100644 maven-core/src/test/resources/projects/basic-resolveDependencies.xml
 create mode 100644 maven-model-builder/src/test/java/org/apache/maven/model/building/FileModelSourceTest.java
 copy maven-model-builder/src/test/resources/poms/inheritance/{flat-urls-child.xml => no-append-urls2-child.xml} (77%)
 copy maven-model-builder/src/test/resources/poms/inheritance/{no-append-urls-expected.xml => no-append-urls2-expected.xml} (79%)
 copy maven-model-builder/src/test/resources/poms/inheritance/{flat-urls-parent.xml => no-append-urls2-parent.xml} (76%)
 copy maven-model-builder/src/test/resources/poms/inheritance/{flat-urls-child.xml => no-append-urls3-child.xml} (81%)
 copy maven-model-builder/src/test/resources/poms/inheritance/{no-append-urls-expected.xml => no-append-urls3-expected.xml} (84%)
 copy maven-model-builder/src/test/resources/poms/inheritance/{flat-urls-parent.xml => no-append-urls3-parent.xml} (76%)
 copy maven-model-builder/src/test/resources/poms/validation/{bad-import-scope-classifier.xml => bad-dependency-management-scope.xml} (53%)
 copy maven-embedder/src/examples/simple-project/pom.xml => maven-model-builder/src/test/resources/poms/validation/raw-model/self-referencing-classifier.xml (63%)


[maven] 01/01: [MNG-5693] Change logging of MojoExceptions to console

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

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

commit 2d88cbc8fac79f398879c384f68ef6988ba0f380
Author: Sylwester Lachiewicz <sl...@gmail.com>
AuthorDate: Wed Oct 10 11:48:10 2018 +0200

    [MNG-5693] Change logging of MojoExceptions to console
    
    MojoExecutionException and MojoFailureException should never refer to a wikipage anymore.
---
 .../maven/exception/DefaultExceptionHandler.java   | 103 +--------------------
 .../exception/DefaultExceptionHandlerTest.java     |  16 ++--
 .../main/java/org/apache/maven/cli/MavenCli.java   |  12 ---
 3 files changed, 9 insertions(+), 122 deletions(-)

diff --git a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
index 2a86667..86f272e 100644
--- a/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
+++ b/maven-core/src/main/java/org/apache/maven/exception/DefaultExceptionHandler.java
@@ -19,20 +19,13 @@ package org.apache.maven.exception;
  * under the License.
  */
 
-import java.io.IOException;
-import java.net.ConnectException;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.maven.lifecycle.LifecycleExecutionException;
 import org.apache.maven.model.building.ModelProblem;
 import org.apache.maven.model.building.ModelProblemUtils;
 import org.apache.maven.plugin.AbstractMojoExecutionException;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugin.PluginContainerException;
-import org.apache.maven.plugin.PluginExecutionException;
 import org.apache.maven.project.ProjectBuildingException;
 import org.apache.maven.project.ProjectBuildingResult;
 import org.codehaus.plexus.component.annotations.Component;
@@ -98,8 +91,6 @@ public class DefaultExceptionHandler
 
     private ExceptionSummary handle( String message, Throwable exception )
     {
-        String reference = getReference( exception );
-
         List<ExceptionSummary> children = null;
 
         if ( exception instanceof ProjectBuildingException )
@@ -124,7 +115,7 @@ public class DefaultExceptionHandler
             message = getMessage( message, exception );
         }
 
-        return new ExceptionSummary( exception, message, reference, children );
+        return new ExceptionSummary( exception, message, null, children );
     }
 
     private ExceptionSummary handle( ProjectBuildingResult result )
@@ -173,98 +164,6 @@ public class DefaultExceptionHandler
         }
     }
 
-    private String getReference( Throwable exception )
-    {
-        String reference = "";
-
-        if ( exception != null )
-        {
-            if ( exception instanceof MojoExecutionException )
-            {
-                reference = MojoExecutionException.class.getSimpleName();
-
-                Throwable cause = exception.getCause();
-                if ( cause instanceof IOException )
-                {
-                    cause = cause.getCause();
-                    if ( cause instanceof ConnectException )
-                    {
-                        reference = ConnectException.class.getSimpleName();
-                    }
-                }
-            }
-            else if ( exception instanceof MojoFailureException )
-            {
-                reference = MojoFailureException.class.getSimpleName();
-            }
-            else if ( exception instanceof LinkageError )
-            {
-                reference = LinkageError.class.getSimpleName();
-            }
-            else if ( exception instanceof PluginExecutionException )
-            {
-                Throwable cause = exception.getCause();
-
-                if ( cause instanceof PluginContainerException )
-                {
-                    Throwable cause2 = cause.getCause();
-
-                    if ( cause2 instanceof NoClassDefFoundError
-                        && cause2.getMessage().contains( "org/sonatype/aether/" ) )
-                    {
-                        reference = "AetherClassNotFound";
-                    }
-                }
-
-                if ( StringUtils.isEmpty( reference ) )
-                {
-                    reference = getReference( cause );
-                }
-
-                if ( StringUtils.isEmpty( reference ) )
-                {
-                    reference = exception.getClass().getSimpleName();
-                }
-            }
-            else if ( exception instanceof LifecycleExecutionException )
-            {
-                reference = getReference( exception.getCause() );
-            }
-            else if ( isNoteworthyException( exception ) )
-            {
-                reference = exception.getClass().getSimpleName();
-            }
-        }
-
-        if ( StringUtils.isNotEmpty( reference ) && !reference.startsWith( "http:" ) )
-        {
-            reference = "http://cwiki.apache.org/confluence/display/MAVEN/" + reference;
-        }
-
-        return reference;
-    }
-
-    private boolean isNoteworthyException( Throwable exception )
-    {
-        if ( exception == null )
-        {
-            return false;
-        }
-        else if ( exception instanceof Error )
-        {
-            return true;
-        }
-        else if ( exception instanceof RuntimeException )
-        {
-            return false;
-        }
-        else if ( exception.getClass().getName().startsWith( "java" ) )
-        {
-            return false;
-        }
-        return true;
-    }
-
     private String getMessage( String message, Throwable exception )
     {
         String fullMessage = ( message != null ) ? message : "";
diff --git a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java
index 9727bdf..82a0c79 100644
--- a/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java
+++ b/maven-core/src/test/java/org/apache/maven/exception/DefaultExceptionHandlerTest.java
@@ -24,14 +24,14 @@ import java.net.ConnectException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
 
 /**
  * @author <a href="mailto:baerrach@apache.org">Barrie Treloar</a>
  */
-public class DefaultExceptionHandlerTest
-    extends TestCase
-{
+public class DefaultExceptionHandlerTest {
     /**
      * Running Maven under JDK7 may cause connection issues because IPv6 is used by default.
      * <p>
@@ -42,19 +42,19 @@ public class DefaultExceptionHandlerTest
      * http://cwiki.apache.org/confluence/display/MAVEN/ConnectException
      * </p>
      */
+    @Test
     public void testJdk7ipv6()
     {
         ConnectException connEx = new ConnectException( "Connection refused: connect" );
-        IOException ioEx = new IOException( "Unable to establish loopback connection" );
-        ioEx.initCause( connEx );
+        IOException ioEx = new IOException( "Unable to establish loopback connection", connEx );
         MojoExecutionException mojoEx =
             new MojoExecutionException( "Error executing Jetty: Unable to establish loopback connection", ioEx );
 
         ExceptionHandler exceptionHandler = new DefaultExceptionHandler();
         ExceptionSummary exceptionSummary = exceptionHandler.handleException( mojoEx );
 
-        String expectedReference = "http://cwiki.apache.org/confluence/display/MAVEN/ConnectException";
-        assertEquals( expectedReference, exceptionSummary.getReference() );
+        assertEquals( "", exceptionSummary.getReference() );
+        assertEquals( mojoEx, exceptionSummary.getException() );
 
     }
 }
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
index f7ceda2..638c310 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
@@ -992,18 +992,6 @@ public class MavenCli
                     + " switch to enable full debug logging." );
             }
 
-            if ( !references.isEmpty() )
-            {
-                slf4jLogger.error( "" );
-                slf4jLogger.error( "For more information about the errors and possible solutions"
-                                       + ", please read the following articles:" );
-
-                for ( Map.Entry<String, String> entry : references.entrySet() )
-                {
-                    slf4jLogger.error( buffer().strong( entry.getValue() ) + " " + entry.getKey() );
-                }
-            }
-
             if ( project != null && !project.equals( result.getTopologicallySortedProjects().get( 0 ) ) )
             {
                 slf4jLogger.error( "" );