简体   繁体   English

Datanucleus Maven插件

[英]Datanucleus Maven Plugin

How to fix this issue with Eclipse maven project: 如何使用Eclipse Maven项目解决此问题:

Plugin execution not covered by lifecycle configuration: org.datanucleus:maven-datanucleus-plugin:3.1.0-m3:enhance (execution: default, phase: compile) pom.xml /DatanucleusJPA line 218 Maven Project Build Lifecycle Mapping Problem 生命周期配置未涵盖插件执行:org.datanucleus:maven-datanucleus-plugin:3.1.0-m3:enhance(执行:默认,阶段:编译)pom.xml / DatanucleusJPA第218行Maven项目构建生命周期映射问题

Is this fixable with the Eclipse M2 Eclipse plugin? 这可以使用Eclipse M2 Eclipse插件修复吗?

Preface: 前言:

I suppose this is nothing Datanucleus specific at all, but a feature of Eclipse Maven plugin instead. 我想这根本不是Datanucleus所特有的,而是Eclipse Maven插件功能 All that you have tried, apparently works if running on command line (Linux) or Cygwin [1] (Windows). 您尝试过的所有方法显然都可以在命令行 (Linux)或Cygwin [1] (Windows)上运行。 The issue here is that Eclipse m2 plugin needs some more info for working properly and make its tricks and that is where the question lies and that's why you asked. 这里的问题是Eclipse m2插件需要更多信息才能正常工作并发挥作用,这就是问题所在,这就是为什么您要问这个问题。

Possible solutions: 可能的解决方案:

Like pointed already in comments, every detail can be found from the given link to [2] M2E site, and the essentials appear in one answer to one question [3] about the same issue. 就像评论中已经指出的那样,可以从指向[2] M2E站点的给定链接中找到每个细节,并且要点出现在对同一问题的一个问题[3]的一个答案中。 I take this snippet from one of it's answers: 我从其中一个答案中摘录了这段代码:

<action>
    <execute />
</action>

These lines should be fine, added inside the last element inside your <plugin-executions> element on your project pom.xml . 这些行应该没事,添加到项目pom.xml <plugin-executions>元素内的最后一个元素内。 I am not magician, I can only use Google, so without code / pom content given in question I suggest you have followed Datanucleus own instructions [4] and had there something like: 我不是魔术师,我只能使用Google,因此如果没有给出问题的代码/ pom内容,我建议您遵循Datanucleus自己的说明[4] ,并执行以下操作:

<plugins>
    <plugin>
        <groupId>org.datanucleus</groupId>
        <artifactId>maven-datanucleus-plugin</artifactId>
        <version>3.1.0-m3</version>
        <configuration>
            <log4jConfiguration>${basedir}/log4j.properties</log4jConfiguration>
            <verbose>true</verbose>
        </configuration>
        <executions>
            <execution>
                <phase>process-classes</phase>
                <goals>
                    <goal>enhance</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
</plugins>

..and well, there it is only <executions> , but place it there. ..好吧,这里只有<executions> ,但要放在这里。

Sidenote: 边注:

Funny though, while using Google for searching what would be the issue, that question was already voted up by me and there my answer of choice was different, looking like this: 有趣的是,在使用Google搜索问题时,该问题已经由我投票决定,因此我选择的答案有所不同,如下所示:

<build>
    <pluginManagement>
        <plugins>
             <plugin> ... </plugin>
             <plugin> ... </plugin>
              ....
         </plugins>
    </pluginManagement>
</build>

..the trick being to add that <pluginmanagement> part to the xml. ..诀窍是将<pluginmanagement>部分添加到xml中。 I just remember to have taken a fresh copy of my projects from SVN and after that I did not use that trick anymore. 我只是记得从SVN那里复制了我的项目的新副本,之后我不再使用该技巧了。 Maybe that problem is old or someone in my company committed that trick. 也许这个问题已经很久了,或者我公司的某个人犯了这个错误。 Anyways, worth of testing, too. 无论如何,也值得进行测试。

Answer to the question: 回答问题:

Not, not directly with plugin, but tweak the pom.xml file. 不是,不是直接使用插件,而是调整pom.xml文件。

My sources: 我的资料来源:

[1] http://cygwin.com - running Linux commands at Windows. [1] http ://cygwin.com-在Windows上运行Linux命令。
[2] http://wiki.eclipse.org/M2E_plugin_execution_not_covered - suggested in comments [2] http://wiki.eclipse.org/M2E_plugin_execution_not_covered-在注释中建议
[3] How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds - includes lines of quotation [3] 如何解决Spring Data Maven Builds的“生命周期配置未涵盖的插件执行” -包括引号行

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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