You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Roland Berger <ro...@aloba.ch> on 2003/08/07 09:02:56 UTC

how to access maven.dependency.classpath in a goal?

Hi all

I'd like to access the maven.dependency.classpath in a goal which is defined
in maven.xml to pass it to the ant:java task. But it doesen't seem to work.
After writing out the variable ${maven.dependency.classpath} to the console
like this:

        <ant:echo>The maven dependency classpath is :
${maven.dependency.classpath}</ant:echo>

does nothing display.

Here is the complete script:

<?xml version="1.0" encoding="ISO-8859-1"?>
<project
  xmlns:ant="jelly:ant">
  <goal name="enhance">

        <ant:echo>The maven dependency classpath is :
${maven.dependency.classpath}</ant:echo>

<!--    <ant:java fork="yes" failonerror="yes"-->
<!--      classname="com.signsoft.ibo.enhancer.Main">-->
<!--      <classpath>-->
<!--        <path refid="maven.dependency.classpath"/>-->
<!--      </classpath>-->
<!--      <arg line="-s classes -d enhanced -v:info"/>-->
<!--    </ant:java>-->

  </goal>
</project>

What do I miss? Thank's
Roland


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


Re: how to access maven.dependency.classpath in a goal?

Posted by Emmanuel Venisse <ev...@ifrance.com>.
maven.dependency.classpath is a reference id. You can't echo it directly.
The correct code is :

    <!-- Display maven.dependency.classpath in a nice format. -->
    <property
      name="mavenDependencyClasspath"
      refid="maven.dependency.classpath"
    />

    <j:choose>
      <j:when test="${systemScope['os.name'].startsWith('Windows')}">
        <u:tokenize var="classpath"
delim=";">${mavenDependencyClasspath}</u:tokenize>
      </j:when>
      <j:otherwise>
        <u:tokenize var="classpath"
delim=":">${mavenDependencyClasspath}</u:tokenize>
      </j:otherwise>
    </j:choose>

    <echo>
    maven.dependency.classpath:
    <j:forEach var="entry" items="${classpath}">${entry}
    </j:forEach>
    </echo>

    <ant:java fork="yes" failonerror="yes"
classname="com.signsoft.ibo.enhancer.Main">
       <ant:classpath>
           <ant:path refid="maven.dependency.classpath"/>
       </ant:classpath>
       <arg line="-s classes -d enhanced -v:info"/>
  </ant:java>

----- Original Message ----- 
From: "Roland Berger" <ro...@aloba.ch>
To: "Maven Mailinglist" <us...@maven.apache.org>
Sent: Thursday, August 07, 2003 9:02 AM
Subject: how to access maven.dependency.classpath in a goal?


> Hi all
>
> I'd like to access the maven.dependency.classpath in a goal which is
defined
> in maven.xml to pass it to the ant:java task. But it doesen't seem to
work.
> After writing out the variable ${maven.dependency.classpath} to the
console
> like this:
>
>         <ant:echo>The maven dependency classpath is :
> ${maven.dependency.classpath}</ant:echo>
>
> does nothing display.
>
> Here is the complete script:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <project
>   xmlns:ant="jelly:ant">
>   <goal name="enhance">
>
>         <ant:echo>The maven dependency classpath is :
> ${maven.dependency.classpath}</ant:echo>
>
> <!--    <ant:java fork="yes" failonerror="yes"-->
> <!--      classname="com.signsoft.ibo.enhancer.Main">-->
> <!--      <classpath>-->
> <!--        <path refid="maven.dependency.classpath"/>-->
> <!--      </classpath>-->
> <!--      <arg line="-s classes -d enhanced -v:info"/>-->
> <!--    </ant:java>-->
>
>   </goal>
> </project>
>
> What do I miss? Thank's
> Roland
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> _____________________________________________________________________
> Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
> http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France

_____________________________________________________________________
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


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