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

Java EE 6 example source code file (build.xml)

This example Java EE 6 source code file (build.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 - Java EE 6 tags/keywords

all, as_admin_password=, as_admin_password=, copyright, inc, microsystems, microsystems, sun, sun, utf-8, utf-8

The Java EE 6 build.xml source code

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.-->

<project name="security" default="create-file-user" basedir=".">

    <import file="../../bp-project/main.xml"/>

    <!-- attempt to calculate a value for javaee.home -->
    <loadfile srcFile="./nbproject/private/private.properties" property="javaee.home.foo" quiet="true">
        <filterchain >
            <linecontains >
                <contains value="j2ee.server.instance=["/>
            </linecontains>
            <tokenfilter>
                <replaceregex pattern="\].*[0-9]" replace=""/>
            </tokenfilter>
            <tokenfilter>
                <replaceregex pattern="j2ee\.server\.instance=\[" replace=""/>
            </tokenfilter>
            <striplinebreaks/>
        </filterchain>
    </loadfile>
    <condition property="javaee.home" value="${javaee.home.foo}">
        <not>
            <isset  property="javaee.home"/>
        </not>
    </condition>

    <!-- create a password file if one is not defined -->
    <property name="javaee.server.passwordfile.foo" value="foopassword.txt"/>
    <delete file="${javaee.server.passwordfile.foo}" failonerror="false"/>

    <!-- do not format the following echo which is intentional -->
    <echo file="${javaee.server.passwordfile.foo}" append="false">AS_ADMIN_PASSWORD=
    <condition property="javaee.server.passwordfile" value="${javaee.server.passwordfile.foo}">
        <not>
            <isset  property="javaee.server.passwordfile"/>
        </not>
    </condition>
    <import file="../../bp-project/app-server-ant.xml"/>

    <target name="create-file-user" depends="init" unless="user.exists">
        <antcall target="keygen-common">
            <param name="app.user" value="javaee6user"/>
            <param name="app.password" value="abc123"/>
            <param name="app.groups" value="javaee6user"/>
        </antcall>
    </target>
    <target name="delete-file-user">
        <antcall target="keydel-common">
            <param name="app.user" value="javaee6user"/>
        </antcall>
    </target>


</project>

Other Java EE 6 examples (source code examples)

Here is a short list of links related to this Java EE 6 build.xml source code file:

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.