![]() |
|
|
|
|
Change By:
|
Mirko Friedenhagen
(13/May/13 2:46 PM)
|
|
Description:
|
<p>
The
{{
<tt>
requirePropertyDiverges
}}
</tt>
enforcer rule from
_extra
<em>extra
-enforcer-
rules_
rules</em>
fails with a
{{
<tt>
NullPointerException
}}
</tt>
if the rule configuration is placed in an
{{
<tt>
execution
}}
</tt>
section.
</p>
<
h5
.
><a name="Exampleforafailingconfiguration"></a>
Example for a failing configuration
{noformat}
<
plugin
/h5
>
<
groupId
div class="preformatted panel" style="border-width: 1px;"
>
<div class="preformattedContent panelContent"> <pre> <plugin> <groupId>
org.apache.maven.plugins
<
<
/groupId
> <
> <
artifactId
>
>
maven-enforcer-plugin
<
<
/artifactId
> <
> <
version
>
>
1.2
<
<
/version
> <
> <
dependencies
> <
> <
dependency
> <
> <
groupId
>
>
org.codehaus.mojo
<
<
/groupId
> <
> <
artifactId
>
>
extra-enforcer-rules
<
<
/artifactId
> <
> <
version
>
>
1.0-alpha-4
<
<
/version
> <
> <
/dependency
> <
> <
/dependencies
> <
> <
executions
> <
> <
execution
> <
> <
id
>
>
enforce-property-diverges
<
<
/id
> <
> <
goals
> <
> <
goal
>
>
enforce
<
<
/goal
> <
> <
/goals
> <
> <
configuration
> <
> <
rules
> <
> <
requirePropertyDiverges
> <
> <
property
>
>
project.url
<
<
/property
> <
> <
regex
>
>
http://company/wiki/company-parent-pom/.*
<
<
/regex
> <
> <
/requirePropertyDiverges
> <
> <
/rules
> <
> <
/configuration
> <
> <
/execution
> </executions> </plugin> </pre
>
</
executions
div
>
</
plugin
div
>
{noformat}
<
h5
.
><a name="Stacktrace"></a>
Stack trace
{noformat}
</h5>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent"> <pre>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (enforce-general-project-rules) on project example-project: Execution enforce-general-project-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed. NullPointerException -
>
>
[Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce (enforce-general-project-rules) on project example-project: Execution enforce-general-project-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
[...snip...]
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution enforce-general-project-rules of goal org.apache.maven.plugins:maven-enforcer-plugin:1.2:enforce failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:110)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NullPointerException
at org.apache.maven.plugins.enforcer.RequirePropertyDiverges.checkAgainstParentValue(RequirePropertyDiverges.java:110)
at org.apache.maven.plugins.enforcer.RequirePropertyDiverges.execute(RequirePropertyDiverges.java:87)
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:178)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
{noformat}
</pre> </div></div>
<
h5
.
><a name="
Patch
"></a>Patch</h5>
<p>
The rule code fails to find the parent POM which contains the rule configuration (
{{
<tt>
RequirePropertyDiverges.findDefiningParent
}}
</tt>
). The attached patch fixes this by including the configuration elements of all executions in
{{
<tt>
RequirePropertyDiverges.getRuleConfigurations
}}
</tt>
.
</p>
|
|
Fix Version/s:
|
extra-enforcer-rules-1.0-alpha-5
|
|
Remaining Estimate:
|
0 minutes
|
|
Original Estimate:
|
0 minutes
|
|
|
|
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
|
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email