ant 自动部署war包

1.确保ant.bat中的java_home和 websphere一致
2.确保web.xml有<display-name></display-name>标签
安装上去了 但不能启动

-MapWebModToVH {{${project.name} ${project.name}.war,WEB-INF/web.xml default_host}}
启动成功 但context-root 为/ 不能自定义路径
继续研究中
options 里面 添加 context-root=/jreport 即可

终于搞定
listapplication unistallapplication之类的可以照此类推

<?xml version="1.0" encoding="UTF-8"?>

<project name="My Application Deployment" default="build-all" basedir=".">

<!-- ===================================================================== -->
<!-- define global properties -->
<!-- ===================================================================== -->

<property name="remoteHostName" value="localhost" />
<property name="remoteConnType" value="SOAP" />
<property name="remotePort" value="8880" />
<property name="remoteUserId" value="test" />
<property name="remotePassword" value="1234" />

<!-- change this to your local installation, if different -->

<property name="deployEar.dir" value="C:/tmp" />
<property name="project.name" value="jreport" />

<!-- change this to your local installation, if different -->
<property name="wasHome.dir" value="C:/Program Files/IBM/WebSphere/AppServer" />
<property name="was.profilename" value="AppSrv01" />

<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication" >

<classpath>
<fileset dir="${wasHome.dir}/plugins/" includes="*.jar" />
<fileset dir="${wasHome.dir}/lib/" includes="*.jar" />
</classpath>
</taskdef>
<!--
<wsInstallApp
wasHome="location of websphere installation"
ear="the ear file you wish to install"
options="the options to pass to the installation process"
properties="java properties file containing attributes to set in the JVM System properties"
profile="a script file to be executed before the main command or file"
profileName="the profile name of the desired server"
conntype="specifies the type of connection to be used."
host="the host to connect to"
port="the port on the host to connect to"
user="user ID to authenticate with"
password="password to authenticate with"
failοnerrοr="true | false"/>
-->
<target name="installEar">
<echo message="EAR File located: ${deployEar.dir}/${deployEar}" />
<wsInstallApp profileName="${was.profilename}" ear="${deployEar.dir}/${project.name}.war"
wasHome="${wasHome.dir}" conntype="${remoteConnType}"
options="
-MapWebModToVH {{${project.name} ${project.name}.war,WEB-INF/web.xml ${remoteHostName} }}
-MapModulesToServers {{${project.name} ${project.name}.war,WEB-INF/web.xml WebSphere:cell=cary-mf2t9id1nhNode01Cell,node=cary-mf2t9id1nhNode01,server=server1}}
-context-root /jrepot -appname ${project.name}"
host="${remoteHostName}" user="${remoteUserId}" password="${remotePassword}" />
</target>

<target name="build-all" depends="installEar">

</target>

</project>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值