-
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.
Fix detection of plugin updates requiring newer Maven for building th…
…an for running (#527) Separate minimal Maven version detection for projects from requirements of plugins This closes #526
- Loading branch information
Showing
8 changed files
with
202 additions
and
629 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
1 change: 1 addition & 0 deletions
1
src/it/it-display-plugin-updates-010-issue-526/invoker.properties
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 @@ | ||
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:display-plugin-updates |
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,45 @@ | ||
<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-101</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>display-plugin-updates</name> | ||
<description>IT for https://github.com/mojohaus/versions-maven-plugin/issues/526</description> | ||
|
||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
<version>1.0</version> | ||
</plugin><!-- defines older compatible Maven runtime compatibility than build compatibility --> | ||
</plugins> | ||
</pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<executions> | ||
<execution> | ||
<id>enforce-maven</id> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<requireMavenVersion> | ||
<version>3.3.9</version> | ||
</requireMavenVersion> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
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,33 @@ | ||
import java.io.*; | ||
import org.codehaus.plexus.util.FileUtils; | ||
import java.util.regex.*; | ||
|
||
try | ||
{ | ||
File file = new File( basedir, "build.log" ); | ||
String buf = FileUtils.fileRead( file ); | ||
|
||
Pattern p1 = Pattern.compile( "\\QNo plugins require a newer version of Maven than specified by the pom.\\E" ); | ||
Matcher m1 = p1.matcher( buf.toString() ); | ||
Pattern p2 = Pattern.compile( "\\Qlocalhost:dummy-maven-plugin\\E\\s*\\.*\\s*\\Q1.0 -> 3.1\\E" ); | ||
Matcher m2 = p2.matcher( buf.toString() ); | ||
if ( !m1.find() ) | ||
{ | ||
System.out.println( "Did not correctly detect minimum Maven build version 3.0 of this project" ); | ||
return false; | ||
} | ||
if ( !m2.find() ) | ||
{ | ||
System.out.println( "Did not suggest updating dummy-maven-plugin to version 3.1" ); | ||
return false; | ||
} | ||
System.out.println( m1.group( 0 ) ); | ||
System.out.println( m2.group( 0 ) ); | ||
} | ||
catch( Throwable t ) | ||
{ | ||
t.printStackTrace(); | ||
return false; | ||
} | ||
|
||
return true; |
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.