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>
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>