-
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.
Provide a "change recorder" for updates
This provides a ChangeRecorder interface that logs changes to a machine-readable XML file whenever a pom.xml file is updated. Closes #416 #356
- Loading branch information
1 parent
bf4fb54
commit a6a2d75
Showing
40 changed files
with
978 additions
and
80 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:update-parent |
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,40 @@ | ||
<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>dummy-parent</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<groupId>localhost</groupId> | ||
<artifactId>it-201</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>update-parent basic test</name> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<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>2.0</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,22 @@ | ||
import java.io.*; | ||
import java.util.regex.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-parent\" groupId=\"localhost\" kind=\"updateParent\" newVersion=\"3.0\" oldVersion=\"1.0\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
1 change: 1 addition & 0 deletions
1
src/it/it-changerecord-update-properties-001/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=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:update-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,59 @@ | ||
<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-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>update-properties with one property only</name> | ||
|
||
<properties> | ||
<api>1.0</api> | ||
</properties> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<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>2.0</version> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
|
||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<properties> | ||
<property> | ||
<name>api</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</property> | ||
</properties> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</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,21 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-api\" groupId=\"localhost\" kind=\"updateProperty\" newVersion=\"3.0\" oldVersion=\"1.0\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
1 change: 1 addition & 0 deletions
1
src/it/it-changerecord-use-latest-releases-001/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=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:use-latest-releases |
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,21 @@ | ||
<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-use-latest-releases-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a dependency to the latest release version</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1.1-2</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</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,21 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-api\" groupId=\"localhost\" kind=\"useLatestReleases\" newVersion=\"3.0\" oldVersion=\"1.1.1-2\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
1 change: 1 addition & 0 deletions
1
src/it/it-changerecord-use-latest-snapshots-001/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=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:use-latest-snapshots -DallowMinorUpdates=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,21 @@ | ||
<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-use-latest-snapshots-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a release dependency to the latest snapshot version</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
21 changes: 21 additions & 0 deletions
21
src/it/it-changerecord-use-latest-snapshots-001/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,21 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-api\" groupId=\"localhost\" kind=\"useLatestSnapshots\" newVersion=\"1.9.1-SNAPSHOT\" oldVersion=\"1.0\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
1 change: 1 addition & 0 deletions
1
src/it/it-changerecord-use-latest-versions-001/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=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:use-latest-versions |
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,21 @@ | ||
<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-use-latest-versions-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a dependency to the next release version</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1.1-2</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</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,21 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-api\" groupId=\"localhost\" kind=\"useLatestVersions\" newVersion=\"3.0\" oldVersion=\"1.1.1-2\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
1 change: 1 addition & 0 deletions
1
src/it/it-changerecord-use-next-versions-001/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=-DchangeRecorderFormat=xml ${project.groupId}:${project.artifactId}:${project.version}:use-next-versions |
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,21 @@ | ||
<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-use-next-versions-001</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a dependency to the next versions</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>1.1.1-2</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</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,21 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "target/versions-changes.xml" ); | ||
String buf = FileUtils.fileRead( file, "UTF-8" ); | ||
|
||
if ( buf.indexOf( "<update artifactId=\"dummy-api\" groupId=\"localhost\" kind=\"useNextVersions\" newVersion=\"1.1.2\" oldVersion=\"1.1.1-2\"/>" ) < 0 ) | ||
{ | ||
System.err.println( "Version change recorded" ); | ||
return false; | ||
} | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
Oops, something went wrong.