You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "aboussoror@gmail.com" <ab...@gmail.com> on 2010/12/08 11:20:02 UTC

Accessing to the maven classpath from Ant build file

Hello,

   I have a maven project with dependencies to jars in may local repository
and I want to launch an ant build file that need to access to files in those
jars. I have defined the dependency like this :

  	<dependency>
  		<groupId>fr.sogeti.plpm.infra.persistance.jpa</groupId>
  		<artifactId>fr.sogeti.plpm.infra.persistance.jpa.generator</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  		<scope>compile</scope>
  	</dependency>
  	<dependency>
  		<groupId>fr.sogeti.plpm.infra.persistance.jpa</groupId>
  		<artifactId>fr.sogeti.plpm.infra.persistance.jpa.model</artifactId>
  		<version>0.0.1-SNAPSHOT</version>
  		<scope>compile</scope>
  	</dependency>

And I'm trying to reference the file I need (JPA.ecore) from the Ant file
like this :
	<property name="myModelUri" value='/JPA.ecore' />

But when I launch my Ant build file, ant is looking for the file only in my
project and not  in the Maven classpath.

Thanks
-- 
View this message in context: http://maven.40175.n5.nabble.com/Accessing-to-the-maven-classpath-from-Ant-build-file-tp3297133p3297133.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Accessing to the maven classpath from Ant build file

Posted by "aboussoror@gmail.com" <ab...@gmail.com>.
I tried it out but the echo task did not print the expected result :

<path id="maven-ant-tasks.classpath"
path="D:\workspaces\wp_sogeti\plpm.example\plpm.example-generator\src\main\resources\lib\maven-ant-tasks-2.1.1.jar"
/>
	  <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
	           uri="antlib:org.apache.maven.artifact.ant"
	           classpathref="maven-ant-tasks.classpath" />

	
<echo message="Dependency JAR Path:
${fr.sogeti.plpm.infra.persistance.jpa:fr.sogeti.plpm.infra.persistance.jpa.model:jar}"/> 
this is the result :
   [echo] Dependency JAR Path:
${fr.sogeti.plpm.infra.persistance.jpa:fr.sogeti.plpm.infra.persistance.jpa.model:jar}

please notice that I'm working inside eclipse.

-- 
View this message in context: http://maven.40175.n5.nabble.com/Accessing-to-the-maven-classpath-from-Ant-build-file-tp3297133p3297502.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Accessing to the maven classpath from Ant build file

Posted by Anders Hammar <an...@hammar.net>.
Maven Ant tasks?
http://maven.apache.org/ant-tasks/download.html

/Anders

On Wed, Dec 8, 2010 at 14:26, aboussoror@gmail.com <ab...@gmail.com>wrote:

>
> Thanks, I see but I don't want to launch my build file from maven.
> Any other idea ?
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Accessing-to-the-maven-classpath-from-Ant-build-file-tp3297133p3297329.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Accessing to the maven classpath from Ant build file

Posted by "aboussoror@gmail.com" <ab...@gmail.com>.
Thanks, I see but I don't want to launch my build file from maven.
Any other idea ?

-- 
View this message in context: http://maven.40175.n5.nabble.com/Accessing-to-the-maven-classpath-from-Ant-build-file-tp3297133p3297329.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Accessing to the maven classpath from Ant build file

Posted by Anders Hammar <an...@hammar.net>.
http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html

/Anders

On Wed, Dec 8, 2010 at 11:20, aboussoror@gmail.com <ab...@gmail.com>wrote:

>
> Hello,
>
>   I have a maven project with dependencies to jars in may local repository
> and I want to launch an ant build file that need to access to files in
> those
> jars. I have defined the dependency like this :
>
>        <dependency>
>                <groupId>fr.sogeti.plpm.infra.persistance.jpa</groupId>
>
>  <artifactId>fr.sogeti.plpm.infra.persistance.jpa.generator</artifactId>
>                <version>0.0.1-SNAPSHOT</version>
>                <scope>compile</scope>
>        </dependency>
>        <dependency>
>                <groupId>fr.sogeti.plpm.infra.persistance.jpa</groupId>
>
>  <artifactId>fr.sogeti.plpm.infra.persistance.jpa.model</artifactId>
>                <version>0.0.1-SNAPSHOT</version>
>                <scope>compile</scope>
>        </dependency>
>
> And I'm trying to reference the file I need (JPA.ecore) from the Ant file
> like this :
>        <property name="myModelUri" value='/JPA.ecore' />
>
> But when I launch my Ant build file, ant is looking for the file only in my
> project and not  in the Maven classpath.
>
> Thanks
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Accessing-to-the-maven-classpath-from-Ant-build-file-tp3297133p3297133.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>