forked from mojohaus/versions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding parent processing to UseLatestVersion/UseLatestSnapshot/UseLatestRelease Change-Id: Iee03438288d7345569dc6aed27c628fef12caa7d
- Loading branch information
Julian Di Leonardo
committed
Jan 3, 2018
1 parent
7bce2bf
commit 4e87d5d
Showing
21 changed files
with
610 additions
and
5 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=${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,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>dummy-parent</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<groupId>localhost</groupId> | ||
<artifactId>it-use-latest-releases-006</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a parent dependency</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<processParent>true</processParent> | ||
</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,33 @@ | ||
import java.io.*; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<parent>\\E.*\\Q<version>\\E\\s*3\\.0\\s*\\Q</version>\\E.*\\Q</parent>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update parent to version 3.0" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
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=${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,46 @@ | ||
<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-use-latest-release-007</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update matching parent and dependency declaration</name> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-parent</artifactId> | ||
<version>1.0</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<processParent>true</processParent> | ||
</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,62 @@ | ||
import java.io.*; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<parent>\\E.*\\Q<version>\\E\\s*3\\.0\\s*\\Q</version>\\E.*\\Q</parent>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update parent to version 3.0" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<version>\\E\\s*3\\.0\\s*\\Q</version>\\E.*\\Q<type>pom</type>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update to version 3.0" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
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=${project.groupId}:${project.artifactId}:${project.version}:use-latest-snapshots |
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,41 @@ | ||
<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-parent2</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<groupId>localhost</groupId> | ||
<artifactId>it-use-latest-snapshots-003</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update a parent dependency</name> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<processParent>true</processParent> | ||
<allowMajorUpdates>true</allowMajorUpdates> | ||
<allowMinorUpdates>true</allowMinorUpdates> | ||
</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,33 @@ | ||
import java.io.*; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<parent>\\E.*\\Q<version>\\E\\s*3\\.0-SNAPSHOT\\s*\\Q</version>\\E.*\\Q</parent>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update parent to version 3.0-SNAPSHOT" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
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=${project.groupId}:${project.artifactId}:${project.version}:use-latest-snapshots |
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,48 @@ | ||
<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-parent2</artifactId> | ||
<version>1.0</version> | ||
</parent> | ||
|
||
<groupId>localhost</groupId> | ||
<artifactId>it-use-latest-snapshots-004</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>Update matching parent and dependency declaration</name> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>1.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-parent2</artifactId> | ||
<version>1.0</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>@project.groupId@</groupId> | ||
<artifactId>@project.artifactId@</artifactId> | ||
<version>@project.version@</version> | ||
<configuration> | ||
<processParent>true</processParent> | ||
<allowMajorUpdates>true</allowMajorUpdates> | ||
<allowMinorUpdates>true</allowMinorUpdates> | ||
</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,62 @@ | ||
import java.io.*; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<parent>\\E.*\\Q<version>\\E\\s*3\\.0-SNAPSHOT\\s*\\Q</version>\\E.*\\Q</parent>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update parent to version 3.0" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "pom.xml" ); | ||
|
||
BufferedReader in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); | ||
StringBuilder buf = new StringBuilder(); | ||
String line = in.readLine(); | ||
while ( line != null ) | ||
{ | ||
buf.append( line ); | ||
buf.append( " " ); | ||
line = in.readLine(); | ||
} | ||
|
||
Pattern p = Pattern.compile( "\\Q<version>\\E\\s*3\\.0-SNAPSHOT\\s*\\Q</version>\\E.*\\Q<type>pom</type>\\E" ); | ||
Matcher m = p.matcher( buf.toString() ); | ||
if ( !m.find() ) | ||
{ | ||
System.out.println( "Did not update to version 3.0" ); | ||
return false; | ||
} | ||
System.out.println( m.group( 0 ) ); | ||
} | ||
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=${project.groupId}:${project.artifactId}:${project.version}:use-latest-versions |
Oops, something went wrong.