On Thu, 2002-09-19 at 04:47, Rafal Krzewski wrote:
> 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!

Look at the jakarta-commons/logging module. I implemented a little
mechanism for excluding sources:
  
  <build>
    <sourceModifications>
      <sourceModification>
        <className>java.util.logging.Logger</className>
        <excludes>
          <exclude>**/Jdk14Logger.java</exclude>
        </excludes>
      </sourceModification>
    </sourceModifications>
  </build> 
 
So what that does is exclude the Jdk14Logger source file if the
java.util.logging.Logger class isn't present.

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

Jason van Zyl
[EMAIL PROTECTED]
http://tambora.zenplex.org

In short, man creates for himself a new religion of a rational
and technical order to justify his work and to be justified in it.
  
  -- Jacques Ellul, The Technological Society


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

Reply via email to