That would fail simply because it would cause his package declarations to be wrong. For example, if he has:

DIR
  SUBDIR
    com.myco.pkg.Class.java
  SUBDIR2
    com.myco.pkg.Class2.java

then specifying <sourceDirectory>DIR</sourceDirectory> would lead to javac believing the classes to be:

SUBDIR.com.myco.pkg.Class.java
SUBDIR2.com.myco.pkg.Class2.java

while the actual package declarations in each java file would be inconsistent with this.

Unfortunately, the directory structure is important to javac.

Cheers,
-john

Jefferson K. French wrote:
I guess I misunderstood the question. I thought he was trying to build
a single artifact, but just had his source laid out in multiple
subdirectories under a single parent directory. In that case, I
figured he could just specify the parent as the one source dir.

On Wed, 01 Sep 2004, at 16:31:31 [GMT -0400] John Casey wrote:


Maven does not currently handle multiple source directories gracefully. I think you can add a preGoal of java:compile to your project's maven.xml, in which you might add your other source directories to ${maven.compile.src.set} (at least, I'm pretty sure that's what the property is called - see the java:compile goal in the java plugin for more info)...


Alternately, you could subdivide your project into multiple sub-projects, and use maven's reactor feature (via the multiproject plugin) to do the trick. I prefer this approach, since the division of your source into multiple dirs implies that there is a reason for the separation...and it may be more appropriate to deal with it as separate artifacts.


HTH
-j


Jefferson K. French wrote:

Have you tried this:

 <sourceDirectory>Source/Dir1</sourceDirectory>

or simply

 <sourceDirectory>Source</sourceDirectory>

if you have other Dir diretories?

 Jeff

On Mon, 30 Aug 2004, at 10:36:11 [GMT -0300] Roberto Castro wrote:



Hi, in my project, java source codes are in more than one subdirectory, like this:
--Source
   |
   +-Dir1
       |
       +subdir1
       |   + . . .
       |
       +subdir2
           + . . .
I tried to configure "project.xml" this way:
      <build>
              <sourceDirectory>Source/Dir1/**</sourceDirectory>


But, maven was not able to find java source codes.
Is there a way to compile all this codes in one subproject?
      Thanks in advance for the help,



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

Reply via email to