M2Eclipse & Plugin execution not covered by lifecycle configuration

I was recently forced to update my Eclipse installation to version 3.7 (Indigo). After opening some old projects, I got the following error message:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.5:add-source (execution: add-source, phase: generate-sources) ... Maven Project Build Lifecycle Mapping Problem

The “build-helper-maven-plugin” simply adds a second source folder:

<plugin>
	<groupId>org.codehaus.mojo</groupId>
	<artifactId>build-helper-maven-plugin</artifactId>
	<version>1.5</version>
	<executions>
		<execution>
			<id>add-source</id>
			<phase>generate-sources</phase>
			<goals>
				<goal>add-source</goal>
			</goals>
			<configuration>
				<sources>
					<source>${basedir}/src-gen/main/java</source>
				</sources>
			</configuration>
		</execution>
	</executions>
</plugin>

However, with Indigo and M2Eclipse, the source folder was no longer added, and I got compile errors all over the place…

It took me some time to figure out the right solution:
Just install the “M2Extras / buildhelper” plugin!

You can download it here (Eclipse Update Site):
https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.14.0/N/0.14.0.201109282148/
(The exact directory may vary depending on you exact Eclipse version and the latest available M2Extras release)

Advertisements

One thought on “M2Eclipse & Plugin execution not covered by lifecycle configuration

  1. Argh…thank you. I was a bit confused since I already had installed this extra-plugin and it didn’t work anyway. But I only had referenced my directory like ‘desc’ not like ‘${basedir}/desc’. After I tried that, it worked (after maven:update project configuration)!
    Curious: I manually deleted the source folder from the eclipse build path and updated the maven project configuration – and the folder was taken as source folder all the same. Even without ‘${basedir}’.
    Whatever – I left it like ‘${basedir}/desc’ and it works, thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s