Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in adding jar files to the building war file using ant  RSS feed

 
bhupendra Singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I am creating a web service using jaxws.

I am writing build.xm to make war file.But whe build.xml is creating war file it is not containing jar file which jws file is using.

Please suggest.Below is the my build.xml

<?xml version="1.0" encoding="windows-1252" ?>
<project name="Automation Service" default="all">
<property file="build.properties"/>



<taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask">
<classpath>
<path id="weblogic.classpath" >
<pathelement path="WEBLOGIC_HOME"/>
<fileset dir="${weblogic.jar.classpath}">
<include name="weblogic.jar"/>
</fileset>
</path>
</classpath>
</taskdef>



<target name="init">
<tstamp/>
<mkdir dir="${build.dir}"/>
</target>




<target name="build-service" depends="init">

<copy todir="${ear-dir}/">
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</copy>
<jwsc
srcdir="src"
destdir="${ear-dir}">
<jws file="com/RunBaseAction.java"
type="JAXWS">
</jws>
<classpath>
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</classpath>
</jwsc>
</target>



</project>


after running ant build-service
it is creating war file but my JWS file which is RunBaseAction.java is using some library which is under lib folder. But ware file does not contain this lib.

Please suggest

-Bhupendra
 
bhupendra Singh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The sub-element zipfileset in jwsc task can pack the file into target war.

Here is a snippet:

<jwsc ...>
<jws ...>
<zipfileset dir="." prefix="WEB-INF/lib">
<include name="your.jar"/>
</zipfileset>
</jws>
</jwsc>


-Bhupendra
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!