I took the code and changed it to the format suggested. I now have this
in the file.

  <preGoal name="java:compile">
        <ant:path id="maven.javacc.compile.src.set"
            location="${basedir}/build/gen-src"/>
        <maven:addPath id="maven.compile.src.set"
            refid="maven.javacc.compile.src.set"/>
      <ant:property name="maven.src.dirs"
refid="maven.compile.src.set"/>
      <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
  </preGoal>

Here is what is printed. It still does not pick up the build/gen-src
directory. 

 __  __
build:start:

java:prepare-filesystem:

java:compile:
<maven:addPath refid="maven.javacc.compile.src.set"
id="maven.compile.src.set"></maven:addPath>    [echo]
maven.compile.src.set=D:\builder\Crystal_buildmachine\demo\src
    [echo] Compiling to
D:\builder\Crystal_buildmachine\demo/target/classes
    [javac] Compiling 3 source files to
D:\builder\Crystal_buildmachine\demo\target\classes
BUILD SUCCESSFUL
Total time: 12 seconds
Finished at: Fri May 20 14:41:07 BST 2005

And it still does not to work!. How can I debug this further. Has anyone
else seen this. Attached is the entire maven.xml for you Jason.
Thanks,
Richie. 

-----Original Message-----
From: Jason van Zyl [mailto:[EMAIL PROTECTED] 
Sent: 20 May 2005 13:22
To: Maven Users List
Subject: Re: maven:addPath does not work

On Fri, 2005-05-20 at 12:30 +0200, Walsh, Richard (Richard) wrote:
> Hi,
> 
> I am having a problem with the below code. The AddPath does not add 
> the src.dirs to the maven.compile.src.set variable.

Here is how it's done in the Antlr plugin:

      <ant:path id="maven.antlr.compile.src.set"
            location="${maven.antlr.target.dir}"/>

      <maven:addPath id="maven.compile.src.set"
                     refid="maven.antlr.compile.src.set"/>

Where one directory is added at a time. I have honestly never tried
using a multi path reference but maybe give the method employed in the
antlr plugin a quick try.

Reference:

http://svn.apache.org/viewcvs.cgi/maven/maven-1/plugins/trunk/antlr/plug
in.jelly?rev=114791&view=markup

> Here is the goal.
> 
> <preGoal name="java:compile">
> 
>     <ant:path id="src.dirs">
> 
>         <ant:pathelement path="${basedir}/build/gen-src"/>
> 
>         <ant:pathelement path="${basedir}/src"/>
> 
>     </ant:path>

You may also want to try the "location" attribute vs the "path"
attribute. The location is for a single file or directory where the path
takes a list. I never use the path attribute myself. What we are doing
in the AddPath tag may only work with the location attribute.

>     <ant:property name="src.dirs.print" refid="src.dirs"/>
> 
>     <ant:echo>src.dirs=${src.dirs.print}</ant:echo>
> 
>     <maven:addPath id="maven.compile.src.set" refid="src.dirs"/>
> 
>     <ant:property name="maven.src.dirs" 
> refid="maven.compile.src.set"/>
> 
>     <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
> 
> </preGoal>
> 
> The Project.xml file has the ${basedir}/src directory set as the 
> sourceDirectory
> 
> <sourceDirectory>src</sourceDirectory>
> 
> Here is what is printed out when I run
> 
> D:\><basedir>\maven -X java:compile
> 
> __ __
> 
> | \/ |__ _Apache__ ___
> 
> | |\/| / _` \ V / -_) ' \ ~ intelligent projects ~
> 
> |_| |_\__,_|\_/\___|_||_| v. 1.0-rc3
> 
> Tag library requested that is not present: 'maven' in plugin: 'null'
> 
> build:start:
> 
> java:prepare-filesystem:
> 
> java:compile:
> 
> [echo]
> src.dirs=D:\builder\Crystal_buildmachine\demo\build\gen-src;D:\builder
> \C
> rystal_buildmachine\demo\src
> 
> <maven:addPath refid="src.dirs"
> id="maven.compile.src.set"></maven:addPath>
> 
> [echo] maven.compile.src.set=D:\builder\Crystal_buildmachine\demo\src
> 
> [echo] Compiling to 
> D:\builder\Crystal_buildmachine\demo/target/classes
> 
> [javac] Compiling 3 source files to
> D:\builder\Crystal_buildmachine\demo\target\classes
> 
>  
> 
> As can be seen the maven.compile.src.set is only set to the 
> ${basedir}/src directory as is being set in the project.xml file. 
> Anyone any ideas.
> 
> thanks,
> 
> Richie.
> 
--
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org

First, the taking in of scattered particulars under one Idea, so that
everyone understands what is being talked about ... Second, the
separation of the Idea into parts, by dividing it at the joints, as
nature directs, not breaking any limb in half as a bad carver might.

  -- Plato, Phaedrus (Notes on the Synthesis of Form by C. Alexander)


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




<project xmlns:maven="maven" xmlns:ant="jelly:ant" default="bootstrap">

  <goal name="bootstrap">
  	<echo message="maven.junit.sysproperties=${maven.junit.sysproperties}"/>
  	<attainGoal name="publishLibraries"/>
  	<attainGoal name="jar"/>
  	<attainGoal name="site:deploy"/>
  </goal>

  <preGoal name="xdoc:jelly-transform">
    <attainGoal name="faq"/>    
  </preGoal>
  
  <postGoal name="xdoc:register-reports">
     <attainGoal name="maven-tasklist-plugin:deregister"/>  
  </postGoal>
 
  <postGoal name="jar" >
  
  	<!--attainGoal name="publishLibraries"/-->
  
  	<copy tofile="${maven.repo.local}/${pom.groupId}/jars/${pom.artifactId}.jar" 
  	  file="${maven.build.dir}/${pom.artifactId}-${pom.currentVersion}.jar"/>
  	
  </postGoal>


  <preGoal name="java:compile">
  	<ant:path id="maven.javacc.compile.src.set"
            location="${basedir}/build/gen-src"/>
        <maven:addPath id="maven.compile.src.set"
            refid="maven.javacc.compile.src.set"/>
      <ant:property name="maven.src.dirs" refid="maven.compile.src.set"/>
      <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
  </preGoal>

  <!--preGoal name="java:compile">
      <ant:path id="src.dirs" location="${basedir}/build/gen-src"/>
      <ant:property name="src.dirs.print" refid="src.dirs"/>
      <ant:echo>src.dirs=${src.dirs.print}</ant:echo>
      <maven:addPath id="maven.compile.src.set" refid="src.dirs"/>
      <ant:property name="maven.src.dirs" refid="maven.compile.src.set"/>
      <ant:echo>maven.compile.src.set=${maven.src.dirs}</ant:echo>
  </preGoal-->

  <!-- preGoal name="java:compile">
  	<echo>Copy from ${basedir}/build/gen-src to ${basedir}/target/classes</echo>
    <mkdir dir="${basedir}/target/classes"/>
    <copy todir="${basedir}/target/classes">
    	<fileset dir="build/gen-src"/>
    </copy>
  </preGoal -->

  <preGoal name="maven-javadoc-plugin:report">
  	<echo>In maven-javadoc-plugin:report"</echo>
  </preGoal>
      
 <goal name="publishLibraries" 
        description="Organize and Publish libraries to Maven Repo according to Maven standard" >        		
  	
  	<!-- Preparing 3RD PARTY DEPENDENCIES     	
      	<mkdir dir="${maven.repo.local}/others/jars"/-->
  
      	<!-- Copy any library from lib into repo\others\jars -->
      	
      	<copy todir="${maven.repo.local}/others/jars">
      		<fileset dir="lib">
  	    		<include name="*.jar"/>
      		</fileset>
      	</copy>
      	
      	<!-- Preparing INTERNAL DEPENDENCIES -->  
      	<mkdir dir="${maven.repo.local}/avaya/jars"/>
  
  
  	<!-- Copy bcapi, bridge and bapi libraries from ConferenceManager lib folder -->
      	<copy todir="${maven.repo.local}/avaya/jars">
      		<fileset dir="jar">
  	    		<include name="*.jar"/>
      		</fileset>    		
      	</copy>
      	
      	
  </goal>
  
  
  
</project>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to