Hi Jarod,

I can't offer any specific advice on the -sourcepath issue. However you
should be aware of something about Maven: Maven is NOT as flexible as
ant. And that is deliberate.

Ant is pretty much a Turing-complete programming language that can do
anything. But the disadvantage is that because it can do anything,
people make it do some very weird and unmaintainable things. Your
current setup sounds like it might well fall into that category.

It is precisely because Maven does *not* support every weird setup that
its builds remain more maintainable and comprehensible.

So if you are moving to Maven, you might find that you are forced to
clean up your project structures before Maven will work for you. Maven
is somewhat tweakable but if you don't want to follow its approach at
all, then it is better to stay with Ant (maybe using the maven ant tasks
for dependency resolution, or using ant+ivy).

This thing about compiling other module's code for them sounds really
un-mavenish. How on earth are you going to properly define the module's
dependencies when that is going on?

Regards,
Simon

On Mon, 2008-03-31 at 17:19 -0400, Jarod Rose wrote:
> 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
> ...


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

Reply via email to