You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/12/27 22:23:43 UTC

[maven-enforcer] branch MENFORCER-452 created (now b68cd66)

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

sjaranowski pushed a change to branch MENFORCER-452
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git


      at b68cd66  [MENFORCER-452] Manage all Maven Core dependencies as provided

This branch includes the following new commits:

     new b68cd66  [MENFORCER-452] Manage all Maven Core dependencies as provided

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.



[maven-enforcer] 01/01: [MENFORCER-452] Manage all Maven Core dependencies as provided

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

sjaranowski pushed a commit to branch MENFORCER-452
in repository https://gitbox.apache.org/repos/asf/maven-enforcer.git

commit b68cd660ebe04be4e25b69941e3da5ba3040a3b4
Author: Slawomir Jaranowski <s....@gmail.com>
AuthorDate: Tue Dec 27 23:23:27 2022 +0100

    [MENFORCER-452] Manage all Maven Core dependencies as provided
---
 enforcer-rules/pom.xml                             |  9 ----
 .../enforcer/BanTransitiveDependencies.java        |  4 +-
 .../plugins/enforcer/BannedDependenciesBase.java   |  4 +-
 maven-enforcer-extension/pom.xml                   | 15 ++----
 maven-enforcer-plugin/pom.xml                      |  6 ---
 pom.xml                                            | 62 ++++++++++++++--------
 6 files changed, 47 insertions(+), 53 deletions(-)

diff --git a/enforcer-rules/pom.xml b/enforcer-rules/pom.xml
index 113183e..2a9b2a0 100644
--- a/enforcer-rules/pom.xml
+++ b/enforcer-rules/pom.xml
@@ -48,19 +48,10 @@
     <dependency>
       <groupId>org.eclipse.aether</groupId>
       <artifactId>aether-api</artifactId>
-      <version>1.1.0</version>
-      <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>org.eclipse.aether</groupId>
       <artifactId>aether-util</artifactId>
-      <version>1.1.0</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.eclipse.aether</groupId>
-          <artifactId>aether-api</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
index bf52d19..50beb20 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java
@@ -22,7 +22,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import com.google.common.base.Strings;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.maven.RepositoryUtils;
 import org.apache.maven.enforcer.rule.api.EnforcerRule;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
@@ -107,7 +107,7 @@ public class BanTransitiveDependencies extends AbstractNonCacheableEnforcerRule
 
         if ((excluded || hasTransitiveDependencies) && message != null) // then generate message
         {
-            message.append(Strings.repeat("   ", level)).append(node.getArtifact());
+            message.append(StringUtils.repeat("   ", level)).append(node.getArtifact());
 
             if (excluded) {
                 message.append(" [excluded]").append(System.lineSeparator());
diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java
index 3bd8760..11e9a78 100644
--- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java
+++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java
@@ -20,7 +20,7 @@ package org.apache.maven.plugins.enforcer;
 
 import java.util.List;
 
-import com.google.common.base.Strings;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleException;
 import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper;
@@ -105,7 +105,7 @@ abstract class BannedDependenciesBase extends AbstractNonCacheableEnforcerRule {
                         .map(childNode -> validate(childNode, level + 1, childMessageBuilder))
                         .reduce(true, Boolean::logicalAnd)) {
             messageBuilder
-                    .append(Strings.repeat("   ", level))
+                    .append(StringUtils.repeat("   ", level))
                     .append(ArtifactUtils.toArtifact(node).getId());
             if (rootFailed) {
                 messageBuilder.append(" <--- ").append(getErrorMessage());
diff --git a/maven-enforcer-extension/pom.xml b/maven-enforcer-extension/pom.xml
index 4e5fe7c..4c7a0dc 100644
--- a/maven-enforcer-extension/pom.xml
+++ b/maven-enforcer-extension/pom.xml
@@ -33,19 +33,13 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
-      <scope>provided</scope>
     </dependency>
     <dependency>
+      <!-- needed for IT tests -->
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-enforcer-plugin</artifactId>
       <version>${project.version}</version>
-      <scope>runtime</scope>
-      <exclusions>
-        <exclusion>
-          <groupId>*</groupId>
-          <artifactId>*</artifactId>
-        </exclusion>
-      </exclusions>
+      <scope>test</scope>
     </dependency>
   </dependencies>
 
@@ -61,9 +55,6 @@
   <profiles>
     <profile>
       <id>run-its</id>
-      <properties>
-        <maven.it.failure.ignore>false</maven.it.failure.ignore>
-      </properties>
       <build>
         <plugins>
           <plugin>
@@ -71,13 +62,13 @@
             <artifactId>maven-invoker-plugin</artifactId>
             <configuration>
               <showErrors>true</showErrors>
+              <debug>true</debug>
               <projectsDirectory>src/it/projects</projectsDirectory>
               <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
               <preBuildHookScript>setup</preBuildHookScript>
               <postBuildHookScript>verify</postBuildHookScript>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <settingsFile>src/it/mrm/settings.xml</settingsFile>
-              <ignoreFailures>${maven.it.failure.ignore}</ignoreFailures>
               <goals>
                 <goal>validate</goal>
               </goals>
diff --git a/maven-enforcer-plugin/pom.xml b/maven-enforcer-plugin/pom.xml
index 28ef0aa..e8b74a2 100644
--- a/maven-enforcer-plugin/pom.xml
+++ b/maven-enforcer-plugin/pom.xml
@@ -42,12 +42,10 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
-      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.plugin-tools</groupId>
@@ -141,9 +139,6 @@
   <profiles>
     <profile>
       <id>run-its</id>
-      <properties>
-        <maven.it.failure.ignore>false</maven.it.failure.ignore>
-      </properties>
       <build>
         <plugins>
           <plugin>
@@ -157,7 +152,6 @@
               <postBuildHookScript>verify</postBuildHookScript>
               <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
               <settingsFile>src/it/mrm/settings.xml</settingsFile>
-              <ignoreFailures>${maven.it.failure.ignore}</ignoreFailures>
               <goals>
                 <goal>validate</goal>
               </goals>
diff --git a/pom.xml b/pom.xml
index e4c98a6..7c8f6a9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -82,10 +82,13 @@
     <javaVersion>8</javaVersion>
     <mockito.version>4.10.0</mockito.version>
     <project.build.outputTimestamp>2022-12-22T22:11:45Z</project.build.outputTimestamp>
+    <!-- the same as Maven 3.2.5 -->
+    <aether.version>1.0.0.v20140518</aether.version>
   </properties>
 
   <dependencyManagement>
     <dependencies>
+      <!-- project dependencies -->
       <dependency>
         <groupId>org.apache.maven.enforcer</groupId>
         <artifactId>enforcer-api</artifactId>
@@ -103,31 +106,66 @@
         <type>test-jar</type>
         <scope>test</scope>
       </dependency>
+
+      <!-- Maven Core dependencies -->
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-artifact</artifactId>
         <version>${maven.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-plugin-api</artifactId>
         <version>${maven.version}</version>
+        <scope>provided</scope>
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
         <artifactId>maven-core</artifactId>
         <version>${maven.version}</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.aether</groupId>
+        <artifactId>aether-api</artifactId>
+        <version>${aether.version}</version>
+        <scope>provided</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.eclipse.aether</groupId>
+        <artifactId>aether-util</artifactId>
+        <version>${aether.version}</version>
+      </dependency>
+
+      <!-- other dependencies -->
+      <dependency>
+        <groupId>commons-codec</groupId>
+        <artifactId>commons-codec</artifactId>
+        <version>1.15</version>
+      </dependency>
+      <dependency>
+        <groupId>commons-io</groupId>
+        <artifactId>commons-io</artifactId>
+        <version>2.11.0</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.commons</groupId>
+        <artifactId>commons-lang3</artifactId>
+        <version>3.12.0</version>
       </dependency>
       <dependency>
         <groupId>org.apache.maven.shared</groupId>
-        <artifactId>maven-common-artifact-filters</artifactId>
-        <version>3.3.2</version>
+        <artifactId>maven-shared-utils</artifactId>
+        <version>3.3.4</version>
       </dependency>
       <dependency>
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
         <version>3.5.0</version>
       </dependency>
+
+      <!-- test dependencies -->
       <dependency>
         <groupId>org.junit</groupId>
         <artifactId>junit-bom</artifactId>
@@ -147,21 +185,6 @@
         <version>${mockito.version}</version>
         <scope>test</scope>
       </dependency>
-      <dependency>
-        <groupId>org.apache.commons</groupId>
-        <artifactId>commons-lang3</artifactId>
-        <version>3.12.0</version>
-      </dependency>
-      <dependency>
-        <groupId>commons-codec</groupId>
-        <artifactId>commons-codec</artifactId>
-        <version>1.15</version>
-      </dependency>
-      <dependency>
-        <groupId>commons-io</groupId>
-        <artifactId>commons-io</artifactId>
-        <version>2.11.0</version>
-      </dependency>
       <dependency>
         <groupId>org.apache.maven.plugin-testing</groupId>
         <artifactId>maven-plugin-testing-harness</artifactId>
@@ -174,11 +197,6 @@
           </exclusion>
         </exclusions>
       </dependency>
-      <dependency>
-        <groupId>org.apache.maven.shared</groupId>
-        <artifactId>maven-shared-utils</artifactId>
-        <version>3.3.4</version>
-      </dependency>
       <dependency>
         <groupId>org.assertj</groupId>
         <artifactId>assertj-core</artifactId>