The attached patch adds the requested functionality for the exec mojo. Not the java one.
The patch also:
- allows to use regular expressions to match dependencies
- adds a warning if one uses in his/her path a <dependency> that matches none of the project dependencies
- keep the dependencies in the order they are defined in the <classpath> section
With that patch, one is forced to use the <classpath> element to specify these new path elements, hence the implementation of the regular expression support.
Below is the example of the change in documentation which should give a feel how this would work.
Adding the same functionality to the java mojo would require a different user configuration. So I am unsure if this is the right way to do it.
Feel free to comment on the patch. I don't intend to commit it as is as I am not satisfied with the way the user configuration is going nor the way the 2 main exec mojos stay in sync. There must be a better way.
+ dependencies can also be regular expressions:
+-------------------
+ ...
+ <classpath>
+ <dependency>commons.*</dependency>
+ </classpath>
+ ...
+-------------------
+
+Finally one can also add extra locations (e.g. for resources that one don't want to be packaged)
+
+-------------------
+ ...
+ <classpath>
+ <element>src/main/nonpackagedresources</element>
+ <dependency>.*</dependency>
+ </classpath>
+ ...
Taking. Will do later today.