Skip to content

Commit

Permalink
Correct message if the latest version of parent is used for update-pa…
Browse files Browse the repository at this point in the history
…rent

Displaying "No versions found" can be confusing
  • Loading branch information
slawekjaranowski committed Aug 25, 2023
1 parent 220c4ef commit 0b0fdf8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:update-parent
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<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-parent4</artifactId>
<version>70</version>
</parent>

<groupId>localhsot</groupId>
<artifactId>issue-670</artifactId>
<version>0.31-SNAPSHOT</version>
<packaging>pom</packaging>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

import groovy.xml.XmlSlurper

def project = new XmlSlurper().parse( new File( basedir, 'pom.xml' ) )
assert project.parent.version == '70'


def buildLog = new File( basedir, "build.log")

assert buildLog.text.contains( '[INFO] The parent project is the latest version')
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,12 @@ protected ArtifactVersion resolveTargetVersion(String initialVersion)
}
}

getLog().info("No versions found");
if (versions.isEmpty(allowSnapshots)) {
getLog().info("No versions found");
} else {
getLog().info("The parent project is the latest version");
}

return null;
}

Expand Down

0 comments on commit 0b0fdf8

Please sign in to comment.