Fresh Eclipse / optaplanner 7.12 examples “new pro

2019-06-09 02:24发布

问题:

With a fresh install of Eclipse 4.9.0 (2018-09), and m2e installed in Eclipse, I downloaded Optaplanner release 7.12.0, extracted the zip, and followed the first steps of the documentation instructions toward building the examples ("Open the file examples/sources/pom.xml as a new project, the maven integration will take care of the rest.") via: 1) File / Open Projects from File System... / Show other specialized import wizards / Maven / Existing Maven Projects 2) Selected the optaplanner-distribution-7.12.0.Final / examples / sources as the root directory (pom.xml for 7.12.0.final appeared as expected as a selectable project)

However, when selecting the pom and clicking Finish, an error occurs:

Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-antrun-plugin:1.8:run (execution: create-default-i18n-resource, phase: process-resources)

This appears to be related to the ancestor pom org.kie:kie-parent:7.12.0.Final.pom which has

<plugin>
    <artifactId>maven-antrun-plugin</artifactId>
    <executions>
      <execution>
        <!-- Temporary workaround for https://issues.jboss.org/browse/ERRAI-1101. Needs to stay here until
        we find a general solution (e.g. moving all localized code to Errai TranslationService. -->
        <id>create-default-i18n-resource</id>
        <phase>process-resources</phase>
        <configuration>
          <target>
            <copy todir="${project.build.directory}/classes"
                  includeemptydirs="false" failonerror="false" quiet="true">
                <fileset dir="${project.build.directory}/classes"/>
                <globmapper from="*Constants.properties" to="*Constants_default.properties"/>
            </copy>
          </target>
        </configuration>
        <goals>
          <goal>run</goal>
        </goals>
      </execution>
    </executions>
</plugin>

However, I do not know how to resolve the error as "discover m2e connectors" reports "No marketplace entries".

My goal is to extend an example to create a reproduce-able example of an issue reported with Optaplanner. As this first step is an out of the box build of a recent release, I'm thinking it should work - what am I missing please?

回答1:

This is a "feature" (deficiency?) of the M2Eclipse plugin. In the latest version of m2e, Antrun plugin can be ignored using lifecycle mapping stored in the Eclipse workspace. To do that, open the Problems tab, right-click the maven-antrun-plugin execution error and select Quick Fix. Then select "Mark goal run as ignored in eclipse preferences" and click Finish. The error will disappear and it's possible to work with the project.

Following video illustrates the process: https://youtu.be/TVRAtMx2XyE.