On 4/13/06, Kevin Galligan <[EMAIL PROTECTED]> wrote: > I was wondering if there is some utility out there for this. > > Build a maven jar package for a simple 1-off app. Could be something > bigger, but basically you want to execute this on the command line. What I > do now is run assembly with 'jar-with-dependencies' (if that's not exactly > it, you know what I mean). Then I manually set up my command line with... > > java -cp target\whatever-1.0-SNAPSHOT-with-dependencies.jar > com.package.Apparg0 arg1 ... > > The problem here is that you have to have the full path info for the > classpath, and always have to run the assembly deal. I was thinking one or > both of two things. > > mvn-run groupId=com.example.example-app artifactId=example-app > com.package.App arg0 arg1 > > The 'mvn-run' code would add to the classpath according to the group and > package info in the repository. > > It might also be possible to add groupId and artifactId as environment > variables and just run... > > mvn-run com.package.App arg0 arg1 > > Obviously version would be an optional argument. > > (I just went and checked the maven bin folder to make sure this exact thing > wasn't already there) > > Ok. The other one. Closely related, but I'm not sure of the value. An > execute plugin. > > mvn exe:exe -DappClass=com.package.App -Dargruments='arg0 arg1' > > I've been up really late working, so this might be nonsense, but I know this > is a common useage patter that I have and it gets clunky because of the > classpath, etc. Any thoughts?
I use a solution based on assembly + custom generic scripts. The assembly packages my app into \lib \bin \etc and the scripts (.sh and .bat) automatically add lib/*.jar to my CLASSPATH Otherwise, as Emmanuel pointed, the exec plugin might help you. Configure the plugin in your <build> section and specify your arguments on the command line using the appropriate property. Jerome --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]