Uploaded image for project: 'Maven RAR Plugin'
  1. Maven RAR Plugin
  2. MRAR-17

No RAR packaging (Causes Maven-cobertura-plugin to fail)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.3
    • None
    • None
    • Patch

    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>

      Attachments

        Issue Links

          Activity

            People

              hboutemy Herve Boutemy
              pliljenberg@gmail.com Peter Liljenberg
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: