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 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>

    <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.

Reply via email to