Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No marketplace entries found to handle jacoco-maven-plugin

When I try to import a maven project into eclispe juno I am getting the following error.jacoco maven error in eclipse.

I have the following lines in my pom.xml.

 </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.6.3.201306030806</version>
        <configuration>
          <destfile>${basedir}/target/jacoco/jacoco.exec</destfile>
          <datafile>${basedir}/target/jacoco/jacoco.exec</datafile>
        </configuration>
        <executions>
          <execution>
            <id>jacoco-initialize</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site</id>
            <phase>package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

Why is maven giving this error? Any idea.

like image 439
liv2hak Avatar asked Aug 25 '13 06:08

liv2hak


2 Answers

The m2e plugin reports the error, because it can not find a m2e plugin that can handle the jacoco-maven-pluign configuration and execution within eclipse.

Thus the build on the command line via maven might lead to other results than the eclipse build.

You are using the jacoco-maven-plugin and I don't think it is necessarry to install a m2e plugin for jacoco.

You can either try to find a jacoco m2e adapter update site and install it or you move the jacoco-maven-plugin into a profile and only activate it when you need it.

EDIT

You can also tell the eclipse m2e plugin to ignore the jacoco-maven-plugin configuration. Add the follwing plugin configuration to the pluginManagement

<pluginManagement>
    <plugins>
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                 <groupId>org.jacoco</groupId>
                                <artifactId>jacoco-maven-plugin</artifactId>
                                <versionRange>[0.0.0,)</versionRange>
                                <goals>
                                    <goal>prepare-agent</goal>
                                    <goal>report</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

This should work too.

You will find more information in the m2e documentation

like image 76
René Link Avatar answered Sep 18 '22 12:09

René Link


Install EclEmma plugin from the marketplace and reload projects

like image 42
Damian Avatar answered Sep 19 '22 12:09

Damian