Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Plugin execution not covered" error after fixing an "'build.plugins.plugin.version' is missing" warning for the tycho-packaging-plugin

I use tycho-packaging-plugin to set the output folder for the jar. Here is shortened version of my pom:

<properties>
    <tycho-version>0.21.0</tycho-version>
</properties>
<build>
  <plugins>
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-maven-plugin</artifactId>
        <version>${tycho-version}</version>
        <extensions>true</extensions>
    </plugin>
    <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-packaging-plugin</artifactId>
        <configuration>
            <buildDirectory>${project.build.directory}/plugins</buildDirectory>
        </configuration>
    </plugin>
  </plugins>
</build>

I get a warning if I execute maven-install:

[WARNING] Some problems were encountered while building the effective model for com.foo.bar.devtool:com.foo.bar.devtool:eclipse-plugin:0.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.eclipse.tycho:tycho-packaging-plugin is missing. @ line 44, column 21
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

I follow the advice of the warning and modify the pom:

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-packaging-plugin</artifactId>
    <version>${tycho-version}</version>
    <configuration>
        <buildDirectory>${project.build.directory}/plugins</buildDirectory>
    </configuration>
</plugin>

And then I get errors after saving the file:

Multiple annotations found at this line:
    - Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:build-qualifier (execution: default-build-qualifier, phase: 
     validate)
    - Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:validate-version (execution: default-validate-version, 
     phase: validate)
    - Plugin execution not covered by lifecycle configuration: org.eclipse.tycho:tycho-packaging-plugin:${tycho.version}:validate-id (execution: default-validate-id, phase: validate)

How to resolve the issue and to avoid getting both warnings and errors?

like image 986
Danny Lo Avatar asked Oct 07 '14 07:10

Danny Lo


People also ask

How do I fix the Eclipse build error when running a plugin?

Use quick-fix on the error in pom.xml and select Permanently mark goal run in pom.xml as ignored in Eclipse build - this will generate the required boilerplate code for you. To instruct Eclipse to run your plugin during build - just replace the <ignore/> tag with <execute/> tag in the generated configuration:

How do I fix Maven errors in Visual Studio Code?

Window > Preferences > Maven > Errors/Warnings > Plugin execution not covered by life-cycle configuration. Select Ignore / Warning / Error as your wish. Then. Right click the project click Maven and update the project then error will gone.

How to avoid plugin exceptions in Eclipse?

So, in order to avoid the exceptions in Eclipse, one needs to simply enclose all the plugin tags inside a <pluginManagement> tag, like so: Once this structure is in place, the error goes away. Show activity on this post.

How to fix “above parameters changes according to the plugin?

Note: Above parameters changes according to the plugin, for which it throws this error ? Another way is to add this particular plugin to “ Lifecycle Mapping ” of Maven Finally click “ Reload workspace lifecycle mappings metadata ” to take effect of new changes in the working environment


1 Answers

You don't have the Tycho Project Configorator for m2e installed, so m2e doesn't know if it should execute the listed goals as part of the incremental build in Eclipse.

To install the connectors, trigger the quick fix of the errors (e.g. from the Problems view) and select Discover new m2e connectors.

like image 86
oberlies Avatar answered Sep 22 '22 17:09

oberlies