m2e-scala sample projects errors - Plugin execution not covered by lifecycle configuration

2,362 views
Skip to first unread message

Francois

unread,
Jul 21, 2011, 5:14:59 AM7/21/11
to scala-i...@googlegroups.com
Hello,

I tried to import m2eclipse-scala sample projects available on
https://github.com/sonatype/m2eclipse-scala/tree/master/samples in
Eclipse Indigo, with Eclipse-IDE 2.0.0-beta8, m2e
1.0.0.20110607-2117 and m2e-scala 0.3.0 installed.

When importing prj-custom-layout and prj-scala-cycle-java , I see the
dreaded "Plugin execution not covered by lifecycle configuration:
org.scala-tools:maven-scala-plugin:2.13.1:add-source (execution:
scala-compile-first, phase: process-resources)"

Adding the following in the pom.xml <build> section remove the error
message, but I understood that it was not what is expected:


<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<versionRange>[0.1,)</versionRange>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.maven.ide.eclipse.scala</id>
</configurator>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>

Hope it helps,

--
Francois ARMAND
http://fanf42.blogspot.com
http://www.normation.com

David Bernard

unread,
Jul 21, 2011, 7:36:24 AM7/21/11
to scala-i...@googlegroups.com
Thanks for info, wiki page and time take to report.

Christoffer Sawicki

unread,
Jul 25, 2011, 8:28:05 AM7/25/11
to scala-i...@googlegroups.com
Given that the sample pom.xml is broken, what's the proper way to do mixed Java/Scala projects with m2eclipse-scala currently?

sentimen...@gmail.com

unread,
Jul 25, 2011, 8:46:26 AM7/25/11
to Christoffer Sawicki, scala-i...@googlegroups.com
On Mon, 25 Jul 2011 05:28:05 -0700 (PDT), Christoffer Sawicki <christoff...@gmail.com> wrote:
> Given that the sample pom.xml is broken, what's the proper way to do mixed
> Java/Scala projects with m2eclipse-scala currently?

One project for Scala, one project for Java. Forget mixed Scala/Java in a
single project unless you want to lose a couple of months of developer time.

Bryan

Francois

unread,
Jul 25, 2011, 8:49:53 AM7/25/11
to scala-i...@googlegroups.com, Christoffer Sawicki
On 25/07/2011 14:28, Christoffer Sawicki wrote:
Given that the sample pom.xml is broken, what's the proper way to do mixed Java/Scala projects with m2eclipse-scala currently?



Just adding the
<pluginManagement> from my other mail made it work for us. We do have a mixed Java/Scala project, and all seems OK.

Christoffer Sawicki

unread,
Jul 25, 2011, 10:20:47 AM7/25/11
to scala-i...@googlegroups.com

Bryan, thanks for your clear answer (and stopping me while I had only
wasted a few hours). :)

I'll follow your advice and wait for things to shake up with Scala IDE
before trying again.

David Bernard

unread,
Jul 26, 2011, 4:26:03 PM7/26/11
to scala-i...@googlegroups.com
Hi,

I deployed version 0.3.1 of m2eclipse-scala that should avoid the "workaround of pollute" you pom.xml with <lifecycleMappingMetadata>.
I also update the sample project to use scala 2.9.0-1 and maven-scala-plugin 2.15.2.
To test, I setup a similar eclipse : an Indigo with ScalaIDE 2.0.0beta9 (my first install of serie 2.x.x ;-) ), the latest m2e

I successfully install samples, included mixed Java/Scala sample, but sometimes I need to call "Maven > Update Project Configuration..." after import.

/davidB

Francois Armand

unread,
Jul 26, 2011, 5:28:34 PM7/26/11
to scala-i...@googlegroups.com
Le 26/07/2011 22:26, David Bernard a écrit :
> Hi,
>
> I deployed version 0.3.1 of m2eclipse-scala that should avoid the
> "workaround of pollute" you pom.xml with <lifecycleMappingMetadata>.
> I also update the sample project to use scala 2.9.0-1 and
> maven-scala-plugin 2.15.2.
> To test, I setup a similar eclipse : an Indigo with ScalaIDE 2.0.0beta9
> (my first install of serie 2.x.x ;-) ), the latest m2e
>
> I successfully install samples, included mixed Java/Scala sample, but
> sometimes I need to call "Maven > Update Project Configuration..." after
> import.


Thanks David, I will test that in a near future. And I'm quite happy
that you found some time to work again on all that stuff of yours, I'm
daily grateful for all of it.

Thanks,

--
Francois Armand
http://fanf42.blogspot.com

Fernando Racca

unread,
Jul 24, 2012, 9:04:06 AM7/24/12
to scala-i...@googlegroups.com
I had the same issue with the following pom.xml, which Eclipse's m2e patched as you can see, to prevent the issue. the maven project builds just fine with the scala tests. Is there any better way?

  <build>

        <plugins>
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>org.scala-tools</groupId>
                                    <artifactId>maven-scala-plugin</artifactId>
                                    <versionRange>[1.0.0,)</versionRange>
                                    <goals>
                                        <goal>compile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />

                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
            <plugin>

                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <executions>
                    <execution>
                        <id>scala-compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile</id>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Test.class</include>
                        <include>**/*Spec.class</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->

                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.scala-tools
                                        </groupId>
                                        <artifactId>
                                            maven-scala-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.15.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>testCompile</goal>
                                            <goal>compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>

                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
   </build>

    <reporting>
        <plugins>
            <plugin>

                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
Reply all
Reply to author
Forward
0 new messages