alfonsojon
alfonsojon

Reputation: 71

Cannot compile due to M2Eclipse which doesn't find connector

There is a section in the pom.xml file that requires the Maven-Replacer-Plugin and (I believe) GitDescribe.

Here are the errors it gives me:

Plugin execution not covered by lifecycle configuration: com.lukegb.mojo:gitdescribe-maven-plugin:1.3:gitdescribe (execution: default, phase: compile)

Plugin execution not covered by lifecycle configuration: com.google.code.maven-replacer-plugin:maven-replacer-plugin:1.3.8:replace (execution: default, phase: generate-resources)

Upvotes: 4

Views: 1904

Answers (2)

Guillaume Husta
Guillaume Husta

Reputation: 4385

This error was well described in their documentation.

This feature was added in M2Eclipse 1.0 (now m2e). It caused much trouble, like reported in this blog post.

One solution was to pollute the pom.xml with data about the plugin lifecycle mapping metadata, but it was not very satisfying.

In m2e 1.1, plugin developers could embed a file named lifecycle-mapping-metadata.xml in their plugins to make it work in Eclipse (see M2E compatible maven plugins).

Fortunately, since m2e 1.2, things have evolved and we can now configure it in Eclipse Preferences (see Eclipse workspace lifecycle mapping metadata).

Upvotes: 1

majinnaibu
majinnaibu

Reputation: 3050

This message comes up because m2e doesn't know what to do at this phase. The build should work with command line maven, but m2e wants you to specify whether you want it to run the plugin or not.

The fix depends on what you want to happen. You can either have eclipse ignore the plugin or execute it as part of the build.

The documentation explains it in further detail here, but I'm copying the easy answer below. https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

This changes the pom to add some eclipse metadata. If you're just trying to get it to build this will work.

HINT: Use quick fix to create “ignore” mapping, then replace action with . M2Eclipse 1.3 and newer assume safer runOnIncremental=false by default. It is recommended to always specific desired runOnIncremental value explicitly in lifecycle mapping configuration.

You can also change your preferences in newer eclipse/m2e versions. It's the other quick fix option. You can change this one under Project Properties->Maven->Lifecycle Mapping.

Upvotes: 1

Related Questions