[MPLUGIN-319] renamed parameter, improved documentation, and removed readonly

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1778722 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2017-01-14 05:01:35 +00:00
parent e598cdfd30
commit e430efe682
1 changed files with 9 additions and 7 deletions

View File

@ -197,14 +197,16 @@ public class PluginReport
private RuntimeInformation rtInfo; private RuntimeInformation rtInfo;
/** /**
* <code>META-INF/maven/plugin.xml</code> should be used only with Maven-3.4.0+ to get accurate * Maven version range where <code>META-INF/maven/plugin.xml</code> should be used to get plugin info:
* <code>since</code> (MNG-6109). * when running with a Maven version not in the range, plugin info is extracted directly from plugin source.
* Reading <code>META-INF/maven/plugin.xml</code> gives accurate <code>since</code> only with Maven-3.4.0+
* (see MNG-6109).
* For cases where missing <code>since</code> info is not an issue, this version range spec can be changed * For cases where missing <code>since</code> info is not an issue, this version range spec can be changed
* to avoid parsing code once again. (notice: should not mark readonly = true in this case...) * to avoid extracting info from plugin source once again.
* @since 3.5.1 * @since 3.5.1
*/ */
@Parameter( defaultValue = "(3.3.9,)", readonly = true ) @Parameter( defaultValue = "(3.3.9,)" )
private String pluginXmlSpec; private String usePluginXmlMavenVersionRange;
/** /**
* {@inheritDoc} * {@inheritDoc}
@ -348,7 +350,7 @@ public class PluginReport
/** /**
* Check if META-INF/maven/plugin.xml should be used (as expected initially) or not (because of Maven * Check if META-INF/maven/plugin.xml should be used (as expected initially) or not (because of Maven
* MNG-6109 bug that won't give accurate since info when reading plugin.xml). * MNG-6109 bug that won't give accurate since info when reading plugin.xml).
* @return true if runing Maven version is in configured pluginXmlSpec range * @return true if runing Maven version is in configured usePluginXmlMavenVersionRange range
* @see https://issues.apache.org/jira/browse/MNG-6109 * @see https://issues.apache.org/jira/browse/MNG-6109
* @see https://issues.apache.org/jira/browse/MPLUGIN-319 * @see https://issues.apache.org/jira/browse/MPLUGIN-319
*/ */
@ -356,7 +358,7 @@ public class PluginReport
{ {
try try
{ {
VersionRange versionRange = VersionRange.createFromVersionSpec( pluginXmlSpec ); VersionRange versionRange = VersionRange.createFromVersionSpec( usePluginXmlMavenVersionRange );
return versionRange.containsVersion( rtInfo.getApplicationVersion() ); return versionRange.containsVersion( rtInfo.getApplicationVersion() );
} }
catch ( InvalidVersionSpecificationException e ) catch ( InvalidVersionSpecificationException e )