Skip to content

Commit

Permalink
fixes #318 implement includes/excludes for dependencies
Browse files Browse the repository at this point in the history
fixes #318 implement includes/excludes for dependencies

apply maven codestyle

fixes #318 implement includes/excludes for dependencies

bump @SInCE 2.12.0

fixes #318 implement includes/excludes for dependencies

make ITs work on windows

fixes #318 implement includes/excludes for dependencies

switch to List<String> instead of splitting a list-style string myself

fixes #318 implement includes/excludes for dependencies

migrate ITs to test.properties since maven runner does some magic with "," in invoker.goals with no other workaround
fix some descriptions

fixes #318 implement includes/excludes for dependencies

add IT for multiple comma-separated inclusion filters
  • Loading branch information
Christoph Linder authored and slawekjaranowski committed Aug 15, 2022
1 parent ea9f98d commit f474819
Show file tree
Hide file tree
Showing 34 changed files with 1,563 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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-318-dependencyExcludes</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyExcludes</name>
<description>exclude a set of dependencies</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependencyExcludes=*:*:*:*:*:compile,*:*:*:*:*:test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def buildLog = new File( basedir, "build.log" )

assert buildLog.text.contains( """
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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-318-dependencyIncludes-multi</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyIncludes-multi</name>
<description>include a set of dependencies using multiple filters</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependencyIncludes=*:dummy-api,*:dummy-impl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def buildLog = new File(basedir, "build.log")

assert buildLog.text.contains("""
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO] localhost:dummy-impl ...................................... 1.0 -> 2.2
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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-318-dependencyIncludes</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyIncludes</name>
<description>include a set of dependencies</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dependencyIncludes=localhost:dummy-*:*:*:*:*
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def buildLog = new File(basedir, "build.log")

assert buildLog.text.contains("""
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO] localhost:dummy-impl ...................................... 1.0 -> 2.2
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<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-318-dependencyIncludesAndExcludes</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyIncludesAndExcludes</name>
<description>combine dependency inclusion and exclusion</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencyIncludes=localhost:dummy-*:*:*:*:*
dependencyExcludes=*:dummy-impl:*:*:*
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def buildLog = new File(basedir, "build.log")

assert buildLog.text.contains("""
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
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-display-dependency-updates-issue-318-dependencyManagementExcludes</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyManagementExcludes</name>
<description>exclude dependencies from dependencyManagement</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.11</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api-impl-bom-pom</artifactId>
<version>1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
processDependencies=false
dependencyManagementExcludes=*:*:*:*:*:provided,*:*:*:*:*:import
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def buildLog = new File(basedir, "build.log")

assert buildLog.text.contains("""
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO] localhost:dummy-impl ...................................... 1.0 -> 2.2
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-dependency-updates
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<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-318-dependencyManagementIncludes</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>it-display-dependency-updates-issue-318-dependencyManagementIncludes</name>
<description>include dependencies from dependencyManagement</description>
<url>http://localhost/</url>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.11</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-impl</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>localhost</groupId>
<artifactId>latest-versions-api</artifactId>
<version>2.0.8</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
processDependencies=false
dependencyManagementIncludes=*:*:*:*:*:null,*:*:*:*:*:test
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def buildLog = new File(basedir, "build.log")

assert buildLog.text.contains("""
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO] localhost:dummy-api ....................................... 1.0 -> 3.0
[INFO] localhost:dummy-impl ...................................... 1.0 -> 2.2
[INFO]
[INFO] ------------------------------------------------------------------------
""".replaceAll( "\n", System.lineSeparator() ) )

return true
Loading

0 comments on commit f474819

Please sign in to comment.