Hello,

First, I'd like to say thanks to the Turbine team for the excelent tool
that Maven is. I've been using it for 4 days and I was able to make it
hop through all the loops I had handy, and still have feeling that I
still haven't seen everything.

In my project, I have a set of source files that cannot be compiled
both under JDK 1.3 and 1.4 due to the JDBC API changes. To be more
specific, it's a connection pooling mechanism (yet another, I know)
and thus it happens to be implementing java.sql.Connection.
My solution to this problem was split the connection pool code from
the main tree (placed under /src/java) and put the JDK 1.3 and 1.4
versions into /src/java-1.3 and /src/java-1.4 respectably. My old
bash-powered build system sed JAVA_VERSION env variable to determine
which source set should be compiled.
This is how I solved it when migrating the project to Maven: (a snip
from maven.xml follows)

  <goal name="labeo:detectJavaVersion">
    <path id="maven.compile.src.set">
      <pathelement location="${basedir}/src/java"/>
      <pathelement
location="${basedir}/src/java-${java.specification.version}"/>
    </path>
  </goal>

  <preGoal name="java:compile">
    <attainGoal name="labeo:detectJavaVersion"/>
  </preGoal>

This works fine for me. Maybe it'll work for other Maven users too.
Or maybe other users/developers know better solutions? If so, I'm all
ears!

Rafal




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

Reply via email to