alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Jetty example source code file (anttasks.xml)

This example Jetty source code file (anttasks.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Jetty tags/keywords

download, download, files, found, is, java, jetty, jetty, required, url, win32, win32, wrapper, wrapper

The Jetty anttasks.xml source code

<project name="Jetty Win32 Wrapper" default="deploy-win32-wrapper" basedir=".">

    <target name="download-if-not-found">
        <echo>Checking if wrapper-windows-x86-32-${serviceWrapperVersion}.zip Download is required
        <condition property="need.download">
            <available file="target/wrapper-windows-x86-32-${serviceWrapperVersion}.zip" type="file" property="src.present"/>
        </condition>
        <antcall target="dontDownload"/>
        <antcall target="download"/>
    </target>

    <target name="dontDownload" if="need.download">
        <echo>No Need To Download
        <echo>File Found: target/wrapper-windows-x86-32-${serviceWrapperVersion}.zip
    </target>

    <target name="download" unless="need.download">
        <echo>Download Is Required
        <echo>Downloading Java Service Wrapper URL: ${serviceWrapperURL}/wrapper-windows-x86-32-${serviceWrapperVersion}.zip
        
        <get src="${serviceWrapperURL}/wrapper-windows-x86-32-${serviceWrapperVersion}.zip" dest="target/wrapper-windows-x86-32-${serviceWrapperVersion}.zip" />
        
    </target>
    
    <target name="deploy">
        <unzip src="target/wrapper-windows-x86-32-${serviceWrapperVersion}.zip" dest="target/unziped" />
        <copy failonerror="true" file="target/unziped/wrapper-windows-x86-32-${serviceWrapperVersion}/bin/wrapper.exe" tofile="../../bin/Jetty-Service.exe" />
        <copy failonerror="true" file="target/unziped/wrapper-windows-x86-32-${serviceWrapperVersion}/lib/wrapper.jar" todir="../../lib/win32" />
        <copy failonerror="true" file="target/unziped/wrapper-windows-x86-32-${serviceWrapperVersion}/lib/wrapper.dll" todir="../../lib/win32" />

        <copy failonerror="true" file="target/${project.artifactId}-${project.version}.${project.packaging}" todir="../../lib/win32" />
        <copy failonerror="true" file="src/main/resources/jetty-win32-service.xml" todir="../../etc" />
        <copy failonerror="true" file="src/main/resources/jetty-service.conf" todir="../../bin" />
    </target>

    
    <target name="deploy-win32-wrapper">    
        <antcall target="download-if-not-found"/>
        <antcall target="deploy"/>
        
    </target>
    
    <target name="clean-win32-wrapper">
        <echo>Removing Jetty Win32 Wrapper Files
        <delete failonerror="false" file="target/wrapper-windows-x86-${serviceWrapperVersion}.zip"/>
        <delete failonerror="false" file="target/unziped"/>
        <delete failonerror="false" file="../../lib/win32/${project.artifactId}-${project.version}.${project.packaging}"/>
        <delete failonerror="false" file="../../etc/jetty-win32-service.xml"/>
        <delete failonerror="false" file="../../bin/Jetty-Service.exe"/>
        <delete failonerror="false" file="../../bin/jetty-service.conf"/>
        <delete failonerror="false" file="../../lib/win32/wrapper.jar"/>
        <delete failonerror="false" file="../../lib/win32/wrapper.dll"/>
    </target>
    
 
                
</project>

Other Jetty examples (source code examples)

Here is a short list of links related to this Jetty anttasks.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.