Automatically deploy Ear/war files to weblogic12c based on Ant

Source: Internet
Author: User

I recently learned to use Jenkins+svn+ant to automatically deploy an ear file. So here's a note on how to automatically deploy an ear file to WebLogic via Ant.


Usually we can publish the application directly via WebLogic, that is, by logging into the WebLogic Web console and uploading the Ear/war file to the server.

Below, we will use ant to implement similar upload ear file functions.

This assumes that the ear file is ready. Focus on how to deploy the ear to weblogic with Ant.

Weblogic.classpath=/oracle/middleware1211c/wlserver_12.1/server/lib/weblogic.jar<property name= " Class.path.oracle.weblogic " value=" ${thirdpartylibs.home.lib}/oracle/weblogic/wls11/wlfullclient.jar "  />...<target name= "Deploy_admin_server"  depends= "Setup-env,setup-classpath" >  <!--&NBSP;STEP1: Defines the class--> <taskdef name= ant task  through WebLogic wldeploy   Classname= "Weblogic.ant.taskdefs.management.WLDeploy"  > <classpath> <pathelement  location= "${weblogic.classpath}"/> <pathelement location= "${class.path.oracle.weblogic}" /> </classpath> </taskdef>  <!--step2:create ear file -- > <antcall target= "Release"  inheritall= "true"  inheritrefs= "true" ></antcall>   <!--&NBSP;STEP3: Automatic deployment--> <wldeploy      action= "Deploy"  verbose= "true"  debug= "True "      name=" Laustoo " source=" ${build.dir.app}${file.separator}${ Name.release}${file.separator}dev-${release.name}.${release.version}.ear "       user= "User name"  password= "password"       adminurl= "t3://localhost:7001"  targets= " AdminServer " /></target>

In fact, the ant deployment Ear/war file is a three-step process

1 defines an ant task that WebLogic provides for automatic deployment.

2 generating Ear/war files

3 Call the Wldeploy instruction to automatically deploy Ear/war to Welogic.


Finally, the following Wldeploy parameters are explained briefly

Action: There are three parameters Deploy/redeploy/undeploy

Source: Is the path to the Ear/war file

User:weblogic user name for this domain

Password: password

Adminurl: This is the server's domain name path

Target: Deploy to that server


* * Note here the following in order to fail to connect to WebLogic if the deployment is unsuccessful. There is a need to enable tuneling. This option * * *

This article is from the "Development" blog, make sure to keep this source http://jamesdev.blog.51cto.com/2066624/1774919

Automatically deploy Ear/war files to weblogic12c based on Ant

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.