ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Leftwich <digi...@ix.net.au>
Subject Re: How to check j2ee version?
Date Sun, 20 May 2001 23:22:41 GMT
At 09:09 AM 21-05-01, Dennis Gregorovic wrote:
>Our build system depends on version 1.2 of j2ee.jar
>being used.  How can I check the version of j2ee.jar
>from Ant?

I don't know if there is a class in v1.2 that is not in the previous 
versions but if there is you can use the available tag to set a property 
only if that class is available e.g.

<!-- set the j2ee version -->
<target name="set-j2ee-version">
   <available property="j2ee1.2+" classname="unique.1.2+.j2ee.class" />
</target>

<!-- make sure j2ee version is at least 1.2 -->
<target name="ensure-j2ee" depends="set-j2ee-version" unless="j2ee1.2+">
   <fail message="Can only build if running with J2EE 1.2+"/>
</target>

HTH

Robert


Mime
View raw message