gpt4 book ai didi

maven-2 - 默认情况下跳过maven2插件

转载 作者:行者123 更新时间:2023-12-04 13:55:32 25 4
gpt4 key购买 nike

我正在寻找一种不让插件在安装时执行的方法。更具体地说,我的情况如下:

  • 我正在使用org.apache.cxf:cxf-codegen-plugin生成源代码。
  • 每次我清理安装时都会生成
  • 我只希望在显式请求源代码时生成源代码。

  • 任何和所有帮助将不胜感激!

    最佳答案

    I only want generation of source code to happen when I explicitly request it.



    最好的选择是在配置文件中添加插件声明并显式激活此配置文件:
    <project>
    ...
    <profiles>
    <profile>
    <id>codegen</id>
    ...
    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.cxf</groupId>
    <artifactId>cxf-codegen-plugin</artifactId>
    <version>${cxf.version}</version>
    <executions>
    <execution>
    <id>generate-sources</id>
    <phase>generate-sources</phase>
    <configuration>
    <sourceRoot>${project.build.directory}/generated/cxf</sourceRoot>
    <wsdlOptions>
    <wsdlOption>
    <wsdl>${basedir}/src/main/wsdl/myService.wsdl</wsdl>
    </wsdlOption>
    </wsdlOptions>
    </configuration>
    <goals>
    <goal>wsdl2java</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>
    </profile>
    </profiles>
    </project>

    当您希望代码生成发生时,请运行以下命令:
    mvn clean install -Pcodegen

    关于maven-2 - 默认情况下跳过maven2插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2596455/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com