Skip to content

Commit

Permalink
Resolves mojohaus#387: Provide an enforcer rule to specify a maximum …
Browse files Browse the repository at this point in the history
…number of allowed dependency updates
  • Loading branch information
jarmoniuk committed Oct 27, 2022
1 parent b75a565 commit 65e3adf
Show file tree
Hide file tree
Showing 15 changed files with 1,074 additions and 222 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Expand Up @@ -200,6 +200,13 @@
<version>${wagonVersion}</version>
</dependency>

<!-- Enforcer -->
<dependency>
<groupId>org.apache.maven.enforcer</groupId>
<artifactId>enforcer-api</artifactId>
<version>3.1.0</version>
</dependency>

<!-- Doxia -->
<dependency>
<groupId>org.apache.maven.doxia</groupId>
Expand Down
2 changes: 2 additions & 0 deletions src/it/it-max-dependency-updates-001/invoker.properties
@@ -0,0 +1,2 @@
invoker.goals = enforcer:enforce
invoker.buildResult = failure
44 changes: 44 additions & 0 deletions src/it/it-max-dependency-updates-001/pom.xml
@@ -0,0 +1,44 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>localhost</groupId>
<artifactId>it-max-dependency-upgrades</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<maxDependencyUpdates>
<maxUpdates>0</maxUpdates>
</maxDependencyUpdates>
</rules>
</configuration>
<dependencies>
<dependency>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
2 changes: 2 additions & 0 deletions src/it/it-max-dependency-updates-002/invoker.properties
@@ -0,0 +1,2 @@
invoker.goals = enforcer:enforce
invoker.buildResult = success
44 changes: 44 additions & 0 deletions src/it/it-max-dependency-updates-002/pom.xml
@@ -0,0 +1,44 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>localhost</groupId>
<artifactId>it-max-dependency-upgrades</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<maxDependencyUpdates>
<maxUpdates>1</maxUpdates>
</maxDependencyUpdates>
</rules>
</configuration>
<dependencies>
<dependency>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
2 changes: 2 additions & 0 deletions src/it/it-max-dependency-updates-003/invoker.properties
@@ -0,0 +1,2 @@
invoker.goals = enforcer:enforce
invoker.buildResult = success
47 changes: 47 additions & 0 deletions src/it/it-max-dependency-updates-003/pom.xml
@@ -0,0 +1,47 @@
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>localhost</groupId>
<artifactId>it-max-dependency-upgrades</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.1.0</version>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<maxDependencyUpdates>
<maxUpdates>0</maxUpdates>
<dependencyExcludes>
<dependencyExclude>localhost:dummy-api</dependencyExclude>
</dependencyExcludes>
</maxDependencyUpdates>
</rules>
</configuration>
<dependencies>
<dependency>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>

0 comments on commit 65e3adf

Please sign in to comment.