有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何在eclipse:eclipse之后在maven中执行代码?

eclipse(eclipse)的一些目标代码在eclipse(eclipse)之后运行

eclipse插件的文档说明生成资源阶段是在eclipse目标之前执行的,但没有提到在之后执行的任何阶段。 我想在gmaven插件中包含代码,但找不到正确的配置:

<execution>
    <id>delete_generated_sources_from_cp</id>
    <phase>generate-resources</phase>
    <goals>
        <goal>execute</goal>
    </goals>
    <configuration>
        <providerSelection>1.7</providerSelection>
        <source>
            modifyClasspath.groovy
        </source>
    </configuration>
</execution>

共 (2) 个答案

  1. # 1 楼答案

    只需将要执行的插件添加到项目中即可。如果将插件的执行添加到阶段process-resources,则如果运行mvn process-resources(或流程资源之后的任何阶段),它将在eclipse插件之后执行

    您也可以直接调用它们:mvn eclipse:eclipse otherplugin:goal

  2. # 2 楼答案

    eclipse:eclipse不是执行代码的好方法。我的意思是,如果您想将项目导入eclipse,应该使用“eclipse:eclipse”,否则就不应该使用

    执行代码取决于您的代码;如果这是基于web的,则应将其部署在应用程序服务器中。如果它有可执行的主类,您应该使用“java”命令执行它

    I wanted to include the code with the gmaven-plugin but I can't find the right configuration

    我不明白你的意思。你能再解释一下吗