Skip to content

Commit

Permalink
Implementing #684: allow providing ruleSet in POM
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejj0 committed Sep 13, 2022
1 parent 8178231 commit 3127ac3
Show file tree
Hide file tree
Showing 50 changed files with 1,453 additions and 335 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:dependency-updates-report
51 changes: 51 additions & 0 deletions src/it/it-dependency-updates-report-issue-684-001/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<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-abstract-versions-report-001</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>abstract-versions-report</name>
<url>http://localhost/</url>

<description>
Testing command line invocation of dependency- and plugin-updates-report
</description>

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

<build>
<plugins>
<plugin>
<groupId>localhost</groupId>
<artifactId>dummy-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<ruleSet>
<ignoreVersions>
<ignoreVersion>
<version>3.0</version>
</ignoreVersion>
</ignoreVersions>
</ruleSet>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output = new File( basedir, "target/site/dependency-updates-report.html" ).text
assert ! ( output =~ /\b3.0\b/ )
6 changes: 5 additions & 1 deletion src/it/it-display-dependency-updates-001/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -Dmaven.version.ignore=3.0
25 changes: 0 additions & 25 deletions src/it/it-display-dependency-updates-001/verify.bsh

This file was deleted.

6 changes: 6 additions & 0 deletions src/it/it-display-dependency-updates-001/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output = new File(basedir, "output1.txt").text
assert output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+3\.0\b/

output = new File(basedir, "output2.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+3\.0\b/ )
assert output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+2\.1\b/
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
output = new File(basedir, "output1.txt").text
assert output =~ /localhost:dummy-api/
assert output !=~ /localhost:dummy-impl/
assert ! ( output =~ /localhost:dummy-impl/ )

output = new File(basedir, "output2.txt").text
assert output !=~ /localhost:dummy-api/
assert ! ( output =~ /localhost:dummy-api/ )
assert output =~ /localhost:dummy-impl/

output = new File(basedir, "output3.txt").text
assert output =~ /localhost:dummy-impl/
assert output !=~ /localhost:dummy-parent2/
assert ! ( output =~ /localhost:dummy-parent2/ )

output = new File(basedir, "output4.txt").text
assert output !=~ /localhost:dummy-impl/
assert ! ( output =~ /localhost:dummy-impl/ )
assert output =~ /localhost:dummy-parent2/

output = new File(basedir, "output5.txt")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -Dmaven.version.ignore=2.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<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-display-dependency-updates-issue-684-pom-based-rules</artifactId>
<version>1.0</version>
<packaging>pom</packaging>

<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<ruleSet>
<ignoreVersions>
<ignoreVersion>
<version>3.0</version>
</ignoreVersion>
</ignoreVersions>
</ruleSet>
</configuration>
</plugin>
<plugin>
<groupId>localhost</groupId>
<artifactId>dummy-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output = new File(basedir, "output1.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+3\.0\b/ )
assert output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+2\.1\b/

output = new File(basedir, "output2.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+2\.1\b/ )
assert output =~ /\Qlocalhost:dummy-api\E\s*\.*\s*1\.1\s+->\s+2\.0\b/
7 changes: 6 additions & 1 deletion src/it/it-display-plugin-updates-001/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates
invoker.goals.1=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8

invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -Dmaven.version.ignore=3.0

25 changes: 0 additions & 25 deletions src/it/it-display-plugin-updates-001/verify.bsh

This file was deleted.

6 changes: 6 additions & 0 deletions src/it/it-display-plugin-updates-001/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
output = new File(basedir, "output1.txt").text
assert output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+3\.0\b/

output = new File(basedir, "output2.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+3\.0\b/ )
assert output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+2\.1\b/
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -Dmaven.version.ignore=2.1
57 changes: 57 additions & 0 deletions src/it/it-display-plugin-updates-issue-684-pom-based-rules/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<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-101</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>display-plugin-updates</name>

<prerequisites>
<maven>2.0.6</maven>
</prerequisites>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<ruleSet>
<ignoreVersions>
<ignoreVersion>
<version>3.0</version>
</ignoreVersion>
</ignoreVersions>
</ruleSet>
</configuration>
</plugin>
<plugin>
<groupId>localhost</groupId>
<artifactId>dummy-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.3</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.2</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
output = new File(basedir, "output1.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+3\.0\b/ )
assert output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+2\.1\b/

output = new File(basedir, "output2.txt").text
assert ! ( output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+2\.1\b/ )
assert output =~ /\Qlocalhost:dummy-maven-plugin\E\s*\.*\s*1\.0\s+->\s+2\.0\b/
6 changes: 5 additions & 1 deletion src/it/it-display-property-updates-001/invoker.properties
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
invoker.goals=-DautoLinkItems=true ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8 -DautoLinkItems=true

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -DautoLinkItems=true -Dmaven.version.ignore=2.0
25 changes: 0 additions & 25 deletions src/it/it-display-property-updates-001/verify.bsh

This file was deleted.

5 changes: 5 additions & 0 deletions src/it/it-display-property-updates-001/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
output = new File(basedir, "output1.txt").text
assert output =~ /\Q\u0024{api}\E\s*\.*\s*1\.0\s+->\s+2\.0\b/

output = new File(basedir, "output2.txt").text
assert ! ( output =~ /\Q\u0024{api}\E\s*\.*\s*1\.0\s+->\s+2\.0\b/ )
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates
invoker.mavenOpts.1 = -Dversions.outputFile=./output1.txt -DoutputEncoding=UTF-8 -DautoLinkItems=true

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:display-property-updates
invoker.mavenOpts.2 = -Dversions.outputFile=./output2.txt -DoutputEncoding=UTF-8 -DautoLinkItems=true -Dmaven.version.ignore=1.3
Loading

0 comments on commit 3127ac3

Please sign in to comment.