我可以运行maven插件,如果文件更改后,最后一次构建



我们在准备资源阶段使用maven-exec-plugin创建二进制文件,然后将其打包到jar中。Exec启动脚本读取excel表并创建sqlite数据库。

现在脚本总是运行,即使我没有运行干净。如何配置插件,使其只在以下情况下运行:

  1. 输出文件不存在。

  2. 输出文件存在,但最后修改日期比源文件早

只有当target/afile.log不存在时才能使用<profile>激活来运行插件:

<profiles>
  <profile>  
    <id>run-exec</id>
    <activation>
      <file>
        <missing>target/afile.log</missing>
      </file>
    </activation>
    ...
  </profile>
</profiles>

最新更新