-
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.
Showing
17 changed files
with
43 additions
and
507 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
57 changes: 4 additions & 53 deletions
57
versions-maven-plugin/src/it/it-set-001-issue-76/verify.groovy
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 |
---|---|---|
@@ -1,54 +1,5 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
import org.apache.maven.model.io.xpp3.MavenXpp3Reader; | ||
import org.apache.maven.model.Model; | ||
import org.apache.maven.model.Dependency; | ||
import java.util.List; | ||
import groovy.xml.XmlSlurper | ||
|
||
|
||
boolean test() | ||
{ | ||
result = true; | ||
try | ||
{ | ||
parentPomFile = new File( basedir, "pom.xml" ); | ||
pomReader = new MavenXpp3Reader(); | ||
pomModel = pomReader.read( new InputStreamReader( new FileInputStream( parentPomFile ) ) ); | ||
|
||
result = result && verifyThatDependencyHasNotBeenChanged( pomModel.getDependencies() ); | ||
result = result && verifyThatTheProjectVerisonHasBeenChanged( pomModel ); | ||
|
||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
|
||
// == Support functions === | ||
boolean verifyThatTheProjectVerisonHasBeenChanged( model ) { | ||
|
||
if ( !"2.3".equals(model.getVersion()) ) | ||
{ | ||
System.err.println("Model version not been changed " + model.getId() ); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
boolean verifyThatDependencyHasNotBeenChanged( dependencies ) { | ||
|
||
Dependency dep = dependencies.get(0) | ||
if ( !"2.2".equals(dep.getVersion()) ) | ||
{ | ||
System.err.println("Dependency has been changed " + dep.getId() ); | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
return test(); | ||
def project = new XmlSlurper().parse(new File(basedir, 'pom.xml')) | ||
assert project.version == '2.3' | ||
assert project.dependencies.dependency[0].version == '2.2' |
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
invoker.goals.1=${project.groupId}:${project.artifactId}:${project.version}:set -DnewVersion=2.0 | ||
invoker.nonRecursive.1=true | ||
invoker.buildResult.1=success | ||
|
||
invoker.goals.2=${project.groupId}:${project.artifactId}:${project.version}:set -DnewVersion=2.0 -DgroupId=* -DartifactId=* -DoldVersion=* | ||
invoker.nonRecursive.2=true | ||
invoker.buildResult.2=success | ||
invoker.description.2=Test the set mojo when the new version is the same as the old version, using wildcards. This kind of build used to fail accourding the issue 83 from github. | ||
invoker.buildResult.2=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
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
import groovy.xml.XmlSlurper | ||
|
||
def project = new XmlSlurper().parse(new File(basedir, 'pom.xml')) | ||
assert project.version == '2.0' |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set -DnewVersion=2.0 | ||
invoker.nonRecursive=true | ||
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
Oops, something went wrong.