Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile)

The easiest way to setup custom lifecycle mapping is to use "ignore"
quickfix, then change action to whatever you need. See attached working
example.

Btw, maxmem is ignored is ignored when fork=false.

--
Regards,
Igor

On 11-11-09 4:17 AM, Guillaume Polet wrote:
Hi Igor,

I have added the explicit lifecyclemapping to the root parent pom.xml
but I still get errors.
The pom.xml is as follows:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${compiler.source}</source>
<target>${compiler.target}</target>
<encoding>${source.encoding}</encoding>
<fork>false</fork>
<maxmem>1024</maxmem>
<compilerId>jdt</compilerId>
<lifecycleMappingMetadata>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<parameters>
<compilerId>jdt</compilerId>
</parameters>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.eclipse.m2e.jdt.javaConfigurator</id>
</configurator>
</action>
</pluginExecution>
</lifecycleMappingMetadata>
</configuration>
<dependencies>
<dependency>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>0.13.0</version>
</dependency>
</dependencies>
</plugin>

If you need the whole pom, it can be found here:
https://github.com/agilebirds/openflexo/blob/master/pom.xml
I tried to look on m2e website to find more info, but weirdly the
recommended way is the less documented one.

Cheers,
Guillaume

Le 2/11/2011 11:15, Igor Fedorenko a écrit :
Out of the box, m2e only supports maven compiler plugin with
compilerId=javac. To make it work for other compilers, compilerId=jdt in
your specific case, you need to add this explicit lifecycle mapping
configuration in your (parent) pom.xml


<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<parameters>
<compilerId>jdt</compilerId>
</parameters>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.eclipse.m2e.jdt.javaConfigurator</id>
</configurator>
</action>
</pluginExecution>



Please see [1] for more information about lifecycle mapping
configuration and syntax.

[1] http://wiki.eclipse.org/M2E_plugin_execution_not_covered

--
Regards,
Igor

On 11-11-02 10:30 AM, Guillaume Polet wrote:
Hi List,

I know I am not the first to ask this question, but I want to make sure
I understand correctly the error I am seeing in Eclipse with m2e 1.0.100
on all my Maven projects.

So I have a large multi-module Maven project and almost all of them show
me an error with the message "/Plugin execution not covered by lifecycle
configuration:
org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution:
default-compile,
phase: compile)/", and the same thing for testCompile.
I have recently modified the compiler used by m-c-p to use this one
(since the one from Oracle lamely crashes while compiling):
<groupId>org.sonatype.tycho</groupId>
<artifactId>tycho-compiler-jdt</artifactId>
<version>0.11.1</version>

So, my understanding is that M2E puts an error on my pom.xml (and
therefore my project) because it does not handle directly this
configuration of the maven-compiler? Is this correct?
If yes, is not it a bit strong to put an error on this while we know
that the eclipse compiler will do the job anyway? I was quite frustrated
to see that now all my projects are marked as in error while they all
work.

I can definitely not tell other developers that they first have to
select all 66 projects and go on them one by one to indicate that M2E
can safely ignore this. Could not this be simply a warning instead of an
error?

Or am I just not understanding something on the way M2E and Eclipse work
together?

Thanks in advance,

Guillaume


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users
_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users

_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>test</groupId>
  <artifactId>compiler-id-jdt</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <compilerId>jdt</compilerId>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.eclipse.tycho</groupId>
              <artifactId>tycho-compiler-jdt</artifactId>
              <version>0.13.0</version>
            </dependency>
          </dependencies>
        </plugin>

        <!--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.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <versionRange>[2.0,)</versionRange>
                    <goals>
                      <goal>compile</goal>
                      <goal>testCompile</goal>
                    </goals>
                    <parameters>
                      <compilerId>jdt</compilerId>
                    </parameters>
                  </pluginExecutionFilter>
                  <action>
                    <configurator>
                      <id>org.eclipse.m2e.jdt.javaConfigurator</id>
                    </configurator>
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>

Back to the top