Community
Participate
Working Groups
When using the M2E plugin the POM is marked with an error: Plugin execution not covered by lifecycle configuration: org.eclipse.xtend2:xtend-maven-plugin:2.2.0:compile (execution: default, phase: generate-sources) See this for details: http://wiki.eclipse.org/M2E_plugin_execution_not_covered Some additional work on the plugin is required to avoid additional configuration in the POM, see: http://wiki.eclipse.org/M2E_Extension_Development To resolve the error marker in the POM this can be added as workaround: <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.eclipse.xtend2 </groupId> <artifactId> xtend-maven-plugin </artifactId> <versionRange> [2.2.0,) </versionRange> <goals> <goal>compile</goal> <goal>testCompile</goal> </goals> </pluginExecutionFilter> <action> <ignore></ignore> </action> </pluginExecution> </pluginExecutions> </lifecycleMappingMetadata> </configuration> </plugin> </plugins> </pluginManagement>
To reproduce: - install M2E plugin from Indigo update site - use project from here: https://github.com/kthoms/xtext-experimental/tree/bug366118
There is a plugin and feature for this, have a look at the update site. Please reopen if this doesn't work for you.
This seems to refer to the feature Xtend M2E Extensions org.eclipse.xtext.xtend2.m2e.feature.group in the http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/ updatesite
The extension should not just ignore the xtend plugin. If I understand correctly, it should provide a build participant that refreshes the workspace after generation and a project configurator that adds the generated source as eclipse classpath. I have just recently implemented this for the fornax oaw maven plugin. If you are not already working on this, I could provide a patch for the xtend-maven-plugin in git. Is the fornax oaw maven plugin in git, or do I have to send an SVN patch for it, and to whom should I send it? Best regards, Dietrich
It's a no-op implementation, since the IDE (i.e. Xtend builder) takes care of everything.
(In reply to comment #5) > It's a no-op implementation, since the IDE (i.e. Xtend builder) takes care of > everything. Does it also add the folder containing the generated sources? There is always the possibility to use build-helper, but the maven project can configure itself correctly without that, if the project configurator is added. Another point might be adding the XText nature for a maven project with xtext dependency. Does such an m2e extension make sense from your point of view? If so, I'll take a look. Best regards, Dietrich
It does everything that should be done, because it should work nicely for non-Maven users too.
+1 for this
> Is the fornax oaw maven plugin in git, or do I have to send an SVN patch for > it, and to whom should I send it? The Fornax plugin is hosted in the Fornax project at SourceForge. https://fornax.svn.sourceforge.net/svnroot/fornax/trunk/toolsupport/maven2/fornax-toolsupport-oaw-m2-plugin/trunk/ I am in charge of this plugin, and am planning a 3.4.0 release. This lifecycle mapping could be a valuable addition. You can send patches to me.
Can we please re-open this bug? IMHO, the "Xtend M2E Extensions" should at least, upon an "Maven/Update Project", add an "org.eclipse.xtext.ui.shared.xtextNature" to the respective project whenever m2e discovers the xtend-maven-plugin being used in the build. Moreover, they should also configure the (per-project) Xtend Compiler output directory such that it matches the value of outputDirectory as found in the POM's plugin configuration (this will be difficult, though, until Bug 409759 is fixed). Currently, using "Import/Maven/Existing Maven projects" just doesn't work if I the xtend-maven-plugin in my build -- unless I check in the Eclipse-specific .project and .setting files in addition to the generic pom.xml.
(In reply to comment #10) > Can we please re-open this bug? Sure :-) > IMHO, the "Xtend M2E Extensions" should at > least, upon an "Maven/Update Project", add an > "org.eclipse.xtext.ui.shared.xtextNature" to the respective project whenever > m2e discovers the xtend-maven-plugin being used in the build. Maven doesn't need the nature and the IDE will add it as soon as it needs it. > > Moreover, they should also configure the (per-project) Xtend Compiler output > directory such that it matches the value of outputDirectory as found in the > POM's plugin configuration (this will be difficult, though, until Bug 409759 > is fixed). Yes, that sounds reasonable. Note that you can already refer to the xtend project settings form within the maven plugin. So basically the otherway around. > > Currently, using "Import/Maven/Existing Maven projects" just doesn't work if > I the xtend-maven-plugin in my build -- unless I check in the > Eclipse-specific .project and .setting files in addition to the generic > pom.xml. Why doesn't it work? What's the problem?
>> IMHO, the "Xtend M2E Extensions" should at >> least, upon an "Maven/Update Project", add an >> "org.eclipse.xtext.ui.shared.xtextNature" to the respective project whenever >> m2e discovers the xtend-maven-plugin being used in the build. > > Maven doesn't need the nature and the IDE will add it as soon as it needs it. Assume I want to check in only Maven's pom.xml, but no IDE-specific configuration (.project, .classpath, .settings, etc.). Then an "Import / As existing Maven project" should, thanks to m2e, generate all necessary Eclipse-specific files, without me having redundant information in the SCM. Unfortunately, that doesn't *quite* work for Xtend, since "as soon as it needs it" is as soon as I open the first Xtend file in my freshly imported project. If I don't open it, the Xtend compiler never runs (as the fresh import lacks the Xtend nature), and the Java compiler spits out errors whenever there's a reference from a "Java class" to an "Xtend class" (as it hasn't been compiled yet). That's the reason why we at Eclipse Code Recommenders check in the .project files of projects that use Xtend [1]; the Xtend compiler should be aware of .xtend classes from the get go. But those projects are the only projects where we have to check in .project and friends. Other projects [2] work fine with a pom.xml alone; there, m2e takes care of deriving an appropriate .project from the pom.xml. >> Moreover, they should also configure the (per-project) Xtend Compiler output >> directory such that it matches the value of outputDirectory as found in the >> POM's plugin configuration (this will be difficult, though, until Bug 409759 >> is fixed). > > Yes, that sounds reasonable. > Note that you can already refer to the xtend project settings form within > the maven plugin. So basically the otherway around. I don't get this. Do you mean the xtend-maven-plugin reads a .settings/org.eclipse.xtend.core.Xtend.prefs? FWIW, here's our configuration of said plugin [3] at Eclipse Code Recommenders. >> Currently, using "Import/Maven/Existing Maven projects" just doesn't work if >> I the xtend-maven-plugin in my build -- unless I check in the >> Eclipse-specific .project and .setting files in addition to the generic >> pom.xml. > > Why doesn't it work? What's the problem? As describe above: no Xtend nature -> (Java) compiler errors. Hope that explains things. [1] <https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/tests/org.eclipse.recommenders.rcp.tests/.project?id=181b9d949966c1221520c09259a6579cdb2e7a37> [2] <https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/tests/org.eclipse.recommenders.jayes.tests?id=181b9d949966c1221520c09259a6579cdb2e7a37> [3] <https://git.eclipse.org/c/recommenders/org.eclipse.recommenders.git/tree/pom.xml?id=181b9d949966c1221520c09259a6579cdb2e7a37#n384>
I see. Thanks for the explanation. (In reply to comment #12) > > Note that you can already refer to the xtend project settings form within > > the maven plugin. So basically the otherway around. > > I don't get this. Do you mean the xtend-maven-plugin reads a > .settings/org.eclipse.xtend.core.Xtend.prefs? yes, you can point to it from within the maven pom.
(In reply to comment #13) >(In reply to comment #12) >>> Note that you can already refer to the xtend project settings form within >>> the maven plugin. So basically the otherway around. >> >> I don't get this. Do you mean the xtend-maven-plugin reads a >> .settings/org.eclipse.xtend.core.Xtend.prefs? > > yes, you can point to it from within the maven pom. Do you mean "point" in the sense of "there is a Maven <configuration> element for it" (I couldn't find one) or in the sense of "the xtend-maven-plugin autodetects an existing .settings/org.eclipse.xtend.core.Xtend.prefs and simply (silently?) uses that"?
(In reply to comment #14) > (In reply to comment #13) > >(In reply to comment #12) > >>> Note that you can already refer to the xtend project settings form within > >>> the maven plugin. So basically the otherway around. > >> > >> I don't get this. Do you mean the xtend-maven-plugin reads a > >> .settings/org.eclipse.xtend.core.Xtend.prefs? > > > > yes, you can point to it from within the maven pom. > > Do you mean "point" in the sense of "there is a Maven <configuration> > element for it" (I couldn't find one) or in the sense of "the > xtend-maven-plugin autodetects an existing > .settings/org.eclipse.xtend.core.Xtend.prefs and simply (silently?) uses > that"? It is in org.eclipse.xtend.maven.AbstractXtendCompilerMojo /** * Location of the Xtend settings file. * * @parameter default-value="${basedir}/.settings/org.eclipse.xtend.core.Xtend.prefs" * @readonly */ private String propertiesFileLocation; It can be set explicitly but is automatically used in case the outputDirectory hasn't been set explicitly.
This was fixed in 2.5.0
Requested via bug 522520. -M.