有时候需要在maven打包的时候执行指定的方法,可以通过以下配置来实现

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.1.1</version>
    <executions>
        <execution>
            <phase>test</phase>
            <goals>
                <goal>java</goal>
            </goals>
            <configuration>
                <mainClass>com.umgsai.core.MetaProvider</mainClass>
                <arguments>
                    <argument>xxx-1r</argument>
                    <!--<argument>arg1</argument>-->
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

以上配置表示在maven执行test阶段,去执行com.umgsai.core.MetaProvider类的main方法,arguments中配置的是main方法的参数。

参考 https://my.oschina.net/u/2474629/blog/983784

相关文章:

  • 2023-03-18
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-06-17
  • 2022-12-23
猜你喜欢
  • 2021-05-22
  • 2022-02-20
  • 2021-11-08
  • 2022-12-23
  • 2021-06-02
  • 2022-12-23
相关资源
相似解决方案