commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@t-online.de>
Subject Re: [VOTE] Release Configuration 1.2
Date Thu, 01 Dec 2005 21:26:45 GMT
<snip/>

>>AFAIK, other apache projects require sun jars to compile. You may ask
>>commons-dbcp commiters that seem to have the same requirement :
>>"
>>   <!-- Note JDBC 2.0 is a pain, because it must be manually
>>        downloaded to your Maven repository, and it's not even
>>        required on JDK 1.4.  Maybe we should remove it from
>>        this dependency list so Maven doesn't choke?
>>   -->
>>   <dependency>
>>     <id>jdbc</id>
>>     <version>2.0</version>
>>   </dependency>
>>"
>>    
>>
>
>It would be neater if something could be done in the maven.xml to
>detect JDK 1.3 and add it into the class path from a property
>specified in the build.properties. I'm going to face the same issue in
>Commons Resources - we have 1 class that relies on JDBC 2.
>
>Niall
>
>  
>
I think simply checking for a JDK 1.3 may not be enough because you can
use the maven.compile.executable property to select a compiler from a
different JDK. Then compilation may take place on a JDK 1.3, but maven
is actually running on a JDK 1.4 or whatever.

I just tested the following approach: In maven.xml I added the following
goal:

  <!-- Adds the jdbc-stdext to the dependency classpath if the
       dependency.jdbc property is defined.
  -->
  <preGoal name="java:compile">
    <j:if test="${dependency.jdbc != ''}">
      <path id="extended.dependency.path">
        <pathelement path="${dependency.jdbc}"/>
      </path>
      <maven:addPath id="maven.dependency.classpath"
refid="extended.dependency.path"/>
    </j:if>
  </preGoal>

Now in your build.properties you can define the "dependency.jdbc"
variable to point to the jdbc jar. If it is set, the dependency will be
added to the classpath; otherwise not. Given that this setup is clearly
documented, do you think this solution is practical?

Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message