Example of a build.xml for an EAR that deploys in WebSphere 6

前端 未结 4 966
南方客
南方客 2020-12-07 21:36

I\'m trying to convince my providers to use ANT instead of Rational Application Development so anyone can recompile, recheck, redeploy the solution anyplace, anytime, anyhow

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-07 21:49

    My Environment: Fedora 8; WAS 6.1 (as installed with Rational Application Developer 7)

    The documentation is very poor in this area and there is a dearth of practical examples.

    Using the WebSphere Application Server (WAS) Ant tasks

    To run as described here, you need to run them from your server profile bin directory using the ws_ant.sh or ws_ant.bat commands.

    
    
        
            Script for listing installed apps.
            Example run from:
            /opt/IBM/SDP70/runtimes/base_v61/profiles/AppSrv01/bin
        
    
        
        
        
            
                
            
            
                
            
        
        
        
    
        
            
            
            
        
    
    
    

    Command:

    ./ws_ant.sh -buildfile ~/IBM/rationalsdp7.0/workspace/mywebappDeploy/applist.xml
    

    A Deployment Script

    
    
    
    Build/Deploy an EAR to WebSphere Application Server 6.1
    
    
        
        
            
                
            
            
                
            
        
        
        
        
    
        
        
    
        
            
                
                
            
        
    
        
            
            
            
        
    
        
            
            
            
            
                
            
        
    
        
        
            
            
        
    
    
    

    Notes:

    • You can only run this once! You cannot install if the app name is in use - see other tasks like wsUninstallApp
    • It probably won't start the app either
    • You need to run this on the server and the script is quite fragile

    Alternatives

    I would probably use Java Management Extensions (JMX). You could write a file-upload servlet that accepts an EAR and uses the deployment MBeans to deploy the EAR on the server. You would just POST the file over HTTP. This would avoid any WAS API dependencies on your dev/build machine and could be independent of any one project.

提交回复
热议问题