I am using a proper build.xml to generate a war file. Succeeding in creating a war file but without square files !! I tried with a single eclipse or CMD prompts but the final war file does not include only the Libs in class files. Here's my build.xml:
& lt ;? XML version = "1.0"? & Gt; & Lt; Name of the project = "WestPack" default = "war" based = "c: \\ user \\ m1019779 \. Jenkins \\ workspace \\ test git" gt; & Lt; Property Name = "Configuration" Value = "Status" /> & Lt; Target name = "init" dependent = "clear" & gt; & Lt; Mkdir dir = "build / square" /> & Lt; Mkdir dir = "build / lib" /> & Lt; Copy todir = "build / lib" & gt; & Lt; Fileset dir = "C: \\ java \\ wp_lib" & gt; & Lt; Include name = "* .jar" /> & Lt; / Fileset & gt; & Lt; / Copy & gt; & Lt; / Target & gt; & Lt; Path id = "build.classpath" & gt; & Lt; Fileset dir = "build / lib" & gt; & Lt; / Fileset & gt; & Lt; / Path & gt; & Lt; Target name = "compile" dependent = "init" description = "Java compiled" & gt; & Lt; Echo message = "Building for $ {configuration}" /> & Lt; Javac destdir = "build / classes" debug = "true" srcdir = "src" & gt; & Lt; Classpath refine = "build.classpath" /> & Lt ;! - & lt; Classpath & gt; - & gt; & Lt ;! - & lt; Fileset dir = "build / compile" & gt; - & gt; & Lt ;! - & lt; Included name = "** / * .jar" /> - & gt; & Lt ;! - & lt; Include name = "* .jar" /> - & gt; & Lt ;! - & lt; / Fileset & gt; & Lt; / Classpath & gt; - & gt; & Lt; / Javac & gt; & Lt ;! - Must have to manually copy non-Java resources - & gt; & Lt; Copy todir = "build / classes /" & gt; & Lt; Fileset file = "src / *. Properties" /> & Lt; / Copy & gt; & Lt; Copy todir = "build / classes / conf" & gt; & Lt; Fileset dir = "src / conf" / & gt; & Lt; / Copy & gt; & Lt; Copy todir = "build / classes / com / bcsg / saas / db" & gt; & Lt; Fileset dir = "src / com / bcsg / saas / db" /> & Lt; / Copy & gt; & Lt; Copy todir = "build / classes / pdf" & gt; & Lt; Fileset dir = "src / pdf" /> & Lt; / Copy & gt; & Lt; Copy todir = "build / classes / vmTemplate" & gt; & Lt; Fileset dir = "src / vmTemplate" / & gt; & Lt; / Copy & gt; & Lt; / Target & gt; & Lt; Goal name = "clear" & gt; & Lt; Delete dir = "dist" /> & Lt; Delete dir = "build" /> & Lt; / Target & gt; & Lt; Target name = "war" dependent = "compilation" description = "compile Java classes with the required library for runtime in all fixed assets and a war file" & gt; & Lt; War destfile = "dist / westpac - $ {configuration} .war" webxml = "webcontent / web-nf / web.xml" & gt; & Lt; Squares dir = "build / classes" /> & Lt; Fileset dir = "WebConentent" /> & Lt; Fileset file = "build / build.properties" /> & Lt; Lib dir = "build / lib" / & gt; & Lt; / War & gt; & Lt; / Target & gt; & Lt; / Project & gt;
Your war
work is nested & lt ; Classes & gt;
element, which means that you & lt; Include & gt;
, and identify .class files.
Try to change your combat work to include it:
& Lt; / Sections & gt;
No comments:
Post a Comment