Skip to content

Commit

Permalink
Resolves #387: Provide an enforcer rule to specify a maximum number o…
Browse files Browse the repository at this point in the history
…f allowed dependency updates
  • Loading branch information
andrzejj0 committed Oct 28, 2022
1 parent 6647b8d commit 74048e9
Show file tree
Hide file tree
Showing 25 changed files with 1,411 additions and 293 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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:*</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>
2 changes: 2 additions & 0 deletions src/it/it-max-dependency-updates-004/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = enforcer:enforce
invoker.buildResult = success
45 changes: 45 additions & 0 deletions src/it/it-max-dependency-updates-004/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<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-impl</artifactId>
<version>2.0</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>
<ignoreMinorUpdates>true</ignoreMinorUpdates>
</maxDependencyUpdates>
</rules>
</configuration>
<dependencies>
<dependency>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

</project>
Loading

0 comments on commit 74048e9

Please sign in to comment.