Hello,
 
I'm in the middle of a project to convert a bunch of ant build scripts
over to maven 2.  The section that I'm working with right now is fairly
large (approx. 2600 java files) and the ant scripts take these files and
generates multiple jars from the files.  Unfortunately, these jars are
so dependent on each other that the ant scripts use the -sourcepath
parameter for javac to compile each jar's classes correctly.  From what
I can tell there is no built in way to do this in maven, besides
specifying sourcepath in the <compilerArguments> for the
maven-compiler-plugin.  I've tried that and tried adding the sourcepath
argument and it "seemed" to work, as in maven went through the motions
of compiling the files (taking plenty of time doing it).  However, when
it finished ../target/classes was empty as well as the jar file.  I
created a dummy project to try and simulate my issue with a smaller file
set but everything worked properly and classes were generated.  I also
tried to just compile all 2600 files without using -sourcepath, which
also worked.  My only guess is that it has to do with the combination of
the large amount of files and the use of -sourcepath, but I'm not sure.
Any input would be appreciated.  Below is the build section of the pom
I'm using, along with the related debug output from maven. (I cut some
out for length's sake.)
 
Thanks,
 
Jarod
 
Maven version: 2.0.8
Java version: 1.6.0_04
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
 
---The Pom File---
 
...
<build>
    <defaultGoal>install</defaultGoal>
    <sourceDirectory>../src/com/nwms/emr/client</sourceDirectory>
    <!--testSourceDirectory>../unittest/src</testSourceDirectory-->
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <compilerArguments>
                    <sourcepath>../src</sourcepath>
                </compilerArguments>
                <source>1.5</source>
                <target>1.5</target>
                <fork>true</fork>
                <excludes>
                    <exclude>generic/**</exclude>
                </excludes>
            </configuration>
        </plugin>
    </plugins>
  </build>
...
---End Pom---
 
---Maven Output---
 
...
 Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile' -->
[DEBUG]   (f) basedir =
C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient
[DEBUG]   (f) buildDirectory =
C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\target
[DEBUG]   (f) classpathElements = (lots of classes)
[DEBUG]   (f) compileSourceRoots =
[C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\..\src\com\
nwms\emr\client]
[DEBUG]   (f) compilerArguments = {sourcepath=../src}
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) excludes = [generic/**]
[DEBUG]   (f) failOnError = true
[DEBUG]   (f) fork = true
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory =
C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\target\class
es
[DEBUG]   (f) outputFileName = nwemr-client-core-6.1-SNAPSHOT
[DEBUG]   (f) projectArtifact =
com.nwms.emr:nwemr-client-core:jar:6.1-SNAPSHOT
[DEBUG]   (f) showDeprecation = false
[DEBUG]   (f) showWarnings = false
[DEBUG]   (f) source = 1.5
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.5
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:compile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories:
[C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\..\src\com\
nwms\emr\client]
[DEBUG] Classpath: ...
...
[DEBUG] Output directory:
C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\target\class
es
...
 
[DEBUG] Command line options:  (about 80 pages of txt)
[INFO] Compiling 1939 source files to
C:\.hudson\jobs\mvnEHR\workspace\trunk\Core\EMR\nwemrClient\target\class
es
...

Reply via email to