java left logo
java middle logo
java right logo
 

Home arrow Other API Tips arrow Ant arrow How to use ServerDeploy tasks
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4100
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
How to use ServerDeploy tasks E-mail
User Rating: / 2
PoorBest 

ANT ServerDeploy User Manual

by

  • Christopher A. Longo ( This e-mail address is being protected from spam bots, you need JavaScript enabled to view it )
  • Cyrille Morvan ( This e-mail address is being protected from spam bots, you need JavaScript enabled to view it )


At present the tasks support:

Over time we expect further optional tasks to support additional J2EE Servers.


TaskApplication Servers
serverdeployNested Elements
genericGeneric task
jonasJOnAS 2.4
weblogicWeblogic

ServerDeploy element

Description:

The serverdeploy task is used to run a "hot" deployment tool for vendor-specific J2EE server. The task requires nested elements which define the attributes of the vendor-specific deployment tool being executed. Vendor-specific deployment tools elements may enforce rules for which attributes are required, depending on the tool.

Parameters:

Attribute Description Required
action This is the action to be performed. For most cases this will be "deploy". Some tools support additional actions, such as "delete", "list", "undeploy", "update"... Yes
source A fully qualified path/filename of the component to be deployed. This may be an .ear, .jar, .war, or any other type that is supported by the server. Tool dependent

Nested Elements

The serverdeploy task supports a nested classpath element to set the classpath.

Vendor-specific nested elements

Parameters used for all tools:

Attribute Description Required
classpath The classpath to be passed to the JVM running the tool. The classpath may also be supplied as a nested element. Tool dependent
server The address or URL for the server where the component will be deployed. Tool dependent
username The user with privileges to deploy applications to the server. Tool dependent
password The password of the user with privileges to deploy applications to the server. Tool dependent

Also supported are nested vendor-specific elements.

Generic element

This element is provided for generic Java-based deployment tools. The generic task accepts (but does not require) nested arg and jvmarg elements. A JVM will be spawned with the provided attributes. It is recommended that a vendor-specific element be used over the generic one if at all possible.

The following attributes are supported by the generic element.

Attribute Description Required
classname This is the fully qualified classname of the Java based deployment tool to execute. Yes

Nested Elements

The generic element supports nested <arg> and <jvmarg> elements.

Example

This example shows the use of generic deploy element to deploy a component using a Java based deploy tool:

    <serverdeploy action="deploy" source="${lib.dir}/ejb_myApp.ear">
        <generic classname="com.yamato.j2ee.tools.deploy.DeployTool"
            classpath="${classpath}"
            username="${user.name}"

            password="${user.password}">
            <arg value="-component=WildStar"/>
            <arg value="-force"/>
            <jvmarg value="-ms64m"/>
            <jvmarg value="-mx128m"/>
        </generic>

    </serverdeploy>

WebLogic element

The WebLogic element contains additional attributes to run the weblogic.deploy deployment tool.

Valid actions for the tool are deploy, undeploy, list, update, and delete.

If the action is deploy or update, the application and source attributes must be set. If the action is undeploy or delete, the application attribute must be set. If the username attribute is omitted, it defaults to "system". The password attribute is required for all actions.

Attribute Description Required
application This is the name of the application being deployed Yes
component This is the component string for deployment targets. It is in the form <component>:<target1>,<target2>... Where component is the archive name (minus the .jar, .ear, .war extension). Targets are the servers where the components will be deployed no
debug If set to true, additional information will be printed during the deployment process. No

Examples

This example shows the use of serverdeploy to deploy a component to a WebLogic server:

    <serverdeploy action="deploy" source="${lib.dir}/ejb_myApp.ear">
        <weblogic application="myapp"

            server="t3://myserver:7001"
            classpath="${weblogic.home}/lib/weblogic.jar"
            username="${user.name}"
            password="${user.password}"
            component="ejb_foobar:myserver,productionserver"

            debug="true"/>
    </serverdeploy>

This example shows serverdeploy being used to delete a component from a WebLogic server:

    <serverdeploy action="delete" source="${lib.dir}/ejb_myApp.jar"/&gt

        <weblogic application="myapp"
            server="t3://myserver:7001"
            classpath="${weblogic.home}/lib/weblogic.jar"
            username="${user.name}"
            password="${user.password}"/>

    </serverdeploy>

JOnAS (Java Open Application Server) element

The JOnAS element contains additional attributes to run the JonasAdmin deployment tool.

Valid actions for the tool are deploy, undeploy, list and update.

You can't use user and password property with this task.

Attribute Description Required
jonasroot The root directory for JOnAS. Yes
orb Choose your ORB : RMI, JEREMIE, DAVID, ... If omitted, it defaults to the one present in classpath. The corresponding JOnAS JAR is automatically added to the classpath. If your orb is DAVID (RMI/IIOP) you must specify davidhost and davidport properties. No
davidhost The value for the system property : david.CosNaming.default_host . No
davidport The value for the system property : david.CosNaming.default_port . No
classname This is the fully qualified classname of the Java based deployment tool to execute. Default to org.objectweb.jonas.adm.JonasAdmin No

Nested Elements

The jonas element supports nested <arg> and <jvmarg> elements.

Examples

This example shows the use of serverdeploy to deploy a component to a JOnAS server:

    <serverdeploy action="deploy" source="${lib.dir}/ejb_myApp.jar">
        <jonas server="MyJOnAS" jonasroot="${jonas.root}">

           <classpath>
               <pathelement path="${jonas.root}/lib/RMI_jonas.jar"/>
               <pathelement path="${jonas.root}/config/"/>
           </classpath>

        </jonas>
    </serverdeploy>

This example shows serverdeploy being used to list the components from a JOnAS server and a WebLogic server:

    <serverdeploy action="list"/&gt

        <jonas jonasroot="${jonas.root}" orb="JEREMIE"/>
        <weblogic application="myapp&quot
            server="t3://myserver:7001"
            classpath="${weblogic.home}/lib/weblogic.jar"

            username="${user.name}"
            password="${user.password}"/>
    </serverdeploy>

Source: Apache Ant


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.