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

解决方案 »

  1.   

    使用ant自动远程部署war包到tomcat的build.xml怎么写(⊙o⊙)
      

  2.   

    直接部署应该不行,你可以用ant打成war包,上传上去!tomcat到可以,不过也不是远程
      

  3.   

    首先将你的源码通过ant脚本编译成class,然后按照websphere部署的目录结构要求将那些文件用ant脚本拷贝过去就行了。
      

  4.   

    你这结贴率
    不过貌似是同行
    <?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>现在的一个项目的build.xml参考参考
      

  5.   

    LZ参考下:
    http://blackstreet.iteye.com/blog/423066
      

  6.   


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