1) within the <ant:classpath> I need to somehow iterate through the list of

The short answer is to use ${maven.dependency.classpath}...see below:

From the aspectj-3.0 plugin:

      <ant:iajc
          fork="${maven.aspectj.fork}"
          maxmem="${maven.aspectj.maxmem}"
          incremental="${maven.aspectj.incremental}"
          destDir="${maven.build.dest}"
          sourceRootCopyFilter="${maven.aspectj.sourceRootCopyFilter}"
          debug="${maven.aspectj.debug}"
          emacssym="${maven.aspectj.emacssym}"
          verbose="${maven.aspectj.verbose}">

.
.
.

        <ant:classpath>
          <ant:path refid="maven.dependency.classpath"/>

.
.
.

        </ant:classpath>

.
.
.
      </ant:iajc>





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?

Try this:

<util:tokenize
                xmlns:util="jelly:util"
                delim=";"
                trim="true"
                var="myPaths">
        ${additionalClasspath}
</util:tokenize>

<c:forEach xmlns:c="jelly:core" items="${myPaths}" var="path">
  <ant:pathelement path="${path}"/>
</c:forEach>



3) and i lied one more question, to access VM variables do I simply do {variableName} from maven.xml?

What types of args are you trying to gain access to? You might be able to access them as system properties (for example: ${java.vm.version} or something)...beyond that, I'm not sure.


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]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to