java : [基于Apache CXF构建SOA应用] 书中提到的 common_build.xml
2017-08-27 12:57
465 查看
[基于Apache CXF构建SOA应用] 书中第43页 Ant 的 bulil.xml 中有
<import file="../common_build.xml"/>
提到的 common_build.xml 应在 samples/
但是书中没有 common_build.xml , 奇怪的是光盘中代码文件也找不到。
下面给出 common_build.xml
后来才知道生成 ant build.xml 用命令行:
wsdl2java -p com.test -d src -ant -noAddressBinding -encoding utf-8 -client http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl
<import file="../common_build.xml"/>
提到的 common_build.xml 应在 samples/
但是书中没有 common_build.xml , 奇怪的是光盘中代码文件也找不到。
下面给出 common_build.xml
<?xml version="1.0"?> <!-- Generated by WSDLToJava Compiler. This class was generated by Apache CXF 2.6.10 Fri Sep 24 19:23:10 CST 2013 Generated source version: 2.6.10 --> <project name="cxf wsdltojava" default="build" basedir="."> <property environment="env"/> <property name="home.dir" location="${basedir}"/> <property name="build.dir" location ="${basedir}/build"/> <property name="build.classes.dir" location ="${build.dir}/classes"/> <property name="build.src.dir" location ="${basedir}"/> <!-- find the tools jar --> <available property="tools.jar" value="$${env.JAVA_HOME}/lib/tools.jar" file="${env.JAVA_HOME}/lib/tools.jar"/> <path id="jdk.tools.classpath"> <pathelement location="${tools.jar}"/> </path> <condition property="is.java.version.15"> <or> <equals arg1="${ant.java.version}" arg2="1.5"/> <equals arg1="${ant.java.version}" arg2="1.6"/> </or> </condition> <fail message="cxf requires Java version 1.5 or higher. You are currently using Java version ${ant.java.version}." unless="is.java.version.15"/> <!-- Determine cxf.home, either from the environment variable CXF_HOME - or using ../.. --> <condition property="cxf.home" value="${env.CXF_HOME}"> <isset property="env.CXF_HOME"/> </condition> <fail message="Please set CXF_HOME environment variable." unless="cxf.home"/> <!-- Determine cxf.jar.file, either ${cxf.home}/build/lib/cxf.jar - in a source distribution, or ${cxf.home}/lib/cxf-manifest.jar in a binary - distribution. --> <condition property="cxf-manifest.jar.file" value="${cxf.home}/build/lib/cxf-manifest.jar"> <available file="cxf-manifest.jar" type="file" filepath="${cxf.home}/build/lib"/> </condition> <property name="cxf-manifest.jar.file" value="${cxf.home}/lib/cxf-manifest.jar"/> <fail message="The location ${cxf.home} does not seem to contain a cxf installation; if you are importing this common build file from a location other than the cxf samples directory then you need to set the cxf_HOME environment variable."> <condition> <not> <isset property="cxf-manifest.jar.file" /> </not> </condition> </fail> <!-- Determine the tools directory, either ${cxf.home}/tools - in a source distribution, or ${cxf.home}/lib in a binary - distribution. --> <condition property="thirdparty.tools.dir" value="${cxf.home}/tools"> <available file="tools" type="dir" filepath="${cxf.home}"/> </condition> <condition property="thirdparty.tools.dir" value="${cxf.home}/lib"> <available file="lib" type="dir" filepath="${cxf.home}"/> </condition> <property name="cxf.etc.dir" location="${cxf.home}/etc"/> <path id="cxf.classpath"> <pathelement location="${home.dir}" /> <pathelement location="${build.classes.dir}"/> <pathelement location="${cxf-manifest.jar.file}"/> </path> <target name="compile"> <mkdir dir="${build.classes.dir}"/> <javac srcdir="${build.src.dir}" destdir="${build.classes.dir}" debug="true" includeantruntime="false"> <classpath refid="cxf.classpath" /> </javac> </target> <target name="checkstyle"> <checkstyle config="${checkstyle.config.file}"> <fileset dir="${basedir}/src" includes="**/*.java"/> <classpath> <path refid="cxf.classpath"/> </classpath> </checkstyle> </target> <target name="clean"> <delete dir="${build.classes.dir}"/> <delete file="${java.timestamp.file}"/> <delete file="demo.log"/> </target> <target name="build" depends="compile" description="build demo client and server"/> <macrodef name="cxfrun"> <attribute name="classname"/> <attribute name="param1" default=""/> <attribute name="param2" default=""/> <attribute name="param3" default=""/> <attribute name="param4" default=""/> <attribute name="param5" default=""/> <attribute name="jvmarg1" default="-D"/> <attribute name="jvmarg2" default="-D"/> <attribute name="jvmarg3" default="-D"/> <attribute name="jvmarg4" default="-D"/> <attribute name="jvmarg5" default="-D"/> <sequential> <java classname="@{classname}" fork="yes"> <classpath> <path refid="cxf.classpath"/> </classpath> <arg value="@{param1}"/> <arg value="@{param2}"/> <arg value="@{param3}"/> <arg value="@{param4}"/> <arg value="@{param5}"/> <jvmarg value="@{jvmarg1}"/> <jvmarg value="@{jvmarg2}"/> <jvmarg value="@{jvmarg3}"/> <jvmarg value="@{jvmarg4}"/> <jvmarg value="@{jvmarg5}"/> <assertions> <enable package="org.apache.cxf"/> </assertions> <sysproperty key="java.util.logging.config.file" value="${cxf.etc.dir}/logging.properties"/> <sysproperty key="log4j.configuration" value="file:///${cxf.etc.dir}/log4j.properties"/> </java> </sequential> </macrodef> </project>
后来才知道生成 ant build.xml 用命令行:
wsdl2java -p com.test -d src -ant -noAddressBinding -encoding utf-8 -client http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl
相关文章推荐
- 基于Apache CXF构建SOA应用基础
- 在Java中构建WebSocket应用(基于JSR356)
- Java构建工具Ant之第一个build.xml
- 基于Office Open XML构建Office文档应用
- Java构建工具Ant之build.xml
- Java构建工具Ant之第一个build.xml
- java(12)--小应用-基于xml的简单考试查询系统
- java基于xml配置的通用excel单表数据导入组件(一、实际应用过程)
- Spring3.2.0+Hibernate4.1.9+Activiti5.12.1 MAVEN构建JAVA WEB应用之POM.xml
- 基于SOA构建随需应变的企业应用
- 基于SOA构建随需应变的企业应用
- JavaWorld:基于Mule框架构建事件驱动服务的SOA
- java应用测试报告生成(二):利用ant的build.xml生成测试报告
- java-web应用-创建,发布,目录结构,WEB-INF,META-INF,web.xml,build.xml
- java 应用-创建,发布,目录结构,WEB-INF,META-INF,web.xml,build.xml
- 构建自己的基于Java的超级计算机
- 基于模板和XML在BS结构应用中生成word文件
- 在应用中加入全文检索功能 ——基于Java的全文索引引擎Lucene简介
- 用Java实现基于SOAP的XML文档网络传输及远程过程调用(RPC)
- 关于基于XML描述的GUI应用的一些资源