13

Update: moved the solution to an answer

Eclipse Juno SR1 installs m2e plugin version 1.2. The m2e connecter buildhelper provided by the Eclipse marketplace is not compatible with this version of the m2e plugin. I've been looking through various mailinglists, but I cannot find a location where to find an updated buildhelper.

The following error occurs when trying to install the m2e connector buildhelper:

Operation details
Cannot complete the install because of a conflicting dependency.
Software being installed: m2e connector for build-helper-maven-plugin 0.15.0.201109282249 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109282249)
Software currently installed: m2e - Maven Integration for Eclipse 1.2.0.20120903-1050     (org.eclipse.m2e.feature.feature.group 1.2.0.20120903-1050)
Only one of the following can be installed at once: 
    Maven Integration for Eclipse JDT 1.2.0.20120903-1050 (org.eclipse.m2e.jdt 1.2.0.20120903-1050)
    Maven Integration for Eclipse JDT 1.1.0.20120530-0009 (org.eclipse.m2e.jdt 1.1.0.20120530-0009)
Cannot satisfy dependency:
    From: m2e - Maven Integration for Eclipse 1.2.0.20120903-1050 (org.eclipse.m2e.feature.feature.group 1.2.0.20120903-1050)
    To: org.eclipse.m2e.jdt [1.2.0.20120903-1050]
Cannot satisfy dependency:
    From: m2e connector for build-helper-maven-plugin 0.15.0.201109282249 (org.sonatype.m2e.buildhelper 0.15.0.201109282249)
    To: bundle org.eclipse.m2e.jdt [1.1.0,1.2.0)
Cannot satisfy dependency:
    From: m2e connector for build-helper-maven-plugin 0.15.0.201109282249 (org.sonatype.m2e.buildhelper.feature.feature.group 0.15.0.201109282249)
    To: org.sonatype.m2e.buildhelper [0.15.0.201109282249]

In our pom files we use buildhelper to add directories with generated sources to the Eclipse:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <version>1.5</version>
    <executions>
      <!-- Fix this eclipse error by discovering the plugin in the marketplace -->
        <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
                <goal>add-source</goal>
            </goals>
            <configuration>
                <sources>
                        <source>${project.build.directory}/generated-sources/cxf</source>
                </sources>
            </configuration>
        </execution>
    </executions>
</plugin>
Denis
  • 471
  • 3
  • 13
  • 1
    Thanks for this. You should add your solution as an answer and accept it. – artbristol Oct 02 '12 at 09:09
  • 3
    You should put your solution into an answer and mark the question as answered so it is obvious that the problem was solved. – FrVaBe Oct 02 '12 at 09:09
  • Thanks for the comments. I moved the solution to the answer below. I need to wait two days before I can mark my own answer as the solution. – Denis Oct 02 '12 at 10:39
  • Here, adding the lifecycle mapping directly to the pom helped to solve the issue. See http://stackoverflow.com/a/20249944/873282. – koppor Nov 28 '13 at 08:18

1 Answers1

23

The comment in the pom suggested to use the Eclipse marketplace to install the buildhelper:

<!-- Fix this eclipse error by discovering the plugin in the marketplace -->

This will not do, because the buildhelper version in the Eclipse marketplace is outdated.

Instead of using the Eclipse Marketplace, I installed the buildhelper directly from the Sonatype repository using the Eclipse install new software menu option. The Sonatype repository with the (currently) latest version is here: https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.15.0/N/0.15.0.201206251206/

This fixed my problem.

Denis
  • 471
  • 3
  • 13