Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plugin execution not covered by lifecycle configuration

I am newbiee to maven. I am trying to add JAXB2 plugin and dependencies to generate xml files from xsd. When I add underneath dependencies then a error is thrown under markers:-

Plugin execution not covered by lifecycle configuration: org.jvnet.jaxb2.maven2: maven-jaxb2-plugin:0.7.4:generate(execution: default, phase: generate-sources)

The error is marked over tag in jaxb2 plugin. I added this tag in reference to solutions over internet, but nothing works.

My pom.xml looks like this:-

 <build>
    <finalName>PatternsWebapp</finalName>

    <defaultGoal>install</defaultGoal>

    <pluginManagement>
        <plugins>
            <!--  This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. --> 
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.appfuse.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-warpath-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.1.0,)
                                    </versionRange>
                                    <goals>
                                        <goal>add-classes</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                  <execution></execution>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>



    <plugins>
  <plugin>
            <groupId>org.jvnet.jaxb2.maven2</groupId>
            <artifactId>maven-jaxb2-plugin</artifactId>
            <version>0.7.4</version>
            <executions>
                <execution>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <verbose>true</verbose>
                <schemaDirectory>src/main/resources</schemaDirectory>
                <generatePackage>com.webapp.xml</generatePackage>
            </configuration>
        </plugin>

    <plugin>
                <inherited>true</inherited>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>


    </plugins>


  </build>
like image 664
Dhruv Avatar asked Mar 23 '12 17:03

Dhruv


People also ask

How to solve Maven project build lifecycle mapping problem?

Just go to Window->Preferences->Maven->Errors/Warnings and change the warning level for the last element "Plugin execution not covered by lifecycle configuration" to either warning or ignore. What whay do you recommend to run a module when using eclipse+debugging?

What is mean by plugins in Maven?

Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model (POM).

What is plugin management in Maven?

From Maven documentation: pluginManagement: is an element that is seen along side plugins. Plugin Management contains plugin elements in much the same way, except that rather than configuring plugin information for this particular project build, it is intended to configure project builds that inherit from this one.


1 Answers

This should be resolved with maven-jaxb2-plugin 0.8.1 and m2e 1.1.

like image 124
lexicore Avatar answered Sep 23 '22 17:09

lexicore