插件执行不被生命周期配置所覆盖 [英] Plugin execution not covered by lifecycle configuration

查看:126
本文介绍了插件执行不被生命周期配置所覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,我正在尝试添加JAXB2插件和依赖关系,以从xsd生成xml文件。当我添加下面的依赖关系时,会在标记下抛出一个错误: -



生命周期配置未涵盖的插件执行:org.jvnet.jaxb2.maven2:maven-jaxb2-plugin :0.7.4:generate(execution:default,phase:generate-sources)



错误在jaxb2插件的标签上标记。我添加了这个标签参考互联网上的解决方案,但没有任何效果。



我的pom.xml如下所示: -

 < build> 
< finalName> PatternsWebapp< / finalName>

< defaultGoal> install< / defaultGoal>

< pluginManagement>
< plugins>
<! - 此插件的配置用于仅存储Eclipse m2e设置
。它对Maven构建本身没有影响。 - >
< plugin>
< groupId> org.eclipse.m2e< / groupId>
< artifactId>生命周期映射< / 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>
<执行>
< execution>
< goals>
< goal>生成< / 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>


解决方案

这应该用 maven-jaxb2-plugin 0.8.1和m2e 1.1。


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>

解决方案

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

这篇关于插件执行不被生命周期配置所覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆