简体   繁体   中英

Plugin execution not covered by lifecycle configuration in Pom.xml OpenHAB

I am trying to build OpenHAB open source project using eclipse. But getting below error in pom.xml

I am not aware of Maven build system, for now just trying to compile and build OpenHAB.

Plugin execution not covered by lifecycle configuration: org.apache.karaf.tooling:karaf-maven-plugin: 4.0.3:features-generate-descriptor (execution: default-features-generate-descriptor, phase: compile)

Here is he pom.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.openhab</groupId>
        <artifactId>features</artifactId>
        <version>1.9.0-SNAPSHOT</version>
    </parent>

    <groupId>org.openhab.addons</groupId>
    <artifactId>openhab-addons</artifactId>
    <packaging>feature</packaging>

    <name>openHAB Feature Addons</name>
    <description>openHAB Addons</description>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>openhab-addons-external</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins> <!-- SHOWING ERROR HERE -->
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <startLevel>80</startLevel>
                    <aggregateFeatures>true</aggregateFeatures>
                    <!--  <resolver>(obr)</resolver> -->
                    <checkDependencyChange>true</checkDependencyChange>
                    <failOnDependencyChange>false</failOnDependencyChange>
                    <logDependencyChanges>true</logDependencyChanges>
                    <overwriteChangedDependencies>true</overwriteChangedDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

parent pom.xml file:

<?xml version="1.0" encoding="MACROMAN"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <parent>
    <groupId>org.openhab</groupId>
    <artifactId>openhab</artifactId>
    <version>1.9.0-SNAPSHOT</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <groupId>org.openhab</groupId>
  <artifactId>features</artifactId>

  <name>openHAB Features</name>

  <packaging>pom</packaging>

    <properties>
        <ohc.version>2.0.0.a4</ohc.version>
        <esh.version>0.8.0.b2</esh.version>
        <shk.version>1.2</shk.version>
        <karaf.version>4.0.3</karaf.version>
        <build.helper.maven.plugin.version>1.9.1</build.helper.maven.plugin.version>
    </properties>

  <modules>
    <module>openhab-addons</module>
    <module>openhab-addons-external</module>
    <module>openhab-addons-verify</module>
  </modules>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>${karaf.version}</version>
                    <extensions>true</extensions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>${build.helper.maven.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <repositories>
        <repository>
            <id>jcenter</id>
            <name>JCenter Repository</name>
            <url>https://jcenter.bintray.com/</url>
        </repository>
        <repository>
            <id>shk-bintray</id>
            <name>Bintray Repository for shk</name>
            <url>https://dl.bintray.com/maggu2810/maven</url>
        </repository>
        <repository>
            <id>eclipse-snapshots</id>
            <name>Eclipse Snapshot Repository</name>
            <layout>default</layout>
            <url>https://repo.eclipse.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>eclipse-releases</id>
            <name>Eclipse Release Repository</name>
            <layout>default</layout>
            <url>https://repo.eclipse.org/content/repositories/releases/</url>
        </repository>
        <repository>
            <id>jfrog</id>
            <name>JFrog OSS Repository</name>
            <url>http://oss.jfrog.org/libs-snapshot/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>


</project>

This is just a problem inside your eclipse. The message "Plugin execution not covered by lifecycle configuration" simply means, that eclipse doesn't know about the "org.apache.karaf.tooling:karaf-maven-plugin" plugin that is used inside your pom.

Solution: Do a right-click on the parent project in eclipse an select "Run As" ==> "Run as maven build...", enter "clean package" into the "goal" field an hit "Run" to build the project (Build-Artifact will then appear in the "target" directory).

Default solution to define via pluginManagement something like this:

<pluginManagement>
  <plugins>
    <plugin>
     <groupId>org.eclipse.m2e</groupId>
     <artifactId>lifecycle-mapping</artifactId>
     <version>1.0.0</version>
     <configuration>
       <lifecycleMappingMetadata>
         <pluginExecutions>
           <pluginExecution>
             <pluginExecutionFilter>
               <groupId>some-group-id</groupId>
               <artifactId>some-artifact-id</artifactId>
               <versionRange>[1.0.0,)</versionRange>
               <goals>
                 <goal>some-goal</goal>
               </goals>
             </pluginExecutionFilter>
             <action>
               <ignore/>
             </action>
           </pluginExecution>
         </pluginExecutions>
       </lifecycleMappingMetadata>
     </configuration>
    </plugin>
  </plugins>
</pluginManagement>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM