-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c22da0
commit 5547184
Showing
5 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
versions-maven-plugin/src/it/it-compare-dependencies-006/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:compare-dependencies -Dscope=compile | ||
invoker.systemPropertiesFile = test.properties |
44 changes: 44 additions & 0 deletions
44
versions-maven-plugin/src/it/it-compare-dependencies-006/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-compare-dependencies-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>#123 add scope filter property</name> | ||
<description> | ||
the scope filter property to allow excluding artifacts based on scope: | ||
junit is set to test scope and we ask a comparison in scope compile | ||
</description> | ||
<dependencyManagement> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>org.apache.maven</groupId> | ||
<artifactId>maven-artifact</artifactId> | ||
<version>2.0.10</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</dependencyManagement> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1.1-2</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
2 changes: 2 additions & 0 deletions
2
versions-maven-plugin/src/it/it-compare-dependencies-006/test.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
remotePom=localhost:dummy-bom-pom:1.0 | ||
reportOutputFile=target/depDiffs.txt |
26 changes: 26 additions & 0 deletions
26
versions-maven-plugin/src/it/it-compare-dependencies-006/verify.bsh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/depDiffs.txt" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "2.0.10 -> 2.0.9" ) < 0 ) | ||
{ | ||
System.err.println( "Version diff in maven artifact not found. it should be processed because its scope is compile" ); | ||
return false; | ||
} | ||
if ( buf.indexOf( "4.0 -> 4.1" ) > 0 ) | ||
{ | ||
System.err.println( "Version diff in junit artifact found. it should be excluded because its scope is test" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters