Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] lifecycle mapping for compilerId

Hey!

I have a question about a problem that I observed and I hope someone can shed some light on this.
We have the groovy-eclipse compiler and can configure this in the pom.xml file for the maven-compiler-plugin like this:

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<compilerId>groovy-eclipse-compiler</compilerId>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-compiler</artifactId>
						<version>2.8.0-01</version>
					</dependency>
					<dependency>
						<groupId>org.codehaus.groovy</groupId>
						<artifactId>groovy-eclipse-batch</artifactId>
						<version>2.1.8-01</version>
					</dependency>
				</dependencies>
			</plugin>

We also have a project configurator plugin that deals with this and defines a lifecycle mapping for this like:

<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>groovy-eclipse-compiler</compilerId>
				</parameters>
			</pluginExecutionFilter>
			<action>
				<configurator>
					<id>org.codehaus.groovy.m2eclipse.configurator</id>
				</configurator>
			</action>
		</pluginExecution>

Nevertheless this mapping isn’t taken into account. Importing the project into Eclipse causes an error (the log complains about a duplicated lifecycle mapping or something like that). It seems to me that the lifecycle mapping from the configurator plugin is not taken into account at all for this compilerId configuration.

I can solve this by adding the lifecycle mapping information to the project itself, but I would like to avoid that. That is why I have the m2e connector plugin that defines the lifecycle mapping.

Does anyone know what is going wrong here?

Thanks a lot for your help!
-Martin

Back to the top