ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Gregorovic" <den...@arsdigita.com>
Subject RE: How to check j2ee version?
Date Mon, 21 May 2001 14:45:25 GMT
Thanks Robert.  

It was actually the case in my circumstance that we needed 
to make sure that j2ee 1.2 is used and not a *later* version.  
So, I wound up implementing a check for 
javax.servlet.ServletContextEvent, which was introduced in 1.3  

-- Dennis

-----Original Message-----
From: Robert Leftwich [mailto:digital@ix.net.au]
Sent: Sunday, May 20, 2001 7:23 PM
To: ant-user@jakarta.apache.org
Subject: Re: How to check j2ee version?


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