生命周期配置未涵盖插件执行

时间:2012-03-23 17:07:19

标签: eclipse maven jaxb maven-plugin m2eclipse

我是maven的新手。我试图添加JAXB2插件和依赖项来从xsd生成xml文件。当我在依赖项下添加时,标记下会抛出错误: -

生命周期配置未涵盖插件执行:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.4:generate(执行:默认,阶段:生成源)

错误标记在jaxb2插件中的标记上。我在网上引用了解决方案时添加了这个标签,但没有任何效果。

我的pom.xml如下所示: -

 <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>

1 个答案:

答案 0 :(得分:13)

这应该通过maven-jaxb2-plugin 0.8.1和m2e 1.1来解决。