-
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.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
81 changed files
with
1,706 additions
and
1,484 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
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
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
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,100 @@ | ||
<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-set-009</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>set</name> | ||
|
||
<description>Tests operations with a parent pom with an alternative name</description> | ||
|
||
<modules> | ||
<module>child</module> | ||
</modules> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-antrun-plugin</artifactId> | ||
<version>1.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.2-beta-2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-clean-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>2.0.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.3</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-ear-plugin</artifactId> | ||
<version>2.3.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-ejb-plugin</artifactId> | ||
<version>2.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-install-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-plugin-plugin</artifactId> | ||
<version>2.4.1</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-rar-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-release-plugin</artifactId> | ||
<version>2.0-beta-7</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>2.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>2.0</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>2.0.4</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.4.2</version> | ||
</plugin> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.1-alpha-1</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
|
||
</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,15 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>localhost</groupId> | ||
<artifactId>it-set-009</artifactId> | ||
<version>1.0</version> | ||
<relativePath>..\alternative-pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>it-set-009-child-1</artifactId> | ||
<packaging>pom</packaging> | ||
|
||
</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,2 @@ | ||
invoker.goals=-f alternative-pom.xml ${project.groupId}:${project.artifactId}:${project.version}:set -DnewVersion=2.0 | ||
invoker.buildResult=success |
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,58 @@ | ||
import org.apache.commons.lang.StringUtils | ||
|
||
import javax.xml.parsers.DocumentBuilderFactory | ||
import javax.xml.xpath.XPathFactory | ||
|
||
class Checker | ||
{ | ||
def result = true; | ||
def basedir; | ||
|
||
public Checker(File basedir) { | ||
this.basedir = basedir; | ||
} | ||
|
||
def readXPath( String pom, String xPathExpression ) | ||
{ | ||
def stream = new FileInputStream( new File( basedir, pom ) ); | ||
try | ||
{ | ||
return XPathFactory.newInstance() | ||
.newXPath() | ||
.evaluate( xPathExpression, DocumentBuilderFactory.newInstance() | ||
.newDocumentBuilder() | ||
.parse( stream ).documentElement ); | ||
} | ||
finally | ||
{ | ||
stream.close(); | ||
} | ||
} | ||
|
||
Checker check( String message, String pom, String xpath, String expected ) | ||
{ | ||
if ( result ) | ||
{ | ||
try | ||
{ | ||
def actual = readXPath( pom, xpath ) | ||
if ( !StringUtils.equals( expected, actual ) ) | ||
{ | ||
System.out.println( pom + " [xpath:" + xpath + "] expected '" + expected + "' found '" + actual + "' : " + message ); | ||
result = false; | ||
} | ||
} | ||
catch ( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
result = false; | ||
} | ||
} | ||
return this; | ||
} | ||
} | ||
|
||
return new Checker(basedir) | ||
.check( "alternative-pom.xml change", "alternative-pom.xml", "/project/version", "2.0") | ||
.check( "child/pom.xml change", "child/pom.xml", "/project/parent/version", "2.0") | ||
.result; |
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
Oops, something went wrong.