From 65309e8350570583e5e55fcf458e0ae445a178ef Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Sat, 6 Jul 2024 12:30:46 +0200 Subject: [PATCH] Improve ITs for set goal ref #1106 --- .../src/it/it-set-005-properties/pom.xml | 83 ------------- .../it/it-set-005-properties/verify.groovy | 1 + .../src/it/it-set-005/module-a1/pom.xml | 2 +- .../src/it/it-set-005/pom.xml | 83 ------------- .../src/it/it-set-005/verify.groovy | 8 +- .../src/it/it-set-006/invoker.properties | 5 +- .../src/it/it-set-006/module-a1/pom.xml | 2 +- .../src/it/it-set-006/pom.xml | 88 +------------- .../src/it/it-set-006/verify.bsh | 115 ------------------ .../src/it/it-set-006/verify.groovy | 16 +++ .../src/it/it-set-007/pom.xml | 83 ------------- .../src/it/it-set-008/pom.xml | 83 ------------- .../src/it/it-set-009/alternative-pom.xml | 83 ------------- .../src/it/it-set-010/pom.xml | 83 ------------- .../src/it/it-set-010/verify.bsh | 32 ----- .../src/it/it-set-010/verify.groovy | 4 + .../src/it/it-set-011/pom.xml | 83 ------------- .../src/it/it-set-011/verify.bsh | 32 ----- .../src/it/it-set-011/verify.groovy | 7 ++ .../src/it/it-set-012/invoker.properties | 2 - .../src/it/it-set-012/pom.xml | 96 --------------- .../src/it/it-set-012/verify.bsh | 32 ----- .../src/it/it-set-013/invoker.properties | 2 - .../src/it/it-set-013/pom.xml | 96 --------------- .../src/it/it-set-013/verify.bsh | 32 ----- .../src/it/it-set-014/pom.xml | 83 ------------- .../src/it/it-set-014/verify.bsh | 32 ----- .../src/it/it-set-014/verify.groovy | 4 + .../src/it/it-set-015/invoker.properties | 2 - .../src/it/it-set-015/pom.xml | 96 --------------- .../src/it/it-set-015/verify.bsh | 32 ----- .../src/it/it-set-016/pom.xml | 83 ------------- .../src/it/it-set-016/verify.bsh | 32 ----- .../src/it/it-set-016/verify.groovy | 7 ++ .../it-set-017-issue-321/invoker.properties | 1 - .../src/it/it-set-017-issue-321/pom.xml | 83 ------------- .../it/it-set-018-issue-82/invoker.properties | 6 +- .../src/it/it-set-018-issue-82/pom.xml | 83 ------------- .../it-set-019-issue-426/invoker.properties | 5 +- .../src/it/it-set-019-issue-426/pom.xml | 83 ------------- .../codehaus/mojo/versions/SetMojoTest.java | 3 + 41 files changed, 62 insertions(+), 1726 deletions(-) delete mode 100644 versions-maven-plugin/src/it/it-set-006/verify.bsh create mode 100644 versions-maven-plugin/src/it/it-set-006/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-set-010/verify.bsh create mode 100644 versions-maven-plugin/src/it/it-set-010/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-set-011/verify.bsh create mode 100644 versions-maven-plugin/src/it/it-set-011/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-set-012/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-set-012/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-set-012/verify.bsh delete mode 100644 versions-maven-plugin/src/it/it-set-013/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-set-013/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-set-013/verify.bsh delete mode 100644 versions-maven-plugin/src/it/it-set-014/verify.bsh create mode 100644 versions-maven-plugin/src/it/it-set-014/verify.groovy delete mode 100644 versions-maven-plugin/src/it/it-set-015/invoker.properties delete mode 100644 versions-maven-plugin/src/it/it-set-015/pom.xml delete mode 100644 versions-maven-plugin/src/it/it-set-015/verify.bsh delete mode 100644 versions-maven-plugin/src/it/it-set-016/verify.bsh create mode 100644 versions-maven-plugin/src/it/it-set-016/verify.groovy diff --git a/versions-maven-plugin/src/it/it-set-005-properties/pom.xml b/versions-maven-plugin/src/it/it-set-005-properties/pom.xml index 6b8590b851..379dc8238b 100644 --- a/versions-maven-plugin/src/it/it-set-005-properties/pom.xml +++ b/versions-maven-plugin/src/it/it-set-005-properties/pom.xml @@ -18,87 +18,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-005-properties/verify.groovy b/versions-maven-plugin/src/it/it-set-005-properties/verify.groovy index 58de3b9548..4bb787006c 100644 --- a/versions-maven-plugin/src/it/it-set-005-properties/verify.groovy +++ b/versions-maven-plugin/src/it/it-set-005-properties/verify.groovy @@ -5,6 +5,7 @@ assert parentPom.version == '1.2.1-SNAPSHOT' def moduleA1 = new XmlSlurper().parse( new File( basedir, 'module-a1/pom.xml' ) ) assert moduleA1.parent.version == '1.2.1-SNAPSHOT' +assert moduleA1.version == '2.0.7-SNAPSHOT' def moduleA2 = new XmlSlurper().parse( new File( basedir, 'module-a2/pom.xml' ) ) assert moduleA2.parent.version == '1.2.1-SNAPSHOT' diff --git a/versions-maven-plugin/src/it/it-set-005/module-a1/pom.xml b/versions-maven-plugin/src/it/it-set-005/module-a1/pom.xml index c09fb0afd8..a62c078ae4 100644 --- a/versions-maven-plugin/src/it/it-set-005/module-a1/pom.xml +++ b/versions-maven-plugin/src/it/it-set-005/module-a1/pom.xml @@ -3,7 +3,7 @@ localdomain.localhost project-a - 1.2.1-SNAPSHOT + 1.2.0 4.0.0 diff --git a/versions-maven-plugin/src/it/it-set-005/pom.xml b/versions-maven-plugin/src/it/it-set-005/pom.xml index 5851023b44..6f819457a7 100644 --- a/versions-maven-plugin/src/it/it-set-005/pom.xml +++ b/versions-maven-plugin/src/it/it-set-005/pom.xml @@ -18,87 +18,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-005/verify.groovy b/versions-maven-plugin/src/it/it-set-005/verify.groovy index 958c1c389c..bc1550c294 100644 --- a/versions-maven-plugin/src/it/it-set-005/verify.groovy +++ b/versions-maven-plugin/src/it/it-set-005/verify.groovy @@ -1,11 +1,13 @@ import groovy.xml.XmlSlurper -def parentPom = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) ) +def parentPom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) assert parentPom.version == '1.2.1-SNAPSHOT' -def moduleA1 = new XmlSlurper().parse( new File( basedir, 'module-a1/pom.xml' ) ) +def moduleA1 = new XmlSlurper().parse(new File(basedir, 'module-a1/pom.xml')) assert moduleA1.parent.version == '1.2.1-SNAPSHOT' +assert moduleA1.version == '2.0.7-SNAPSHOT' -def moduleA2 = new XmlSlurper().parse( new File( basedir, 'module-a2/pom.xml' ) ) +def moduleA2 = new XmlSlurper().parse(new File(basedir, 'module-a2/pom.xml')) assert moduleA2.parent.version == '1.2.1-SNAPSHOT' +assert moduleA2.version == '1.2.1-SNAPSHOT' diff --git a/versions-maven-plugin/src/it/it-set-006/invoker.properties b/versions-maven-plugin/src/it/it-set-006/invoker.properties index 6a46477207..95a82dcbf4 100644 --- a/versions-maven-plugin/src/it/it-set-006/invoker.properties +++ b/versions-maven-plugin/src/it/it-set-006/invoker.properties @@ -1,2 +1,3 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DnewVersion=1.2.1-SNAPSHOT -DupdateMatchingVersions=false -invoker.nonRecursive=true +invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set \ + -DnewVersion=1.2.1-SNAPSHOT \ + -DupdateMatchingVersions=false diff --git a/versions-maven-plugin/src/it/it-set-006/module-a1/pom.xml b/versions-maven-plugin/src/it/it-set-006/module-a1/pom.xml index c09fb0afd8..a62c078ae4 100644 --- a/versions-maven-plugin/src/it/it-set-006/module-a1/pom.xml +++ b/versions-maven-plugin/src/it/it-set-006/module-a1/pom.xml @@ -3,7 +3,7 @@ localdomain.localhost project-a - 1.2.1-SNAPSHOT + 1.2.0 4.0.0 diff --git a/versions-maven-plugin/src/it/it-set-006/pom.xml b/versions-maven-plugin/src/it/it-set-006/pom.xml index 4706164014..f7d5cb373a 100644 --- a/versions-maven-plugin/src/it/it-set-006/pom.xml +++ b/versions-maven-plugin/src/it/it-set-006/pom.xml @@ -9,8 +9,9 @@ mversions-114 - invoking versions:set on root module should not update child module versions - unless they are the same as the parent old version unless + invoking versions:set on root module should update all child module versions + even they are the different as the parent old version + with DupdateMatchingVersions=false @@ -19,87 +20,4 @@ module-a3 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-006/verify.bsh b/versions-maven-plugin/src/it/it-set-006/verify.bsh deleted file mode 100644 index 2b419dec8a..0000000000 --- a/versions-maven-plugin/src/it/it-set-006/verify.bsh +++ /dev/null @@ -1,115 +0,0 @@ -import java.io.*; -import org.codehaus.plexus.util.FileUtils; -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\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set new version in parent pom" ); - return false; - } - - file = new File( basedir, "module-a1/pom.xml" ); - - in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); - buf = new StringBuilder(); - line = in.readLine(); - while ( line != null ) - { - buf.append( line ); - buf.append( " " ); - line = in.readLine(); - } - - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E.*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not update parent version in module-a1/pom" ); - return false; - } - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*2\\.0\\.7-SNAPSHOT\\s*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did update child version in module-a1/pom" ); - return false; - } - - file = new File( basedir, "module-a2/pom.xml" ); - - in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); - buf = new StringBuilder(); - line = in.readLine(); - while ( line != null ) - { - buf.append( line ); - buf.append( " " ); - line = in.readLine(); - } - - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E.*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not update parent version in module-a2/pom" ); - return false; - } - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( m.find() ) - { - System.out.println( "Did update child version in module-a2/pom" ); - return false; - } - - file = new File( basedir, "module-a3/pom.xml" ); - - in = new BufferedReader( new InputStreamReader( new FileInputStream( file ), "UTF-8" ) ); - buf = new StringBuilder(); - line = in.readLine(); - while ( line != null ) - { - buf.append( line ); - buf.append( " " ); - line = in.readLine(); - } - - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E.*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not update parent version in module-a3/pom" ); - return false; - } - p = Pattern.compile( "\\Q\\E.*\\Q\\E\\s*1\\.2\\.1-SNAPSHOT\\s*\\Q\\E" ); - m = p.matcher( buf.toString() ); - if ( m.find() ) - { - System.out.println( "Did add explicit child version in module-a3/pom" ); - return false; - } - -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-006/verify.groovy b/versions-maven-plugin/src/it/it-set-006/verify.groovy new file mode 100644 index 0000000000..578328a50b --- /dev/null +++ b/versions-maven-plugin/src/it/it-set-006/verify.groovy @@ -0,0 +1,16 @@ +import groovy.xml.XmlSlurper + +def parentPom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) +assert parentPom.version == '1.2.1-SNAPSHOT' + +def moduleA1 = new XmlSlurper().parse(new File(basedir, 'module-a1/pom.xml')) +assert moduleA1.parent.version == '1.2.1-SNAPSHOT' +assert moduleA1.version == '2.0.7-SNAPSHOT' // due to updateMatchingVersions=false + +def moduleA2 = new XmlSlurper().parse(new File(basedir, 'module-a2/pom.xml')) +assert moduleA2.parent.version == '1.2.1-SNAPSHOT' +assert moduleA2.version == '1.2.0' // due to updateMatchingVersions=false + +def moduleA3 = new XmlSlurper().parse(new File(basedir, 'module-a3/pom.xml')) +assert moduleA3.parent.version == '1.2.1-SNAPSHOT' +assert moduleA3.version == '' diff --git a/versions-maven-plugin/src/it/it-set-007/pom.xml b/versions-maven-plugin/src/it/it-set-007/pom.xml index ee54994986..0e03eea399 100644 --- a/versions-maven-plugin/src/it/it-set-007/pom.xml +++ b/versions-maven-plugin/src/it/it-set-007/pom.xml @@ -18,87 +18,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-008/pom.xml b/versions-maven-plugin/src/it/it-set-008/pom.xml index 0367db3489..eb78508e24 100644 --- a/versions-maven-plugin/src/it/it-set-008/pom.xml +++ b/versions-maven-plugin/src/it/it-set-008/pom.xml @@ -17,87 +17,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-009/alternative-pom.xml b/versions-maven-plugin/src/it/it-set-009/alternative-pom.xml index 31b4ec6018..5ab9e06db9 100644 --- a/versions-maven-plugin/src/it/it-set-009/alternative-pom.xml +++ b/versions-maven-plugin/src/it/it-set-009/alternative-pom.xml @@ -14,87 +14,4 @@ child - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-010/pom.xml b/versions-maven-plugin/src/it/it-set-010/pom.xml index 4dbfbb0b39..5650d6fa17 100644 --- a/versions-maven-plugin/src/it/it-set-010/pom.xml +++ b/versions-maven-plugin/src/it/it-set-010/pom.xml @@ -10,87 +10,4 @@ Remove -SNAPSHOT from the version - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-010/verify.bsh b/versions-maven-plugin/src/it/it-set-010/verify.bsh deleted file mode 100644 index 38e11249d8..0000000000 --- a/versions-maven-plugin/src/it/it-set-010/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -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\\E\\s*1\\.0\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not remove -SNAPSHOT from version in pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-010/verify.groovy b/versions-maven-plugin/src/it/it-set-010/verify.groovy new file mode 100644 index 0000000000..a3a8027558 --- /dev/null +++ b/versions-maven-plugin/src/it/it-set-010/verify.groovy @@ -0,0 +1,4 @@ +import groovy.xml.XmlSlurper + +def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) +assert pom.version == '1.0' diff --git a/versions-maven-plugin/src/it/it-set-011/pom.xml b/versions-maven-plugin/src/it/it-set-011/pom.xml index 72ecd30ed5..7fe7184795 100644 --- a/versions-maven-plugin/src/it/it-set-011/pom.xml +++ b/versions-maven-plugin/src/it/it-set-011/pom.xml @@ -14,87 +14,4 @@ child - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-011/verify.bsh b/versions-maven-plugin/src/it/it-set-011/verify.bsh deleted file mode 100644 index 3b79c343b8..0000000000 --- a/versions-maven-plugin/src/it/it-set-011/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -import java.io.*; -import java.util.regex.*; - -try -{ - File file = new File( basedir, "child/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\\E.*\\Q\\E\\s*1\\.0\\s*\\Q\\E.*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not remove -SNAPSHOT from version in child pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-011/verify.groovy b/versions-maven-plugin/src/it/it-set-011/verify.groovy new file mode 100644 index 0000000000..a16cec5b02 --- /dev/null +++ b/versions-maven-plugin/src/it/it-set-011/verify.groovy @@ -0,0 +1,7 @@ +import groovy.xml.XmlSlurper + +def parentPom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) +assert parentPom.version == '1.0' + +def child = new XmlSlurper().parse(new File(basedir, 'child/pom.xml')) +assert child.parent.version == '1.0' diff --git a/versions-maven-plugin/src/it/it-set-012/invoker.properties b/versions-maven-plugin/src/it/it-set-012/invoker.properties deleted file mode 100644 index 7b2a0f6162..0000000000 --- a/versions-maven-plugin/src/it/it-set-012/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DnextSnapshot=true -invoker.nonRecursive=true diff --git a/versions-maven-plugin/src/it/it-set-012/pom.xml b/versions-maven-plugin/src/it/it-set-012/pom.xml deleted file mode 100644 index 6a3861e525..0000000000 --- a/versions-maven-plugin/src/it/it-set-012/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - 4.0.0 - - localhost - it-set-012 - 1.0 - pom - set - - Set to next -SNAPSHOT version - - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - - diff --git a/versions-maven-plugin/src/it/it-set-012/verify.bsh b/versions-maven-plugin/src/it/it-set-012/verify.bsh deleted file mode 100644 index fae372ed56..0000000000 --- a/versions-maven-plugin/src/it/it-set-012/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -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\\E\\s*1\\.1-SNAPSHOT\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set next -SNAPSHOT version in pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-013/invoker.properties b/versions-maven-plugin/src/it/it-set-013/invoker.properties deleted file mode 100644 index 7b2a0f6162..0000000000 --- a/versions-maven-plugin/src/it/it-set-013/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DnextSnapshot=true -invoker.nonRecursive=true diff --git a/versions-maven-plugin/src/it/it-set-013/pom.xml b/versions-maven-plugin/src/it/it-set-013/pom.xml deleted file mode 100644 index 1d53dc21d8..0000000000 --- a/versions-maven-plugin/src/it/it-set-013/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - 4.0.0 - - localhost - it-set-013 - 1.0.0.0 - pom - set - - Set to next -SNAPSHOT version with 4 digit version - - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - - diff --git a/versions-maven-plugin/src/it/it-set-013/verify.bsh b/versions-maven-plugin/src/it/it-set-013/verify.bsh deleted file mode 100644 index e4411fc63f..0000000000 --- a/versions-maven-plugin/src/it/it-set-013/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -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\\E\\s*1\\.0\\.0\\.1-SNAPSHOT\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set next -SNAPSHOT version in pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-014/pom.xml b/versions-maven-plugin/src/it/it-set-014/pom.xml index 475221332c..9662793e61 100644 --- a/versions-maven-plugin/src/it/it-set-014/pom.xml +++ b/versions-maven-plugin/src/it/it-set-014/pom.xml @@ -10,87 +10,4 @@ Set to next -SNAPSHOT version with 3 digit version - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-014/verify.bsh b/versions-maven-plugin/src/it/it-set-014/verify.bsh deleted file mode 100644 index 499d35880b..0000000000 --- a/versions-maven-plugin/src/it/it-set-014/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -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\\E\\s*1\\.0\\.1-SNAPSHOT\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set next -SNAPSHOT version in pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-014/verify.groovy b/versions-maven-plugin/src/it/it-set-014/verify.groovy new file mode 100644 index 0000000000..9161603249 --- /dev/null +++ b/versions-maven-plugin/src/it/it-set-014/verify.groovy @@ -0,0 +1,4 @@ +import groovy.xml.XmlSlurper + +def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) +assert pom.version == '1.0.1-SNAPSHOT' diff --git a/versions-maven-plugin/src/it/it-set-015/invoker.properties b/versions-maven-plugin/src/it/it-set-015/invoker.properties deleted file mode 100644 index 7b2a0f6162..0000000000 --- a/versions-maven-plugin/src/it/it-set-015/invoker.properties +++ /dev/null @@ -1,2 +0,0 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DnextSnapshot=true -invoker.nonRecursive=true diff --git a/versions-maven-plugin/src/it/it-set-015/pom.xml b/versions-maven-plugin/src/it/it-set-015/pom.xml deleted file mode 100644 index 049f6b158b..0000000000 --- a/versions-maven-plugin/src/it/it-set-015/pom.xml +++ /dev/null @@ -1,96 +0,0 @@ - - 4.0.0 - - localhost - it-set-015 - 1 - pom - set - - Set to next -SNAPSHOT version with 1 digit version - - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - - diff --git a/versions-maven-plugin/src/it/it-set-015/verify.bsh b/versions-maven-plugin/src/it/it-set-015/verify.bsh deleted file mode 100644 index b6c4c12ebe..0000000000 --- a/versions-maven-plugin/src/it/it-set-015/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -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\\E\\s*2-SNAPSHOT\\s*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set next -SNAPSHOT version in pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-016/pom.xml b/versions-maven-plugin/src/it/it-set-016/pom.xml index 8eb6a75ed0..65154b59e4 100644 --- a/versions-maven-plugin/src/it/it-set-016/pom.xml +++ b/versions-maven-plugin/src/it/it-set-016/pom.xml @@ -14,87 +14,4 @@ child - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-016/verify.bsh b/versions-maven-plugin/src/it/it-set-016/verify.bsh deleted file mode 100644 index e7b1bb384d..0000000000 --- a/versions-maven-plugin/src/it/it-set-016/verify.bsh +++ /dev/null @@ -1,32 +0,0 @@ -import java.io.*; -import java.util.regex.*; - -try -{ - File file = new File( basedir, "child/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\\E.*\\Q\\E\\s*1\\.1-SNAPSHOT\\s*\\Q\\E.*\\Q\\E" ); - Matcher m = p.matcher( buf.toString() ); - if ( !m.find() ) - { - System.out.println( "Did not set next -SNAPSHOT version in child pom" ); - return false; - } -} -catch( Throwable t ) -{ - t.printStackTrace(); - return false; -} - -return true; diff --git a/versions-maven-plugin/src/it/it-set-016/verify.groovy b/versions-maven-plugin/src/it/it-set-016/verify.groovy new file mode 100644 index 0000000000..b7ee65758c --- /dev/null +++ b/versions-maven-plugin/src/it/it-set-016/verify.groovy @@ -0,0 +1,7 @@ +import groovy.xml.XmlSlurper + +def pom = new XmlSlurper().parse(new File(basedir, 'pom.xml')) +assert pom.version == '1.1-SNAPSHOT' + +def child = new XmlSlurper().parse(new File(basedir, 'child/pom.xml')) +assert child.parent.version == '1.1-SNAPSHOT' diff --git a/versions-maven-plugin/src/it/it-set-017-issue-321/invoker.properties b/versions-maven-plugin/src/it/it-set-017-issue-321/invoker.properties index ab5c3277f1..36f9a5c72a 100644 --- a/versions-maven-plugin/src/it/it-set-017-issue-321/invoker.properties +++ b/versions-maven-plugin/src/it/it-set-017-issue-321/invoker.properties @@ -1,3 +1,2 @@ invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DgroupId=* -DartifactId=* -DoldVersion=* -DnewVersion=1.3.0-SNAPSHOT -invoker.nonRecursive=true invoker.buildResult=failure diff --git a/versions-maven-plugin/src/it/it-set-017-issue-321/pom.xml b/versions-maven-plugin/src/it/it-set-017-issue-321/pom.xml index 996ecd4b07..b0e42e89db 100644 --- a/versions-maven-plugin/src/it/it-set-017-issue-321/pom.xml +++ b/versions-maven-plugin/src/it/it-set-017-issue-321/pom.xml @@ -17,87 +17,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-018-issue-82/invoker.properties b/versions-maven-plugin/src/it/it-set-018-issue-82/invoker.properties index a44c10e9bf..240a70ec9b 100644 --- a/versions-maven-plugin/src/it/it-set-018-issue-82/invoker.properties +++ b/versions-maven-plugin/src/it/it-set-018-issue-82/invoker.properties @@ -1,2 +1,4 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -fmodule-a1 -DnewVersion=2.5.0-SNAPSHOT -DprocessFromLocalAggregationRoot=false -invoker.nonRecursive=true +invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set \ + -fmodule-a1 \ + -DnewVersion=2.5.0-SNAPSHOT \ + -DprocessFromLocalAggregationRoot=false diff --git a/versions-maven-plugin/src/it/it-set-018-issue-82/pom.xml b/versions-maven-plugin/src/it/it-set-018-issue-82/pom.xml index 61fac2cc5a..4f4dfe9d95 100644 --- a/versions-maven-plugin/src/it/it-set-018-issue-82/pom.xml +++ b/versions-maven-plugin/src/it/it-set-018-issue-82/pom.xml @@ -17,87 +17,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/it/it-set-019-issue-426/invoker.properties b/versions-maven-plugin/src/it/it-set-019-issue-426/invoker.properties index 42bcaca4c8..38fa6edffa 100644 --- a/versions-maven-plugin/src/it/it-set-019-issue-426/invoker.properties +++ b/versions-maven-plugin/src/it/it-set-019-issue-426/invoker.properties @@ -1,2 +1,3 @@ -invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -fmodule-a1 -DnewVersion=2.5.0-SNAPSHOT -invoker.nonRecursive=true +invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set \ + -fmodule-a1 \ + -DnewVersion=2.5.0-SNAPSHOT diff --git a/versions-maven-plugin/src/it/it-set-019-issue-426/pom.xml b/versions-maven-plugin/src/it/it-set-019-issue-426/pom.xml index c8a4012349..847fecf7cf 100644 --- a/versions-maven-plugin/src/it/it-set-019-issue-426/pom.xml +++ b/versions-maven-plugin/src/it/it-set-019-issue-426/pom.xml @@ -17,87 +17,4 @@ module-a2 - - - - - maven-antrun-plugin - 1.1 - - - maven-assembly-plugin - 2.2-beta-2 - - - maven-clean-plugin - 2.2 - - - maven-compiler-plugin - 2.0.2 - - - maven-dependency-plugin - 2.0 - - - maven-deploy-plugin - 2.3 - - - maven-ear-plugin - 2.3.1 - - - maven-ejb-plugin - 2.1 - - - maven-install-plugin - 2.2 - - - maven-jar-plugin - 2.2 - - - maven-javadoc-plugin - 2.4 - - - maven-plugin-plugin - 2.4.1 - - - maven-rar-plugin - 2.2 - - - maven-release-plugin - 2.0-beta-7 - - - maven-resources-plugin - 2.2 - - - maven-site-plugin - 2.0 - - - maven-source-plugin - 2.0.4 - - - maven-surefire-plugin - 2.4.2 - - - maven-war-plugin - 2.1-alpha-1 - - - - - diff --git a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/SetMojoTest.java b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/SetMojoTest.java index 9bebfd58f4..1c5bdfc279 100644 --- a/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/SetMojoTest.java +++ b/versions-maven-plugin/src/test/java/org/codehaus/mojo/versions/SetMojoTest.java @@ -57,7 +57,10 @@ public void tearDown() throws IOException { public void testGetIncrementedVersion() throws MojoExecutionException { new SetMojo(null, null, null, null, null, null) { { + assertThat(getIncrementedVersion("1", null), is("2-SNAPSHOT")); + assertThat(getIncrementedVersion("1.0", null), is("1.1-SNAPSHOT")); assertThat(getIncrementedVersion("1.0.0", null), is("1.0.1-SNAPSHOT")); + assertThat(getIncrementedVersion("1.0.0.0", null), is("1.0.0.1-SNAPSHOT")); assertThat(getIncrementedVersion("1.0.0-SNAPSHOT", null), is("1.0.1-SNAPSHOT")); assertThat(getIncrementedVersion("1.0.0-SNAPSHOT", 1), is("2.0.0-SNAPSHOT")); assertThat(getIncrementedVersion("1.0.0-SNAPSHOT", 2), is("1.1.0-SNAPSHOT"));