码迷,mamicode.com
首页 > 编程语言 > 详细

ant打包webservice jar

时间:2014-10-12 20:16:58      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:des   io   ar   java   sp   on   ef   bs   as   

<project name="helloworldservice" basedir="." default="deploy">

<property name="src.dir" value="src">
</property>
<property name="build.dir" value="${basedir}/build">
</property>

<path id="build.classpath">
</path>

<target name="init">
<delete dir="${build.dir}">
</delete>
<mkdir dir="${build.dir}" />
<mkdir dir="${build.dir}/classes" />
<mkdir dir="${build.dir}/jar" />
</target>

<target name="compile" depends="init">
<javac srcdir="${src.dir}" destdir="${build.dir}\classes">
<classpath refid="build.classpath">
</classpath>
</javac>
</target>

<target name="makejar" depends="compile">
<jar destfile="${build.dir}\jar\${ant.project.name}.jar">
<fileset dir="${build.dir}/classes">
<include name="**/*.class"/>
</fileset>
<metainf dir="${basedir}">
<include name="services.xml"/>
</metainf>
</jar>
</target>

<target name="deploy" depends="makejar">
<copy file="${build.dir}/jar/${ant.project.name}.jar" todir="D:\wsc\software\apache-tomcat-6.0.41\webapps\axis2\WEB-INF\services"></copy>
</target>

</project>

 

 

=====================

 

services.xml

<service name="HelloWorld">
<description>
This service is to get the running Axis version
</description>
<parameter name="ServiceClass">com.test.HelloWorld</parameter>
<operation name="sayHello">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
</service>

 

 

=======================

 

package com.test;

public class HelloWorld {

public String sayHello() {
return "saying hellooooooooooooo";
}
}

ant打包webservice jar

标签:des   io   ar   java   sp   on   ef   bs   as   

原文地址:http://www.cnblogs.com/wenwujuncheng/p/4020881.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!