xcopy /E /Y /Q /I META-INF web\WEB-INF\classes\META-INF
jar cvf StockService.war *.*
pause
2) GlassFish
glassfish.properties
-----------------------
# Path to your application server installation
glassfish.home=D:/glassfish
glassfish.host=my.test.domain.com
glassfish.passwordfile=D:/glassfish/admin-pwd
glassfish.adminport=6868
build.class.path=D:/glassfish/lib/webservices-tools.jar:D:/glassfish/lib/javaee.jar
jaxws.endorsed.dir=D:/glassfish/lib
build.xml
-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<project name="WebServiceHello" default="all" basedir=".">
<description>Builds, tests, and runs the project stockclient.</description>
<property file="glassfish.properties"/>
<property name="AppName" value="WebServiceHello"/>
<condition property="wsimport-script-suffix" value=".bat">
<os family="windows"/>
</condition>
<condition property="wsimport-script-suffix" value="">
<not>
<os family="windows"/>
</not>
</condition>
<path id="build.class.path">
<pathelement location="build/classes"/>
<fileset dir="${glassfish.home}/lib">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="-pre-compile">
<mkdir dir="build/classes"/>
<mkdir dir="web/WEB-INF/classes"/>
<exec executable="${glassfish.home}/bin/wsimport${wsimport-script-suffix}">
<arg line="-verbose -p com.samples -d build/classes -keep web/WEB-INF/wsdl/client/StockService/StockService.wsdl"/>
</exec>
<copy file="src/java/handlers.xml" todir="web/WEB-INF/classes"/>
</target>
<target name="compile" depends="-pre-compile">
<javac fork="true" destdir="build/classes" srcdir="src/java" debug="on">
<classpath refid="build.class.path" />
</javac>
</target>
<target name="test">
<war destfile="WebServiceHello.war" webxml="WEB-INF/web.xml">
<zipfileset dir="." />
</war>
</target>
<target name ="war">
<copy todir="web/WEB-INF/classes/META-INF">
<fileset dir="META-INF"/>
</copy>
<war destfile="${AppName}.war" webxml="web/WEB-INF/web.xml">
<zipfileset dir="web" />
</war>
</target>
<target name="deploy">
<exec executable="${glassfish.home}/bin/asadmin${wsimport-script-suffix}">
<arg line=" deploy "/>
<arg line="--user admin"/>
<arg line="--passwordfile ${glassfish.passwordfile}"/>
<arg line="--host ${glassfish.host}"/>
<arg line="--port ${glassfish.adminport} "/>
<arg line=" ${AppName}.war" />
</exec>
</target>
<target name="undeploy">
<exec executable="${glassfish.home}/bin/asadmin${wsimport-script-suffix}">
<arg line=" undeploy "/>
<arg line="--user admin"/>
<arg line="--passwordfile ${glassfish.passwordfile}"/>
<arg line="--host ${glassfish.host}"/>
<arg line="--port ${glassfish.adminport} "/>
<arg line=" ${AppName}.war" />
</exec>
</target>
<target name="all">
<antcall target="war" />
<antcall target="deploy" />
</target>
</project>
admin-pwd
--------------------------
AS_ADMIN_PASSWORD=adminadmin
AS_ADMIN_MASTERPASSWORD=changeit