Skip to content

Commit

Permalink
Fixing mojohaus#755
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmoniuk committed Oct 13, 2022
1 parent 8a21578 commit bbfc8c0
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:dependency-updates-report
invoker.mavenOpts = -DdependencyUpdatesReportFormats=xml
16 changes: 16 additions & 0 deletions src/it/it-dependency-updates-report-issue-755/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<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>dummy-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>

<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.0</version>
</dependency>
</dependencies>

</project>
5 changes: 5 additions & 0 deletions src/it/it-dependency-updates-report-issue-755/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
report = new File( basedir, "target/dependency-updates-report.xml" ).text.replaceAll( '\\s*', '' )

assert report.contains( '<incremental>1.0.1</incremental>' )
assert report.contains( '<minor>1.1</minor>' )
assert report.contains( '<major>2.0</major>' )
2 changes: 2 additions & 0 deletions src/it/it-plugin-updates-report-issue-755/invoker.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:plugin-updates-report
invoker.mavenOpts = -DpluginUpdatesReportFormats=xml
18 changes: 18 additions & 0 deletions src/it/it-plugin-updates-report-issue-755/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<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>dummy-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>

<build>
<plugins>
<plugin>
<groupId>localhost</groupId>
<artifactId>dummy-maven-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</build>

</project>
5 changes: 5 additions & 0 deletions src/it/it-plugin-updates-report-issue-755/verify.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
report = new File( basedir, "target/plugin-updates-report.xml" ).text.replaceAll( '\\s*', '' )

assert report.contains( '<major>3.0.0</major>' )
assert report.contains( '<minor>2.3</minor>' )
assert report.contains( '<incremental>2.2.2</incremental>' )
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ private static String getVersionsInScopeBlock( ArtifactVersions av, Optional<Seg
{
sBuilder.append( TAB ).append( TAB ).append( TAB ).append( TAB )
.append( wrapElement( version.toString(),
scope.toString().toLowerCase() ) ).append( NL );
scope.map( s -> s.toString().toLowerCase() ).orElse( "any" ) ) )
.append( NL );
}
sBuilder.append( TAB ).append( TAB ).append( TAB ).append( OPEN_CLOSING_TAG ).append( versionsTag )
.append( CLOSE_TAG ).append( NL );
Expand Down

0 comments on commit bbfc8c0

Please sign in to comment.