从命令行跳过 sql-maven-plugin 执行

Skip sql-maven-plugin execution from command line

如何在从命令行执行 mvn clean install 时阻止执行 sql-maven-plugin?我无法触摸 pom 文件。

sql-maven-plugin does provide a skip属性但是没有对应的用户属性.

如果不能修改POM文件,有2种情况:

  1. 插件配置如下:

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>sql-maven-plugin</artifactId>
      <version>1.5</version>
      <!-- dependencies and executions blocks omitted for brevity -->
      <configuration>
        <skip>${someProperty}</skip>
      </configuration>
    </plugin>
    

    在这种情况下,您可以运行 mvn clean install -DsomeProperty=true跳过插件的执行。

  2. 插件没有像上面那样配置。在这种情况下,您就不走运了,您将无法跳过执行。看着source code, there is no user property for the skip property. Your only move would be to make an enhancement request to implement this at the GitHub repo。您还可以提供拉取请求:似乎唯一的变化是向 @Parameter 注释添加 property 属性。