Thank you very much for sharing!  I have been struggling to understand why
the other plugins configured did not see the second source dir area - only
the java:compile goal did.


Wow, this is crazy.  Does M2 have a list of source dirs vs one?


This info should be included in the docs, at least in the FAQ entry where it
shows the java:compile example, if not in a better location.  Brett: if you
agree, let me know where...
 

-----Original Message-----
From: Walsh, Richard (Richard) [mailto:[EMAIL PROTECTED] 
Sent: Friday, May 20, 2005 11:41 AM
To: Maven Users List
Subject: RE: Using Java:Compile JavaDoc and Clover with Mutilpe Source
Directories

Ok,
I figured it all out. Here is the answer for those concerned.

The "set-java-compile-src-set" goal will set the "java.compile.src.set"
property to the generated source dir.

This goal is called from the preGoals for 
        java:compile    In order that the gen-src classes are compiled
with the src directory
        maven-javadoc-plugin:report     In order that the gen-src
classes are javadoc'd with the src directory
        clover:test             In order that the gen-src classes are
tested with the src directory.

<project xmlns:maven="jelly:maven" xmlns:ant="jelly:ant"
default="bootstrap">
        ....
        ....
  <goal name="set-java-compile-src-set">
      <ant:path id="src.dirs">
          <ant:pathelement path="${basedir}/build/gen-src"/>
          <ant:pathelement path="${basedir}/src"/>
      </ant:path>
      <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>
  </goal>

  <preGoal name="java:compile">
        <attainGoal name="set-java-compile-src-set"/>
  </preGoal>
  
  <preGoal name="clover:test">
        <attainGoal name="set-java-compile-src-set"/>
  </preGoal>

  <preGoal name="maven-javadoc-plugin:report">
        <echo>In maven-javadoc-plugin:report"</echo>
        <attainGoal name="set-java-compile-src-set"/>
  </preGoal> 
        ....
</project>
-----Original Message-----
From: Walsh, Richard (Richard)
Sent: 19 May 2005 12:17
To: Maven Users List
Subject: Using Java:Compile JavaDoc and Clover with Mutilpe Source
Directories

Hi,
I am trying to compile, javadoc and clover class files in my project that
are in two different source directories.

The directory structure for the source files is like this.

basedir is d:\builder\<project name>\demo

${basedir}\src
${basedir}\build\gen-src

The project.xml in the basedir has the sourceDirectory set to : 
        <sourceDirectory>src</sourceDirectory>

This means that the maven.compile.src should already contain
d:\builder\<project name>\demo\src.

What I want to do is add d:\builder\<project name>\demo\build\gen-src to the
maven.compile.src.

I have looked through several archived posts and the FAQ. I found the
following code and added it to maven.xml but it does not appear to work.
This try's to add the ${basedir}\build\gen-src directory to the
mavan.compile.src property.

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


The echo message prints [echo] maven.compile.src.set=D:\builder\<project
name>\demo\src

This means that the ${basedir}\build\gen-src directory has not been added to
the maven.compile.src property.

Any ideas what might be wrong here. Also, any ideas how I can get JavaDoc
and Clover to be generated against the gen-src directory.

Thanks,
Richie.

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




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


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

Reply via email to