Hi Anders,

> I reported this Codehaus parent issue a long time ago (HAUS-2245 [1]).

Good to know...

Unfortunately the codehaus-parent seems to be in a unmaintained state.

Who is responsible for the codehaus-parent ? Can we (or i) take the issue and fix it ?


/Anders

[1] http://jira.codehaus.org/i#browse/HAUS-2245


On Wed, Feb 12, 2014 at 9:07 PM, Karl Heinz Marbaise <khmarba...@gmx.de>wrote:

Hi,
i have a question. The following situation. Pom file which uses the
following parent:

     <parent>
         <groupId>org.codehaus</groupId>
         <artifactId>codehaus-parent</artifactId>
         <version>4</version>
     </parent>

     <prerequisites>
       <maven>${mavenVersion}</maven>
     </prerequisites>

and the following part in my pom file:

     <build>
         <pluginManagement>
             <plugins>
                 <plugin>
                     <groupId>org.apache.maven.plugins</groupId>
                     <artifactId>maven-enforcer-plugin</artifactId>
                     <version>1.3.1</version>
                 </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-enforcer-plugin</artifactId>
               <executions>
                 <execution>
                   <id>enforce-maven</id>
                   <goals>
           ... The rule does not matter..


So if i call (Maven 2.2.1)

mvn clean package I got the following error:

[INFO] [clean:clean {execution: default-clean}]
[INFO] ------------------------------------------------------------
------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------
------------
[INFO] Failed to configure plugin parameters for: org.apache.maven.plugins:
maven-enforcer-plugin:1.0

Cause: Class 'org.apache.maven.enforcer.rule.api.EnforcerRule' cannot be
instantiated

So if i call with Maven 3.0.5:

[ERROR] Failed to execute goal org.apache.maven.plugins:
maven-enforcer-plugin:1.0:enforce (enforce-maven) on project
test-enforcer: Unable to parse configuration of mojo
org.apache.maven.plugins:maven-enforcer-plugin:1.0:enforce for parameter
requireSameVersions: Abstract class or interface 
'org.apache.maven.enforcer.rule.api.EnforcerRule'
cannot be instantiated -> [Help 1]

Maven 3.1.X and Maven 3.2.X tested as well...

So this looks to me that the pluginManagement does not overwrite the
version 1.0 which is defined in the codehaus-parent. To be honest the
codehaus-parent does not define it via pluginManagement it just uses the
following:

<build>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-enforcer-plugin</artifactId>
                 <version>1.0</version>
                 <executions>
                     <execution>
                         <id>enforce-maven</id>
                         <goals>
                             <goal>enforce</goal>
                         </goals>
                         <configuration>
                             <rules>
                                 <requireMavenVersion>

<version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                                     <message>Maven 2.1.0 and 2.2.0 produce
incorrect GPG signatures and checksums respectively.</message>
                                 </requireMavenVersion>
                             </rules>
                         </configuration>
                     </execution>
                 </executions>
             </plugin>
         </plugins>


First the codehaus-parent seemed to be wrong...so i can't overwrite the
version of the plugin by using a pluginManagement block in inherited
project which forces me to define the version explicitly in my pom in the
build block to get that working like this:

         <plugins>
             <plugin>
               <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-enforcer-plugin</artifactId>
               <version>1.3.1</version>
               <executions>


WDYT ? Bug ? Right behaviour ?


Kind regards
Karl-Heinz Marbaise


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org





Mit freundlichem Gruß
Karl-Heinz Marbaise
--
SoftwareEntwicklung Beratung Schulung    Tel.: +49 (0) 2405 / 415 893
Dipl.Ing.(FH) Karl-Heinz Marbaise        ICQ#: 135949029
Hauptstrasse 177                         USt.IdNr: DE191347579
52146 Würselen                           http://www.soebes.de

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to