3

We are using maven-exec-plugin during prepare resources phase to create binary file which is later packaged into jar. Exec launches script which reads excel sheet and creates sqlite db.

Now the script is run always, even if I don't run clean. How to configure plugin so it would run only when:

  1. Output file does not exist.

  2. OR Output file exist but last modification date is older then source file.

Jarosław Jaryszew
  • 1,414
  • 1
  • 12
  • 13

1 Answers1

3

You may use <profile> activation to run the plugin only when target/afile.log does not exists :

<profiles>
  <profile>  
    <id>run-exec</id>
    <activation>
      <file>
        <missing>target/afile.log</missing>
      </file>
    </activation>
    ...
  </profile>
</profiles>
Guillaume Darmont
  • 5,002
  • 1
  • 23
  • 35