-
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.
o Added processDependencyManagement option to control the reporting of dependencyManagement. Thanks to Bruce Brouwer.
- Loading branch information
1 parent
9b42718
commit 8391dbd
Showing
9 changed files
with
300 additions
and
6 deletions.
There are no files selected for viewing
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=site |
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,93 @@ | ||
<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-dependency-updates-report-003</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>dependency-updates-report</name> | ||
<url>http://localhost/</url> | ||
|
||
<properties> | ||
<processDependencyManagement>false</processDependencyManagement> | ||
</properties> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>2.0</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
</dependencies> | ||
</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>@sitePluginVersion@</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.1</version> | ||
<reportSets> | ||
<reportSet/> | ||
</reportSets> | ||
</plugin> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<reportSets> | ||
<reportSet> | ||
<reports> | ||
<report>dependency-updates-report</report> | ||
</reports> | ||
</reportSet> | ||
</reportSets> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
</project> |
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,7 @@ | ||
<project> | ||
<skin> | ||
<groupId>org.apache.maven.skins</groupId> | ||
<artifactId>maven-default-skin</artifactId> | ||
<version>1.0</version> | ||
</skin> | ||
</project> |
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,33 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/site/dependency-updates-report.html" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
String result = buf.toString() | ||
.replaceAll( "<[^>]+>", " " ) | ||
.replaceAll( "&[^;]+;", " " ) | ||
.replaceAll( "\\s+", " " ); | ||
|
||
if ( result.indexOf( "localhost dummy-api 1.1 compile jar 1.1.0-2 1.1.1 1.2 2.0" ) < 0 ) | ||
{ | ||
System.out.println( "Did not pick up updated in dependencies section" ); | ||
System.out.println( "Result = \"" + result +"\"" ); | ||
return false; | ||
} | ||
if ( !result.contains("This project does not declare any dependencies in a dependencyManagement section.")) | ||
{ | ||
System.out.println( "Did not ignore dependencyManagement" ); | ||
System.out.println( "Result = \"" + result +"\"" ); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=site |
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,96 @@ | ||
<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-dependency-updates-report-004</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>dependency-updates-report</name> | ||
<url>http://localhost/</url> | ||
|
||
<description> | ||
using the default for processDependencyManagement. | ||
</description> | ||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1</version> | ||
</dependency> | ||
</dependencies> | ||
</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>@sitePluginVersion@</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-project-info-reports-plugin</artifactId> | ||
<version>2.1</version> | ||
<reportSets> | ||
<reportSet/> | ||
</reportSets> | ||
</plugin> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<reportSets> | ||
<reportSet> | ||
<reports> | ||
<report>dependency-updates-report</report> | ||
</reports> | ||
</reportSet> | ||
</reportSets> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
</project> |
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,7 @@ | ||
<project> | ||
<skin> | ||
<groupId>org.apache.maven.skins</groupId> | ||
<artifactId>maven-default-skin</artifactId> | ||
<version>1.0</version> | ||
</skin> | ||
</project> |
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 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/site/dependency-updates-report.html" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
String result = buf.toString() | ||
.replaceAll( "<[^>]+>", " " ) | ||
.replaceAll( "&[^;]+;", " " ) | ||
.replaceAll( "\\s+", " " ); | ||
|
||
if ( !result.contains( "localhost dummy-api 1.1 jar 1.1.0-2 1.1.1 1.2 2.0" ) ) | ||
{ | ||
System.out.println( "Did not pick up updated in Dependency Management section" ); | ||
System.out.println( "Result = \"" + result +"\"" ); | ||
return false; | ||
} | ||
if ( !result.contains( "localhost dummy-impl 1.1 jar 1.2 2.0" ) ) | ||
{ | ||
System.out.println( "Did not pick up updated in Dependency Management section" ); | ||
System.out.println( "Result = \"" + result +"\"" ); | ||
return false; | ||
} | ||
if ( !result.contains( "This project does not declare any dependencies." ) ) | ||
{ | ||
System.out.println( "Dependency Management should have processed" ); | ||
System.out.println( "Result = \"" + result +"\"" ); | ||
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