John, Thanks that helps tremendously, my other 2 remaining questions would be 1) within the <ant:classpath> I need to somehow iterate through the list of project dependencies, something like: <ant:classpath> <while mydeps.hasmore> <ant:classpath path=mydep> </while> </ant:classpath> Is there someway to do something similar to this?
2) Secondly if the user specifies multiple classpath entries, like maven -DadditionalClasspath="/path/to/something.jar;/path/to/anotherjar.jar" is there someway for me to break that up into classpath entries? 3) and i lied one more question, to access VM variables do I simply do {variableName} from maven.xml? Thanks, David ----- Original Message ----- From: "John Casey" <[EMAIL PROTECTED]> To: "Maven Users List" <[EMAIL PROTECTED]> Sent: Friday, August 13, 2004 3:21 PM Subject: Re: A Goal that can execute a class' main method? > You might want to try Ant's <java> task for this. To use it, you should > try embedding in a custom goal within your project's maven.xml file. > I'll look something like this: > > <project default="dbLoad" xmlns:ant="jelly:ant"> > > <goal name="dbLoad"> > <ant:java [...options...] classname="com.myco.DbLoader"> > <ant:arg value="${myData}"/> > > <ant:classpath> > <ant:pathelement path="${myPath}"/> > </ant:classpath> > </ant:java> > </goal> > > </project> > > which you might then invoke using the following command: > > maven -DmyData=/path/to/my/data -DmyPath=/path/to/my/classes dbLoad > > You can find more info on the Ant java task at: > http://ant.apache.org/manual/CoreTasks/java.html > > HTH, > john > > David Erickson wrote: > > Hi guys got a couple questions. Ive got a project that has a class that > > updates a database with information. What I was wondering is if it would be > > possible to make a maven goal that executes that class, thus making it easy > > on the end user (since the majority of the dependencies are listed within > > the dep list). The requirements are these: > > 1) I'd need to be able to pass in a java environment variable (from the > > command line) for where the datafiles are at to be ported into the db > > 2) I'd need to be able to add elements to the classpath of the class that > > will be executed (From the command line) in addition to the dependencies > > that are listed within maven > > > > Is something like this possible? And if so, if you could point me in the > > direction on how to implement it I'd be greatly appreciative. > > Thanks, > > David > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]