日期:2014-05-20  浏览次数:21066 次

使用ant自动远程部署war包到websphere的build.xml怎么写
使用ant自动远程部署war包到websphere的build.xml怎么写

------解决方案--------------------
不懂,还不会部署websphere

帮顶,祝楼主好运
------解决方案--------------------
直接部署应该不行,你可以用ant打成war包,上传上去!tomcat到可以,不过也不是远程
------解决方案--------------------
首先将你的源码通过ant脚本编译成class,然后按照websphere部署的目录结构要求将那些文件用ant脚本拷贝过去就行了。

------解决方案--------------------
你这结贴率
不过貌似是同行
XML code
<?xml version="1.0"?>

<project name="portal-ext-ext" basedir="." default="deploy">
    <import file="../build-common-ext.xml" />
    <target name="build-service-portlet-portletshortcut">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/portletshortcut/service.xml" />
        </antcall>
    </target>

    <target name="build-service-portlet-calendar">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/calendar/service.xml" />
        </antcall>
    </target>

    <target name="build-service-portlet-task">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/task/service.xml" />
        </antcall>
    </target>
    
    <target name="build-service-portlet-polls">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/polls/service.xml" />
        </antcall>
    </target>
    
    <target name="build-service-portlet-consulting">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/consulting/service.xml" />
        </antcall>
    </target>

    <target name="build-service-portlet-menus">
        <antcall target="build-service">
            <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portal/menus/service.xml" />
        </antcall>
    </target>
    <target name="build-service-portlet-flow">
            <antcall target="build-service">
                <param name="service.file" value="docroot/WEB-INF/ext-impl/src/com/gsoft/portlet/flow/service.xml" />
            </antcall>
    </target>
    <target name="build-service-portlets">
        <antcall target="build-service-portlet-menus" />
        <antcall target="build-service-portlet-flow" />
    </target>
</project>

------解决方案--------------------
LZ参考下:
http://blackstreet.iteye.com/blog/423066
------解决方案--------------------
XML code

<project name="updcusema" default="deploy" basedir=".">
    
    <property name="project.dir" value="${basedir}" />
    <property name="src.dir" value="${basedir}/src" />
    <property name="class.dir" value="${basedir}/build/classes" />
    <property name="dist.dir" value="${basedir}/dist" />
    <property name="res.dir" value="C:\ibm\WebSphere\profiles\GBGCB\installedApps\APACCNSHZJW0332Node01Cell\GBGCB.ear\GBGCB.war\WEB-INF" />
    <property name="web.updcusema.dir" value="C:\ibm\WebSphere\profiles\GBGCB\installedApps\APACCNSHZJW0332Node01Cell\GBGCB.ear\GBGCB.war\WEB-INF\COA\cus\updcusema" />
    <property name="jar.dir" value="C:\ibm\WebSphere\profiles\GBGCB\installedApps\APACCNSHZJW0332Node01Cell\GBGCB.ear\GBGCB.war\WEB-INF\lib" />

    <path id="project.class.path">
        <fileset dir="${jar.dir}">
            <include name="**/*.jar"/>
        </fileset>
        <fileset dir="C:\IBM\WebSphere\AppServer\java\lib">
            <include name="**/*.jar"/>
        </fileset>
    </path>

    <target name="compile">
        <javac srcdir="${src.dir}" destdir="${class.dir}" debug="on">
            <include name="**/*.java" />
            <classpath refid="project.class.path"/>
        </javac>
    </target>

    <target name="copyweb">
            <copy todir="${web.updcusema.dir}">
                <fileset dir="${project.dir}/WebContent/WEB-INF/COA/cus/updcusema">
                </fileset>
            </copy>
    </target>
    
    
    <target name="compress" depends="compile">
            <jar destfile="${dist.dir}/updcusema.jar" basedir="${class.dir}" />
    </target>
    
    
    <target name="copyjar" depends="compress">
        <copy todir="${jar.dir}">
            <fileset dir="${dist.dir}">
             </fileset>
        </copy>
    </target>

    <target name="deploy" depends="copyweb,copyjar" />

</project>