Answering my own question :-).

I solved the issue by calling maven directly from ant. Here's my ant
target:

    <target name="install-file">
        <java classname="org.codehaus.classworlds.Launcher" fork="true"
failonerror="true">
            <classpath>
                <pathelement
location="${env.M2_HOME}/core/boot/classworlds-1.1.jar"/>
            </classpath>
            <jvmarg
value="-Dclassworlds.conf=${env.M2_HOME}/bin/m2.conf"/>
            <jvmarg value="-Dmaven.home=${env.M2_HOME}"/>
            <arg value="install:install-file"/>
            <arg value="-Dfile=${file}"/>
            <arg value="-DgroupId=${groupId}"/>
            <arg value="-DartifactId=${artifactId}"/>
            <arg value="-Dpackaging=${packaging}"/>
            <arg value="-Dversion=${version}"/>
            <arg value="-DgeneratePom=true"/>
            <arg value="-DcreateChecksum=true"/>
        </java>
    </target>

Naresh 

-----Original Message-----
From: Bhatia, Naresh (IS Consultant) 
Sent: Friday, February 09, 2007 7:31 AM
To: users@maven.apache.org
Subject: RE: Passing version number to install ant task

> I am using Antlib for Maven 2.0 to install bunch of jar files to my 
> local maven repository. Is there any way to specify the version number

> of these jars in my ant task instead of the pom files? The reason I 
> ask is that the version nuber is available in my ant script at the 
> time of a build, whereas it is not convenient (or elegant) to change 
> the version numbers in each one of the POM files during the build.
> 
> Here's a sample of how I am invoking the ant task to install a jar:
> 
>     <artifact:install file="${lib.dir}/entities-${build.version}.jar"
> pomRefId="entities.pom"/>
> 
> What I would really like is
> 
>     <artifact:install file="${lib.dir}/entities-${build.version}.jar"
> pomRefId="entities.pom" version="${build.version}"/>
> 
> Thanks.
> Naresh
> 
P.S. I posted this yesterday but apparently it never got pushed to the
list. My apologies if you receive this post twice.

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

Reply via email to