Skip to content

Commit

Permalink
Issue mojohaus#134: Removing the patch: no longer needed; PomHelper.g…
Browse files Browse the repository at this point in the history
…etRawModel can be used instead. Adding more integration tests.
  • Loading branch information
andrzejj0 committed Nov 13, 2022
1 parent c250a38 commit 95000ce
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:force-releases
invoker.mavenOpts = -DprocessDependencyManagement=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def project = new XmlSlurper()
.parse( new File( basedir, 'pom.xml' ) )
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version == '1.0.0'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:use-dep-version
invoker.mavenOpts = -DdepVersion=31 -Dincludes=org.apache.maven:maven-parent
24 changes: 24 additions & 0 deletions versions-maven-plugin/src/it/it-use-dep-version-issue-134/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<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-releases-issue-134</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>Check if boms are upated</name>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<!-- use an old version: -->
<version>30</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version != '31'
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:use-latest-releases
invoker.mavenOpts = -DprocessDependencyManagement=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def project = new XmlSlurper()
.parse( new File( basedir, 'pom.xml' ) )
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version != '30'
assert project.dependencyManagement.dependencies.dependency.version != '30-SNAPSHOT'
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:use-latest-snapshots
invoker.mavenOpts = -DprocessDependencyManagement=true -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true
invoker.mavenOpts = -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def project = new XmlSlurper()
.parse( new File( basedir, 'pom.xml' ) )
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version == '3.0.0-SNAPSHOT'
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:use-next-releases
invoker.mavenOpts = -DprocessDependencyManagement=true
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-bom2</artifactId>
<version>1.0.0</version>
<groupId>org.apache.maven</groupId>
<artifactId>maven-parent</artifactId>
<!-- use an old version: -->
<version>30</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def project = new XmlSlurper()
.parse( new File( basedir, 'pom.xml' ) )
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version == '1.1.0'
assert project.dependencyManagement.dependencies.dependency.version == 31
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:use-next-snapshots
invoker.mavenOpts = -DprocessDependencyManagement=true -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true
invoker.mavenOpts = -DallowMajorUpdates=true -DallowMinorUpdates=true -DallowIncrementalUpdates=true
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:force-releases
invoker.mavenOpts = -DprocessDependencyManagement=true
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def project = new XmlSlurper()
.parse( new File( basedir, 'pom.xml' ) )
def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )

assert project.dependencyManagement.dependencies.'*'.size() == 1
assert project.dependencyManagement.dependencies.dependency.version == '1.0.0'

0 comments on commit 95000ce

Please sign in to comment.