You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Andrew Hughes (JIRA)" <ji...@codehaus.org> on 2010/05/07 07:06:12 UTC
[jira] Created: (MENFORCER-99) Can't enforce Maven < 3.0.0-SNAPSHOT
Can't enforce Maven < 3.0.0-SNAPSHOT
------------------------------------
Key: MENFORCER-99
URL: http://jira.codehaus.org/browse/MENFORCER-99
Project: Maven 2.x Enforcer Plugin
Issue Type: Bug
Affects Versions: 1.0-beta-1
Environment: Maven 3.0.0-SNAPSHOT
Reporter: Andrew Hughes
I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
Configuration:
{noformat}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-versions</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<!-- Allow Maven 2.2.1 but not 3 -->
<version>[2.2.1,2.9.9]</version>
</requireMavenVersion>
<requireJavaVersion>
<!-- Use the latest JDK, 1.6.0-18+ -->
<version>[1.6.0-18,)</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
{noformat}
The problem is that the enforcerplugin doesn't seem to pickup the rules
{noformat}
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
... 14 more
[ERROR]
{noformat}
Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (MENFORCER-99) Can't enforce Maven < 3.0.0-SNAPSHOT
Posted by "Andrew Hughes (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-99?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Hughes closed MENFORCER-99.
----------------------------------
Resolution: Not A Bug
Right you are!!! My apologies... I needed to move the <configuration> out from the <execution> and directly under the <plugin>. Maybe the doco on the website could be altered so others don't make the same mistake I did. :)
> Can't enforce Maven < 3.0.0-SNAPSHOT
> ------------------------------------
>
> Key: MENFORCER-99
> URL: http://jira.codehaus.org/browse/MENFORCER-99
> Project: Maven 2.x Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 1.0-beta-1
> Environment: Maven 3.0.0-SNAPSHOT
> Reporter: Andrew Hughes
> Assignee: Benjamin Bentmann
>
> I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
> Configuration:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireMavenVersion>
> <!-- Allow Maven 2.2.1 but not 3 -->
> <version>[2.2.1,2.9.9]</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <!-- Use the latest JDK, 1.6.0-18+ -->
> <version>[1.6.0-18,)</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {noformat}
> The problem is that the enforcerplugin doesn't seem to pickup the rules
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
> ... 14 more
> [ERROR]
> {noformat}
> Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (MENFORCER-99) Can't enforce Maven < 3.0.0-SNAPSHOT
Posted by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-99?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Bentmann closed MENFORCER-99.
--------------------------------------
Resolution: Not A Bug
Assignee: Benjamin Bentmann
>From [Guide to Configuring Plug-ins|http://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_executions_Tag]:
bq. Note: Configurations inside the <executions> tag differ from those that are outside <executions> in that they cannot be used from a direct command line invocation. Instead they are only applied when the lifecycle phase they are bound to are invoked.
You need to move the configuration to the plugin-level if you want it to take effect for "mvn enforcer:enforce".
> Can't enforce Maven < 3.0.0-SNAPSHOT
> ------------------------------------
>
> Key: MENFORCER-99
> URL: http://jira.codehaus.org/browse/MENFORCER-99
> Project: Maven 2.x Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 1.0-beta-1
> Environment: Maven 3.0.0-SNAPSHOT
> Reporter: Andrew Hughes
> Assignee: Benjamin Bentmann
>
> I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
> Configuration:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireMavenVersion>
> <!-- Allow Maven 2.2.1 but not 3 -->
> <version>[2.2.1,2.9.9]</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <!-- Use the latest JDK, 1.6.0-18+ -->
> <version>[1.6.0-18,)</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {noformat}
> The problem is that the enforcerplugin doesn't seem to pickup the rules
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
> ... 14 more
> [ERROR]
> {noformat}
> Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (MENFORCER-99) Can't enforce Maven < 3.0.0-SNAPSHOT
Posted by "Andrew Hughes (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-99?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Hughes updated MENFORCER-99:
-----------------------------------
Attachment: MSITE-477.rar
To reproduce, run 'mvn clean install site site:stage-deploy -DstagingSiteURL=file://c:/Temp/MSITE-477'. Then look at the links to the modules on file://c:/Temp/MSITE-477/index.html under the 'Modules' section. Requires maven 2.2.1 and jdk 1.6.0_18+ (I am using 1.6.0_18).
> Can't enforce Maven < 3.0.0-SNAPSHOT
> ------------------------------------
>
> Key: MENFORCER-99
> URL: http://jira.codehaus.org/browse/MENFORCER-99
> Project: Maven 2.x Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 1.0-beta-1
> Environment: Maven 3.0.0-SNAPSHOT
> Reporter: Andrew Hughes
> Assignee: Benjamin Bentmann
> Attachments: MSITE-477.rar
>
>
> I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
> Configuration:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireMavenVersion>
> <!-- Allow Maven 2.2.1 but not 3 -->
> <version>[2.2.1,2.9.9]</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <!-- Use the latest JDK, 1.6.0-18+ -->
> <version>[1.6.0-18,)</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {noformat}
> The problem is that the enforcerplugin doesn't seem to pickup the rules
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
> ... 14 more
> [ERROR]
> {noformat}
> Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Reopened: (MENFORCER-99) Can't enforce Maven <
3.0.0-SNAPSHOT
Posted by "Andrew Hughes (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-99?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrew Hughes reopened MENFORCER-99:
------------------------------------
Sorry about reopening this :'( I have this in the <project><build><plugin> section... my pom.xml has the same configuration from the plugin doco http://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html . Where is this supposed to be if it's not here?
> Can't enforce Maven < 3.0.0-SNAPSHOT
> ------------------------------------
>
> Key: MENFORCER-99
> URL: http://jira.codehaus.org/browse/MENFORCER-99
> Project: Maven 2.x Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 1.0-beta-1
> Environment: Maven 3.0.0-SNAPSHOT
> Reporter: Andrew Hughes
> Assignee: Benjamin Bentmann
>
> I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
> Configuration:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireMavenVersion>
> <!-- Allow Maven 2.2.1 but not 3 -->
> <version>[2.2.1,2.9.9]</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <!-- Use the latest JDK, 1.6.0-18+ -->
> <version>[1.6.0-18,)</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {noformat}
> The problem is that the enforcerplugin doesn't seem to pickup the rules
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
> ... 14 more
> [ERROR]
> {noformat}
> Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Commented: (MENFORCER-99) Can't enforce Maven <
3.0.0-SNAPSHOT
Posted by "Andrew Hughes (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MENFORCER-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=220743#action_220743 ]
Andrew Hughes commented on MENFORCER-99:
----------------------------------------
Ahhhh wrong jira issue page!!! sorry!!!!
> Can't enforce Maven < 3.0.0-SNAPSHOT
> ------------------------------------
>
> Key: MENFORCER-99
> URL: http://jira.codehaus.org/browse/MENFORCER-99
> Project: Maven 2.x Enforcer Plugin
> Issue Type: Bug
> Affects Versions: 1.0-beta-1
> Environment: Maven 3.0.0-SNAPSHOT
> Reporter: Andrew Hughes
> Assignee: Benjamin Bentmann
> Attachments: MSITE-477.rar
>
>
> I am trying to stop people using maven 3.0.0-SNAPSHOT. This occur's frequently because m2eclipse's embedded version is 3.0.0-SNAPSHOT.
> Configuration:
> {noformat}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-enforcer-plugin</artifactId>
> <executions>
> <execution>
> <id>enforce-versions</id>
> <goals>
> <goal>enforce</goal>
> </goals>
> <configuration>
> <rules>
> <requireMavenVersion>
> <!-- Allow Maven 2.2.1 but not 3 -->
> <version>[2.2.1,2.9.9]</version>
> </requireMavenVersion>
> <requireJavaVersion>
> <!-- Use the latest JDK, 1.6.0-18+ -->
> <version>[1.6.0-18,)</version>
> </requireJavaVersion>
> </rules>
> </configuration>
> </execution>
> </executions>
> </plugin>
> {noformat}
> The problem is that the enforcerplugin doesn't seem to pickup the rules
> {noformat}
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution. -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.0-beta-1:enforce (default-cli) on project cl2-parent: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104)
> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:423)
> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:158)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:123)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
> Caused by: org.apache.maven.plugin.MojoExecutionException: No rules are configured. Use the skip flag if you want to disable execution.
> at org.apache.maven.plugins.enforcer.EnforceMojo.execute(EnforceMojo.java:225)
> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562)
> ... 14 more
> [ERROR]
> {noformat}
> Also, this doesn't appear to be bound to any lifecycle. So it only runs with 'enforcer:enforce' and not 'install', 'compile' e.t.c.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira