Skip to content

Commit

Permalink
Implementing mojohaus#684: allow providing ruleSet in POM
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejj0 committed Sep 12, 2022
1 parent 8178231 commit 7ff7dd5
Show file tree
Hide file tree
Showing 55 changed files with 1,427 additions and 283 deletions.
7 changes: 5 additions & 2 deletions src/it/it-compare-dependencies-001/invoker.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:compare-dependencies
invoker.systemPropertiesFile = test.properties
invoker.goals.1 = ${project.groupId}:${project.artifactId}:${project.version}:compare-dependencies
invoker.mavenOpts.1 = -DreportOutputFile=depDiffs-1.txt -DremotePom=localhost:dummy-bom-pom:1.0

invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:compare-dependencies
invoker.mavenOpts.2 = -DreportOutputFile=depDiffs-1.txt -DremotePom=localhost:dummy-bom-pom:1.0
2 changes: 0 additions & 2 deletions src/it/it-compare-dependencies-001/test.properties

This file was deleted.

21 changes: 0 additions & 21 deletions src/it/it-compare-dependencies-001/verify.bsh

This file was deleted.

2 changes: 2 additions & 0 deletions src/it/it-compare-dependencies-001/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
output = new File(basedir, "depDiffs-1.txt").text
assert output =~ /\b2.0.10 -> 2.0.9\b/
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.

7 changes: 7 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,7 @@
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,8 @@
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,8 @@
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.

6 changes: 6 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,6 @@
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/ )

Loading

0 comments on commit 7ff7dd5

Please sign in to comment.