-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#550 ignore plugins which have not version in current POM but in pare…
…nt POM
- Loading branch information
1 parent
50e624a
commit 65fa0ee
Showing
5 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
src/it/it-display-plugin-updates-011-ignore-plugin-defined-in-parent/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 @@ | ||
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates |
31 changes: 31 additions & 0 deletions
31
src/it/it-display-plugin-updates-011-ignore-plugin-defined-in-parent/parent/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,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-101-parent</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>display-plugin-updates-parent</name> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
<version>1.0</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> |
39 changes: 39 additions & 0 deletions
39
src/it/it-display-plugin-updates-011-ignore-plugin-defined-in-parent/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,39 @@ | ||
<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> | ||
|
||
<parent> | ||
<groupId>localhost</groupId> | ||
<artifactId>it-101-parent</artifactId> | ||
<version>1.0</version> | ||
<relativePath>parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<groupId>localhost</groupId> | ||
<artifactId>it-101</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>display-plugin-updates</name> | ||
|
||
<description>Ignore plugin used in this POM without version, which has a version defined in a parent POM.</description> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.3</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
</project> |
25 changes: 25 additions & 0 deletions
25
src/it/it-display-plugin-updates-011-ignore-plugin-defined-in-parent/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,25 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "build.log" ); | ||
String buf = FileUtils.fileRead( file ); | ||
|
||
// output should not contain any message like 'localhost:dummy-maven-plugin .....' because this plugin should be ignored due to its version defined in parent POM | ||
Pattern p = Pattern.compile( "\\Qlocalhost:dummy-maven-plugin\\E\\s*\\.+" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( m.find() ) | ||
{ | ||
System.out.println( "dummy-maven-plugin should not be listed in output, version is defined in Parent POM" ); | ||
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