Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Multiple execution filters in lifecycle mapping XML

Hi All

Recently, the maven plugin my m2e connector relies on changed its name (from maven-android-plugin to android-maven-plugin so as to satisfy the enforced protect of "maven-*-plug-ins"[1]).

We'd like to be able to support both the old and new names in our m2e connector so as to maintain backward compatibility. However, we're getting issues putting more than one plugin execution filter in our lifecycle mapping metadata. At the moment we have this:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>android-maven-plugin</artifactId>
				<versionRange>[2.0.0,4.0.0)</versionRange>
				<goals>
					<goal>generate-sources</goal>
					<goal>unpack</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<configurator>
<id>me.gladwell.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator</id>
				</configurator>
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>

We'd like to have something like this:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>android-maven-plugin</artifactId>
				<versionRange>[2.0.0,4.0.0)</versionRange>
				<goals>
					<goal>generate-sources</goal>
					<goal>unpack</goal>
				</goals>
			</pluginExecutionFilter>
			<pluginExecutionFilter>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>maven-android-plugin</artifactId>
				<versionRange>[2.0.0,4.0.0)</versionRange>
				<goals>
					<goal>generate-sources</goal>
					<goal>unpack</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<configurator>
<id>me.gladwell.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator</id>
				</configurator>
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>

Or:

<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
	<pluginExecutions>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>android-maven-plugin</artifactId>
				<versionRange>[2.0.0,4.0.0)</versionRange>
				<goals>
					<goal>generate-sources</goal>
					<goal>unpack</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<configurator>
<id>me.gladwell.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator</id>
				</configurator>
			</action>
		</pluginExecution>
		<pluginExecution>
			<pluginExecutionFilter>
				<groupId>com.jayway.maven.plugins.android.generation2</groupId>
				<artifactId>maven-android-plugin</artifactId>
				<versionRange>[2.0.0,4.0.0)</versionRange>
				<goals>
					<goal>generate-sources</goal>
					<goal>unpack</goal>
				</goals>
			</pluginExecutionFilter>
			<action>
				<configurator>
<id>me.gladwell.eclipse.m2e.android.androidDevelopmentToolsProjectConfigurator</id>
				</configurator>
			</action>
		</pluginExecution>
	</pluginExecutions>
</lifecycleMappingMetadata>

But neither seems to work. Is this a bug? Is there some way to route more than one lifecycle mapping to the same configurator?


[1] http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/AbstractGeneratorMojo.java?r1=1125604&r2=1125603&pathrev=1125604&diff_format=u

--
Ricardo Gladwell <ricardo.gladwell@xxxxxxxxx>
http://www.google.com/profiles/ricardo.gladwell
Twitter: @rgladwell - MSN: axonrg@xxxxxxxxx


Back to the top