How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread janszm
I have a java program which takes an input-file and output-file as parameters. I need to run this for a set of files in a directory. How can I best achieve this with Maven? I have looked at the Exec Maven plugin and as per http://mojo.codehaus.org/exec-maven-plugin/usage.html I can use this to

Re: How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread Stephen Connolly
The easiest way is to just write a plugin... seriously, it's quite simple start with the archetype for a maven plugin (mvn archetype:generate) then just modify the sample Mojo that it creates. you will want to add two parameters to your Mojo, e.g. /** * @parameter

Re: How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread Baptiste MATHUS
Well, it depends on what you want to do. Maven is not designed to be used as a scripting engine for administration tasks. Do you want to do this as a part of your packaging/build process? If so, then look at Stephen answer. If you want to script something moving in a production envt, then just

Re: How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread janszm
Baptiste MATHUS wrote: Well, it depends on what you want to do. Maven is not designed to be used as a scripting engine for administration tasks. Do you want to do this as a part of your packaging/build process? If so, then look at Stephen answer. If you want to script something moving

RE: How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread Stan Devitt
One way to attach this to (say) the process-resources phase is: plugin groupIdorg.codehaus.groovy.maven/groupId artifactIdgmaven-plugin/artifactId version1.0-rc-3/version executions execution

Re: How to run Exec Maven plugin for each file in a directory?

2009-05-26 Thread Baptiste MATHUS
2009/5/26 janszm me...@jansz.com Baptiste MATHUS wrote: Well, it depends on what you want to do. Maven is not designed to be used as a scripting engine for administration tasks. Do you want to do this as a part of your packaging/build process? If so, then look at Stephen answer.