ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Raible" <m...@raibledesigns.com>
Subject RE: Detecting Tomcat 5
Date Wed, 28 Apr 2004 06:48:01 GMT
Very cool.  I was able to modify my check to be the following:

        <available classname="org.apache.catalina.ant.SessionsTask"
            property="tomcat5">
            <classpath>
                <pathelement
path="${tomcat.home}/server/lib/catalina-ant.jar"/>
            </classpath>
        </available>

        <if>
            <isset property="tomcat5"/>
            <then>
                <echo message="Detected Tomcat 5..."/>
                <echo level="info">Copying ${webapp.name}.xml...</echo>
                <copy
tofile="${tomcat.home}/conf/Catalina/localhost/${webapp.name}.xml"
                    file="metadata/conf/tomcat-context.xml"
overwrite="true">
                    <filterset refid="db.variables"/>
                </copy>
            </then>
            <else>
                <echo message="Detected Tomcat 4..."/>
                <echo level="info">Copying ${webapp.name}.xml...</echo>
                <copy tofile="${tomcat.home}/webapps/${webapp.name}.xml"
                    file="metadata/conf/tomcat-context.xml"
overwrite="true">
                    <filterset refid="db.variables"/>
                </copy>
            </else>
        </if>

Thanks for the help!

Matt

> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
> Sent: Wednesday, April 28, 2004 12:16 AM
> To: user@ant.apache.org
> Subject: RE: Detecting Tomcat 5
> 
> 
> You know that <available> supports a nested <classpath>?
> 
> Jan
> 
> > -----Original Message-----
> > From: Matt Raible [mailto:matt@raibledesigns.com]
> > Sent: Wednesday, April 28, 2004 8:06 AM
> > To: Ant Users List
> > Subject: Re: Detecting Tomcat 5
> > 
> > 
> > Thanks Stefan.  After looking into this more, I don't think 
> I'm going
> > to be able to key off a class in catalina-ant.jar.  If I do, 
> > I'll have 
> > to put it in my $ANT_HOME/lib directory in order for it to be 
> > a part of 
> > the default classpath.  Is there a better way to detect Tomcat 5?
> > 
> > Thanks,
> > 
> > Matt
> > 
> > On Apr 27, 2004, at 11:55 PM, Stefan Bodewig wrote:
> > 
> > > On Tue, 27 Apr 2004, Matt Raible <matt@raibledesigns.com> wrote:
> > >
> > >> I believe the <available> task will help, but I'm unsure 
> of how to 
> > >> to do the "if" logic with this property.
> > >
> > > <available> is a task and a condition (if you leave off 
> the property
> > > attribute) at the same time, so you can say
> > >
> > > <if>
> > >   <available classname="org.apache.catalina.ant.SessionsTask">
> > >   ...
> > > </if>
> > >
> > > If you want to use it as a task, you can use the <isset>
> > condition to
> > > check for the presence of the property <available> was 
> supposed to 
> > > set.
> > >
> > > Stefan
> > >
> > > --
> > > http://stefanbodewig.blogger.de/
> > >
> > > 
> > 
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> > 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message