我们在准备资源阶段使用maven-exec-plugin创建二进制文件,然后将其打包到jar中。Exec启动脚本读取excel表并创建sqlite数据库。
现在脚本总是运行,即使我没有运行干净。如何配置插件,使其只在以下情况下运行:
-
输出文件不存在。
-
或输出文件存在,但最后修改日期比源文件早
只有当target/afile.log
不存在时才能使用<profile>
激活来运行插件:
<profiles>
<profile>
<id>run-exec</id>
<activation>
<file>
<missing>target/afile.log</missing>
</file>
</activation>
...
</profile>
</profiles>