0

I am importing a project which works and built fine through "mvn clean install" and old eclipse Kepler. I am now importing the project to eclipse Luna/Mars, and got the following errors:

Plugin execution not covered by lifecycle configuration: net.alchim31.maven:scala-maven-plugin:3.2.1:compile (execution: scala-compile, phase: process-resources)

After read some articles, I added the following to my pom.xml (the parent pom.xml) of a few modules:

<pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>net.alchim31.maven</groupId>
                                    <artifactId>scala-maven-plugin</artifactId>
                                    <version>3.2.1</version>
                                    <goals>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>

Then I got a new error on the pom.xml for all child modules:

Cannot parse lifecycle mapping metadata for maven project MavenProject:myProject

What additional settings I need to do to get rid of this error? Thank you!

Edamame
  • 23,718
  • 73
  • 186
  • 320
  • are you using same maven runtime in eclipse or different? Please check in `Window->Preferences->Maven->Installations` and also check for `User Settings`. – bsingh Sep 23 '15 at 18:02
  • My user settings point to settings.xml, but I don't have a settings.xml under .m2 folder. Would this be the problem? – Edamame Sep 23 '15 at 21:09
  • Please change it to `\conf\settings.xml` to see if it works. – bsingh Sep 24 '15 at 04:08
  • my \conf\settings.xml is pretty empty (a lot of commented default settings). Is there anything I should put in the settings.xml? – Edamame Sep 24 '15 at 14:28
  • you don't need to change anything if `mvn clean install` works fine. I was just trying to make sure that `eclipse maven` & `mvn` are working with same settings. Last thing i would ask you to check if .m2 repo is same or different for `eclipse` & `mvn`. – bsingh Sep 24 '15 at 14:32
  • .m2 repo is the same place. Thx. – Edamame Sep 24 '15 at 15:14

1 Answers1

1

I got things to work by doing the following:

In Eclipse -> Preference -> Maven -> Discovery -> Open Catalog -> Install Takari Lifecycle support

Edamame
  • 23,718
  • 73
  • 186
  • 320