Maven 2.x Rar Plugin

CLONE -No MAR packaging (Causes Maven-cobertura-plugin to fail)

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch Submitted:
    Yes
  • Number of attachments :
    0

Description

For a project with packaging "rar" the codehaus maven plugin for Cobertura does not work.
During instrumentation the following message is displayed:

"Not executing cobertura:instrument as the project is not a Java classpath-capable package"

The reason for this is that in the CoberturaInstrumentMojo.execute() the code checks which language that the artifact is implemented in, like this:
ArtifactHandler artifactHandler = project.getArtifact().getArtifactHandler();
if ( !"java".equals( artifactHandler.getLanguage() ) )

{ getLog().info( "Not executing cobertura:instrument as the project is not a Java classpath-capable package" ); }

Looking at the components.xml in the Maven sources, we find that the "rar" packaging is not specified at all, meaning that it will be handled with the DefaultArtifactHandler and all properties set to null, including the language property.
This can be fixed with the following addition to components.xml:

<components>
....
<component>
<role>org.apache.maven.artifact.handler.ArtifactHandler</role>
<role-hint>rar</role-hint>
<implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
<configuration>
<type>rar</type>
<extension>rar</extension>
<includesDependencies>true</includesDependencies>
<language>java</language>
<addedToClasspath>false</addedToClasspath>
</configuration>
</component>
...
</components>

Issue Links

Activity

Hide
Marcel Ammerlaan added a comment -

While the original bug for RAR has been fixed the same problem exists for MAR files that can be created using the axis2-mar-maven-plugin. The original fix (to change maven) works for core plugins but not for every generic package type.

Show
Marcel Ammerlaan added a comment - While the original bug for RAR has been fixed the same problem exists for MAR files that can be created using the axis2-mar-maven-plugin. The original fix (to change maven) works for core plugins but not for every generic package type.
Hide
Stephane Nicoll added a comment -

Sorry Herve, wrong issue

Show
Stephane Nicoll added a comment - Sorry Herve, wrong issue

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: