You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2021/01/03 12:09:03 UTC
[maven] branch MNG-7060 updated (13c8990 -> 7aac694)
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a change to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git.
from 13c8990 Adjust message of exception
add 31ad2ff Use system line separator wherever possible
add 3709e2e Improve README
add 538de4d [MNG-6888] Remove deprecated command line options
new 47eb355 [MNG-7060] Let build fail fast in case any maven-gpg-plugin goal is called
new 51777b0 Use just 1 filter
new c1c2c96 respect build/consumer status
new f1564c4 Adjust message of exception
new 7aac694 Merge branch 'MNG-7060' of https://gitbox.apache.org/repos/asf/maven into MNG-7060
The 5 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:
README.md | 10 +--
.../MultipleArtifactsNotFoundException.java | 10 ++-
.../repository/MavenArtifactRepository.java | 18 +++--
.../metadata/AbstractRepositoryMetadata.java | 10 ++-
.../resolver/ArtifactResolutionRequest.java | 11 +--
.../resolver/ArtifactResolutionResult.java | 10 ++-
.../maven/exception/DefaultExceptionHandler.java | 8 +-
.../maven/plugin/PluginParameterException.java | 39 +++++-----
.../project/artifact/ActiveProjectArtifact.java | 2 +-
.../project/artifact/MavenMetadataSource.java | 10 +--
.../legacy/metadata/AbstractArtifactMetadata.java | 10 ++-
.../settings/SettingsConfigurationException.java | 4 +-
.../maven/plugin/PluginParameterExceptionTest.java | 89 +++++++++++-----------
.../main/java/org/apache/maven/cli/CLIManager.java | 12 +--
.../main/java/org/apache/maven/cli/MavenCli.java | 20 +----
.../DuplicateMojoDescriptorException.java | 4 +-
.../maven/plugin/logging/SystemStreamLog.java | 6 +-
17 files changed, 136 insertions(+), 137 deletions(-)
[maven] 03/05: respect build/consumer status
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git
commit c1c2c9674cae1c290a14a68a394423608a6f7bca
Author: rfscholte <rf...@apache.org>
AuthorDate: Wed Dec 30 23:49:11 2020 +0100
respect build/consumer status
---
.../lifecycle/internal/builder/BuilderCommon.java | 22 ++++++++++++++--------
.../java/org/apache/maven/feature/Features.java | 10 +++++++++-
2 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index b22bc94..f363be9 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -33,6 +33,7 @@ import org.apache.maven.execution.BuildFailure;
import org.apache.maven.execution.ExecutionEvent;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenSession;
+import org.apache.maven.feature.Features;
import org.apache.maven.lifecycle.LifecycleExecutionException;
import org.apache.maven.lifecycle.LifecycleNotFoundException;
import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException;
@@ -108,15 +109,20 @@ public class BuilderCommon
// With Maven 4's build/consumer the POM will always rewrite during distribution.
// The maven-gpg-plugin uses the original POM, causing an invalid signature.
// Fail as long as there's no solution available yet
- Optional<MojoExecution> gpgMojo = executionPlan.getMojoExecutions().stream()
- .filter( m -> "maven-gpg-plugin".equals( m.getArtifactId() )
- && "org.apache.maven.plugins".equals( m.getGroupId() ) )
- .findAny();
-
- if ( gpgMojo.isPresent() )
+ if ( Features.buildConsumer().isActive() )
{
- throw new LifecycleExecutionException( "The maven-gpg-plugin is not supported by Maven 4."
- + " Verify if there is a compatible signing solution or use Maven 3" );
+ Optional<MojoExecution> gpgMojo = executionPlan.getMojoExecutions().stream()
+ .filter( m -> "maven-gpg-plugin".equals( m.getArtifactId() )
+ && "org.apache.maven.plugins".equals( m.getGroupId() ) )
+ .findAny();
+
+ if ( gpgMojo.isPresent() )
+ {
+ throw new LifecycleExecutionException( "The maven-gpg-plugin is not supported by Maven 4."
+ + " Verify if there is a compatible signing solution"
+ + " or add -D" + Features.buildConsumer().propertyName() + "=false"
+ + " or use Maven 3" );
+ }
}
if ( session.getRequest().getDegreeOfConcurrency() > 1 )
diff --git a/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java b/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java
index 0387163..f060ef9 100644
--- a/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java
+++ b/maven-model-builder/src/main/java/org/apache/maven/feature/Features.java
@@ -47,16 +47,24 @@ public final class Features
public static class Feature
{
private final boolean active;
+
+ private final String name;
Feature( String name, String defaultValue )
{
- active = "true".equals( System.getProperty( name, defaultValue ) );
+ this.name = name;
+ this.active = "true".equals( System.getProperty( name, defaultValue ) );
}
public boolean isActive()
{
return active;
}
+
+ public String propertyName()
+ {
+ return name;
+ }
}
[maven] 05/05: Merge branch 'MNG-7060' of
https://gitbox.apache.org/repos/asf/maven into MNG-7060
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 7aac6940b5e3603034b8f2910512981c241293ac
Merge: f1564c4 13c8990
Author: rfscholte <rf...@apache.org>
AuthorDate: Sun Jan 3 13:08:48 2021 +0100
Merge branch 'MNG-7060' of https://gitbox.apache.org/repos/asf/maven into MNG-7060
[maven] 02/05: Use just 1 filter
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 51777b08376f97d5dfa2e1d47faf5a45f314a43d
Author: rfscholte <rf...@apache.org>
AuthorDate: Wed Dec 30 22:43:38 2020 +0100
Use just 1 filter
---
.../org/apache/maven/lifecycle/internal/builder/BuilderCommon.java | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index 70a97ad..b22bc94 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -23,7 +23,6 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
-import java.util.stream.Stream;
import javax.inject.Inject;
import javax.inject.Named;
@@ -110,8 +109,8 @@ public class BuilderCommon
// The maven-gpg-plugin uses the original POM, causing an invalid signature.
// Fail as long as there's no solution available yet
Optional<MojoExecution> gpgMojo = executionPlan.getMojoExecutions().stream()
- .filter( m -> "org.apache.maven.plugins".equals( m.getGroupId() ) )
- .filter( m -> "maven-gpg-plugin".equals( m.getArtifactId() ) )
+ .filter( m -> "maven-gpg-plugin".equals( m.getArtifactId() )
+ && "org.apache.maven.plugins".equals( m.getGroupId() ) )
.findAny();
if ( gpgMojo.isPresent() )
[maven] 04/05: Adjust message of exception
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git
commit f1564c47787c5a7e6bb116094abc5536c64a40e0
Author: rfscholte <rf...@apache.org>
AuthorDate: Thu Dec 31 09:59:48 2020 +0100
Adjust message of exception
---
.../org/apache/maven/lifecycle/internal/builder/BuilderCommon.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index f363be9..2b5d6ec 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -119,9 +119,9 @@ public class BuilderCommon
if ( gpgMojo.isPresent() )
{
throw new LifecycleExecutionException( "The maven-gpg-plugin is not supported by Maven 4."
- + " Verify if there is a compatible signing solution"
- + " or add -D" + Features.buildConsumer().propertyName() + "=false"
- + " or use Maven 3" );
+ + " Verify if there is a compatible signing solution,"
+ + " add -D" + Features.buildConsumer().propertyName() + "=false"
+ + " or use Maven 3." );
}
}
[maven] 01/05: [MNG-7060] Let build fail fast in case any
maven-gpg-plugin goal is called
Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-7060
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 47eb355facdcc7d027cb0ae51a8ed2b5794d9cdf
Author: rfscholte <rf...@apache.org>
AuthorDate: Wed Dec 30 21:09:24 2020 +0100
[MNG-7060] Let build fail fast in case any maven-gpg-plugin goal is called
---
.../maven/lifecycle/internal/builder/BuilderCommon.java | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
index c0cd289..70a97ad 100644
--- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
+++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/BuilderCommon.java
@@ -20,8 +20,10 @@ package org.apache.maven.lifecycle.internal.builder;
*/
import java.util.List;
+import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
+import java.util.stream.Stream;
import javax.inject.Inject;
import javax.inject.Named;
@@ -80,7 +82,6 @@ public class BuilderCommon
@Inject
private Logger logger;
-
public BuilderCommon()
{
}
@@ -105,6 +106,20 @@ public class BuilderCommon
lifecycleDebugLogger.debugProjectPlan( project, executionPlan );
+ // With Maven 4's build/consumer the POM will always rewrite during distribution.
+ // The maven-gpg-plugin uses the original POM, causing an invalid signature.
+ // Fail as long as there's no solution available yet
+ Optional<MojoExecution> gpgMojo = executionPlan.getMojoExecutions().stream()
+ .filter( m -> "org.apache.maven.plugins".equals( m.getGroupId() ) )
+ .filter( m -> "maven-gpg-plugin".equals( m.getArtifactId() ) )
+ .findAny();
+
+ if ( gpgMojo.isPresent() )
+ {
+ throw new LifecycleExecutionException( "The maven-gpg-plugin is not supported by Maven 4."
+ + " Verify if there is a compatible signing solution or use Maven 3" );
+ }
+
if ( session.getRequest().getDegreeOfConcurrency() > 1 )
{
final Set<Plugin> unsafePlugins = executionPlan.getNonThreadSafePlugins();