4

When I import the maven project into my ecliplse-luna I faced an error in the pom.xml

Plugin execution not covered by lifecycle configuration: org.apache.portals.pluto:maven-pluto-plugin:2.1.0-M3:assemble (execution: default, phase: 
 generate-resources)

so I have included <Pluginmanagement> tag in the pom.xml and it resolved the error. When I run mvn clean package/install, build was failed due to the below error (relative path \pluto-resources\web.xml is created by maven-pluto-plugin)

on project MyFirstPortlet: The specified web.xml file 'D:\PORTLET-SAMPLES\MyFirstPortlet\target\pluto-resources\web.xml' does not exist

I removed <Pluginmanagement> tag from the pom.xml and run the maven build now the maven build is successful.

The issue is, if <Pluginmanagement> tag present in the pom.xml eclipse project import doesnot throw any error but maven build is failed. if <Pluginmanagement> is not present then maven build is successful but eclipse project import is failed.

my pom.xml

<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.helloworld</groupId>
    <artifactId>MyFirstPortlet</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>MyFirstPortlet Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>
        <dependency>
            <groupId>org.apache.portals</groupId>
            <artifactId>portlet-api_2.0_spec</artifactId>
            <version>1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <!-- bind 'pluto2:assemble' goal to 'process-resources' lifecycle -->
                <!-- This plugin will read your portlet.xml and web.xml and injects required 
                    lines -->
                <plugin>
                    <groupId>org.apache.portals.pluto</groupId>
                    <artifactId>maven-pluto-plugin</artifactId>
                    <version>2.1.0-M3</version>
                    <executions>
                        <execution>
                            <phase>generate-resources</phase>
                            <goals>
                                <goal>assemble</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- configure maven-war-plugin to use updated web.xml -->
                <!-- This plugin will make sure your WAR will contain the updated web.xml -->
                <plugin>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <webXml>${project.build.directory}/pluto-resources/web.xml</webXml>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <finalName>MyFirstPortlet</finalName>
    </build>
</project>

Can any one advise me why adding pluginmanagement causes build failure and how to resolve plugin execution not covered by lifecycle error in eclipse with out the pluginmanagement tag.

PrabaharanKathiresan
  • 1,099
  • 2
  • 17
  • 32

0 Answers0