简体   繁体   中英

maven-scala-plugin giving pom file error

I'm testing java code using scala and maven. The maven-scala-plugin is returning a pom file error in Eclipse. Here is my pom snippet :

        <plugin>
            <groupId>org.scala-tools</groupId>
            <artifactId>maven-scala-plugin</artifactId>
            <version>2.15.2</version>
            <executions>
                <execution>
                    <id>scala-test-compile</id>
                    <phase>test-compile</phase>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

This is the error :

Plugin execution not covered by lifecycle configuration: org.scala-tools:maven-scala-plugin:2.15.2:testCompile 
 (execution: scala-test-compile, phase: test-compile)

Have I configured the pom correctly ?

The scala tests are running correctly, in that they are all passing. Perhaps this is a Maven bug ?

When I view maven properties for the project the lifecycle mappings are not available : 在此输入图像描述

You should instal m2eclipse-connector from this update site: http://alchim31.free.fr/m2e-scala/update-site

Check this documentation:

http://scala-ide.org/docs/tutorials/m2eclipse/index.html

No, this is not a Maven bug. This page describes why the message is shown and how to deal with it.

After pressing Ctrl+1 over the problem Eclipse should suggest two quick fixes:

  1. Discover new m2e connectors. Try this first, if it finds a connector restart Eclipse and rebuild the project, the problem should go away.

  2. Permanently mark goal as ignored. It will add some code in pom.xml which means the goal won't be run on builds within Eclipse, only from command line. You can also replace <ignore> in the added part with <execute> to run the goal in Eclipse as well.

在eclipse中安装m2e插件(Maven Integration for Scala IDE)后,它运行良好。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM