[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2e-dev] Lifecycle Mapping / Secondary Configurator issue
|
I am not sure what the problem is.
m2e-tycho maps all executions of tycho-compiler-plugin regardless of
compilerId. Another mapping for the same plugin will conflict with
m2e-tycho because m2e won't be able to choose between the two mappings.
Observed behaviour is expected and correct, as far as I can tell.
The most straightforward solution would be to map tycho-compiler-plugin
to specific compilerId in m2e-tycho, but I have not decided how I feel
about it yet.
I am not convinced secondary mapping for <ignore> makes much sense.
--
Regards,
Igor
On 12-08-27 11:24 AM, Fred Bricon wrote:
Hi,
I've been trying to create, for fun, an archetype generating eclipse
plugins written in groovy, built with Tycho
(https://github.com/open-archetypes/groovy-eclipse-plugin-archetype) *
Groovy compiler support is added via :
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.7.0-01</version>
</dependency>
</dependencies>
</plugin>
It works fine so far in command line builds. For the IDE, I'm using a
combination of the Groovy/Grails Tool Suite, m2e and m2eclipse-tycho.
I noticed the Groovy Nature is not added to the generated core project,
so I looked at the lifecycle-mapping-metadata.xml in
org.codehaus.groovy.m2eclipse configurator and tried to add a new
lifecycle mapping (LM) entry (similar to
https://github.com/jbosstools/m2e-jdt-compiler/blob/master/org.jboss.tools.m2e.jdt.core/lifecycle-mapping-metadata.xml )
:
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<versionRange>[0.14.0,)</versionRange>
<parameters>
<compilerId>groovy-eclipse-compiler</compilerId>
</parameters>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<configurator>
<id>org.codehaus.groovy.m2eclipse.configurator</id>
</configurator>
</action>
</pluginExecution>
But turns out, m2e doesn't like it and I face a "Conflicting lifecycle
mapping error" accompanied by the dreaded "plugin execution not
covered", when testing that LM :
Conflicting lifecycle mapping (plugin execution
"org.eclipse.tycho:tycho-compiler-plugin:0.15.0:compile (execution:
default-compile, phase: compile)"). To enable full functionality, remove
the conflicting mapping and run Maven->Update Project Configuration.
Actually m2eclipse-tycho defines the following pluginExecution
<https://github.com/sonatype/m2eclipse-tycho/blob/2b5646abdec9c248db2e54b16f8f1e5e7e87037f/org.sonatype.tycho.m2e/lifecycle-mapping-metadata.xml#L106>
for tycho-compiler-plugin :
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<versionRange>[0.12.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
Actual tycho-compiler-plugin settings are handled via
<lifecycleMappingId>org.sonatype.tycho.m2e.tychoLifecycleMapping</lifecycleMappingId>
The real issue is there's no notion of secondary lifecycleMapping we
could extend and there's no way to use a secondary configurator for a
principal pluginExecution mapping using <ignore> (or <execute>). The
lifecycle mapping part of m2e being a bit sensible, I'd like to hear
some advice before I start breaking things.
Until a proper solution is implemented in m2e core, I was thinking
m2eclipse-tycho could be modified to use an IgnoreConfigurator, that
could then have a secondary configurator defined
in org.codehaus.groovy.m2eclipse.
Ideas anyone?
Regards,
Fred Bricon
* Before you ask, I like Groovy a lot, but I suck at it, never really
had a chance to actually do something more meaningful than a hello world
example, so don't pay attention to the 'groovy' code in the archetype.
Feel free to fork the it and enhance it at your will :-P
--
"Have you tried turning it off and on again" - The IT Crowd
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev