Skip to content

Commit b81c7b2

Browse files
Updated to support all OWASP standard builds: Win32, Win64, ubuntu32
git-svn-id: http://webgoat.googlecode.com/svn/trunk@462 4033779f-a91e-0410-96ef-6bf7bf53c507
1 parent b73e516 commit b81c7b2

File tree

1 file changed

+81
-53
lines changed

1 file changed

+81
-53
lines changed

webgoat/build.xml

Lines changed: 81 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set to the current working directory.
77
-->
88

9-
<project name="WebGoat" default="Build_ALL_OWASP_Releases" basedir=".">
9+
<project name="WebGoat" xmlns:artifact="antlib:org.apache.maven.artifact.ant" default="Build_ALL_OWASP_Releases" basedir=".">
1010

1111
<!-- ===================== Property Definitions =========================== -->
1212

@@ -57,16 +57,18 @@
5757
<property name="app.home" value="${basedir}"/>
5858
<property name="app.name" value="WebGoat"/> <!-- MUST BE CONSISTENT WITH src/main/build.xml! -->
5959
<property name="app.version" value="5.4"/> <!-- MUST BE CONSISTENT WITH src/main/build.xml! -->
60-
<property name="catalina.home" value="${basedir}/../apache-tomcat-7.0.27"/>
6160
<property name="dist.home" value="${app.home}/dist"/>
6261
<property name="dist.owasp" value="${app.home}/owasp_distributions"/>
6362
<property name="install.home" value="WebGoat-${app.version}"/>
64-
<property name="maven.war" value="${basedir}/target/webgoat-5.4-SNAPSHOT.war"/> <!-- UPDATE THIS! -->
65-
<property name="maven.target" value="${basedir}/target/webgoat-5.4-SNAPSHOT"/> <!-- UPDATE THIS! -->
63+
<property name="maven.war" value="${basedir}/target/WebGoat-5.4-SNAPSHOT.war"/> <!-- UPDATE THIS! -->
64+
<property name="maven.target" value="${basedir}/target/WebGoat-5.4-SNAPSHOT"/> <!-- UPDATE THIS! -->
65+
<property name="maven.home" value="C:/Program Files (x86)/apache/apache-maven-3.0.3"/> <!-- UPDATE THIS! -->
6666
<property name="java32.home" value="C:/Program Files (x86)/Java/jre7"/> <!-- UPDATE THIS! -->
67+
<property name="java32.ubuntu.home" value="C:/RTC/WebGoat/ubuntu_openjava_6_32"/> <!-- UPDATE THIS! -->
6768
<property name="java64.home" value="C:/Program Files/Java/jdk1.6.0_26"/> <!-- UPDATE THIS! -->
6869
<property name="tomcat32.home" value="C:/RTC/WebGoat/apache-tomcat-7.0.27-x86/"/> <!-- UPDATE THIS! -->
6970
<property name="tomcat64.home" value="C:/RTC/WebGoat/apache-tomcat-7.0.27"/> <!-- UPDATE THIS! -->
71+
<property name="tomcat32.ubuntu.home" value="C:/RTC/WebGoat/ubuntu_tomcat_7_32"/> <!-- UPDATE THIS! -->
7072

7173

7274
<!-- ==================== Clean Target ==================================== -->
@@ -76,20 +78,41 @@
7678
so that you can be ensured the application can be built from scratch.
7779
-->
7880

79-
<target name="clean"
81+
<target name="cleanwin32"
8082
description="Delete old build and dist directories">
81-
<delete file="${web_inf.home}/web.xml"/>
8283
<delete dir="${dist.home}"/>
83-
<delete dir="${catalina.home}/logs"/>
84-
<delete dir="${catalina.home}/work/Catalina/localhost"/>
85-
<delete dir="${catalina.home}/webapps/${app.name}"/>
86-
<delete file="${catalina.home}/webapps/${app.name}.war"/>
87-
<delete dir="${catalina.home}/server/webapps/${app.name}"/>
84+
<delete dir="${tomcat32.home}/logs"/>
85+
<delete dir="${tomcat32.home}/work/Catalina/localhost"/>
86+
<delete dir="${tomcat32.home}/webapps/${app.name}"/>
87+
<delete file="${tomcat32.home}/webapps/${app.name}.war"/>
88+
<delete dir="${tomcat32.home}/server/webapps/${app.name}"/>
8889
<mkdir dir="${dist.home}"/>
89-
<mkdir dir="${catalina.home}/logs"/>
90+
<mkdir dir="${tomcat32.home}/logs"/>
9091
</target>
91-
92-
<target name="clean_all"
92+
<target name="cleanwin64"
93+
description="Delete old build and dist directories">
94+
<delete dir="${dist.home}"/>
95+
<delete dir="${tomcat64.home}/logs"/>
96+
<delete dir="${tomcat64.home}/work/Catalina/localhost"/>
97+
<delete dir="${tomcat64.home}/webapps/${app.name}"/>
98+
<delete file="${tomcat64.home}/webapps/${app.name}.war"/>
99+
<delete dir="${tomcat64.home}/server/webapps/${app.name}"/>
100+
<mkdir dir="${dist.home}"/>
101+
<mkdir dir="${tomcat64.home}/logs"/>
102+
</target>
103+
<target name="cleanubuntu32"
104+
description="Delete old build and dist directories">
105+
<delete dir="${dist.home}"/>
106+
<delete dir="${tomcat32.ubuntu.home}/logs"/>
107+
<delete dir="${tomcat32.ubuntu.home}/work/Catalina/localhost"/>
108+
<delete dir="${tomcat32.ubuntu.home}/webapps/${app.name}"/>
109+
<delete file="${tomcat32.ubuntu.home}/webapps/${app.name}.war"/>
110+
<delete dir="${tomcat32.ubuntu.home}/server/webapps/${app.name}"/>
111+
<mkdir dir="${dist.home}"/>
112+
<mkdir dir="${tomcat32.ubuntu.home}/logs"/>
113+
</target>
114+
115+
<target name="clean_dist"
93116
description="Delete old build, dist directories and zips">
94117
<delete dir="${dist.home}"/>
95118
<delete dir="${dist.owasp}"/>
@@ -109,7 +132,7 @@
109132
dependencies) will have been assembled
110133
-->
111134

112-
<target name="DeployWar32"
135+
<target name="DeployWarWin32"
113136
description="Copy existing war to Tomcat - Does not rebuild">
114137

115138
<!-- Install war to Tomcat -->
@@ -118,40 +141,28 @@
118141
<copy file="${maven.war}" tofile="${tomcat32.home}/webapps/${app.name}.war"/>
119142

120143
</target>
121-
<target name="DeployWar64"
144+
<target name="DeployWarWin64"
122145
description="Copy existing war to Tomcat - Does not rebuild">
123146

124147
<!-- Install war to Tomcat -->
125148
<delete dir="${tomcat64.home}/webapps/${app.name}"/>
126-
<delete file="${tomcat65.home}/webapps/${app.name}.war"/>
127-
<copy file="${maven.war}" tofile="${catalina.home}/webapps/${app.name}.war"/>
149+
<delete file="${tomcat64.home}/webapps/${app.name}.war"/>
150+
<copy file="${maven.war}" tofile="${tomcat64.home}/webapps/${app.name}.war"/>
128151

129152
</target>
130-
131-
132-
<target name="ZipProject-Win64"
133-
description="Create a zip archive of all Eclipse project files from C:\WebGoatClassCD">
134-
135-
<!-- Put a copy of the keystore into the WTP dynamic deployment area -->
136-
<copy file="/WebGoatClassCD/tomcat/.keystore" tofile="/WebGoatClassCD/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/.keystore"/>
137-
138-
<zip destfile="${basedir}/project-student.zip"
139-
basedir="/WebGoatClassCD"
140-
includes="project/.project, project/.classpath, project/.settings/**, workspace/**"/>
141-
</target>
153+
<target name="DeployWarUbuntu32"
154+
description="Copy existing war to Tomcat - Does not rebuild">
142155

143-
144-
<!--Build patch release -->
145-
<target name="BuildPatch_release" depends="clean"
146-
description="Creates patch release of class files for WebGoat">
147-
<zip destfile="${dist.home}/${app.name}-${app.version}_patch.zip">
148-
<zipfileset dir="${maven.target}/WEB-INF/classes" prefix="WEB-INF/classes"/>
149-
<zipfileset dir="." includes="readme_patch.txt"/>
150-
</zip>
151-
</target>
156+
<!-- Install war to Tomcat -->
157+
<delete dir="${tomcat32.ubuntu.home}/webapps/${app.name}"/>
158+
<delete file="${tomcat32.ubuntu.home}/webapps/${app.name}.war"/>
159+
<copy file="${maven.war}" tofile="${tomcat32.ubuntu.home}/webapps/${app.name}.war"/>
160+
161+
</target>
152162

163+
153164
<!-- Build J2EE Lab Environment release -->
154-
<target name="Build_DeveloperLab_Release" depends="clean"
165+
<target name="Build_DeveloperLab_Release_FIXME" depends="cleanwin32"
155166
description="Builds J2EE Developer Course release">
156167

157168
<!-- Build the WebGoat WAR with the desired properties file -->
@@ -172,7 +183,7 @@
172183
</zip>
173184
</target>
174185

175-
<target name="Build_Class_Release" depends="clean"
186+
<target name="Build_Class_Release_FIXME" depends="cleanwin32"
176187
description="Builds WebGoat Course release">
177188

178189
<!-- Build the WebGoat WAR with the desired properties file -->
@@ -192,7 +203,7 @@
192203
</target>
193204

194205
<!-- Build OWASP Developer Lab Environment release -->
195-
<target name="Build_OWASP_DeveloperLab_release" depends="clean"
206+
<target name="Build_OWASP_DeveloperLab_release_FIXME" depends="cleanwin32"
196207
description="Builds OWASP Developer release">
197208
<!-- Build the WebGoat WAR with the desired properties file -->
198209
<ant dir="${app.home}" inheritAll="false">
@@ -210,9 +221,9 @@
210221
</zip>
211222
</target>
212223

213-
<target name="Build_OWASP_Standard_Release_32" depends="clean"
214-
description="Builds WebGoat OWASP release">
215-
<antcall target="DeployWar32"> </antcall>
224+
<target name="Build_OWASP_Standard_Release_win32" depends="cleanwin32"
225+
description="Builds WebGoat OWASP win32 release">
226+
<antcall target="DeployWarWin32"> </antcall>
216227
<!-- Build the CD image -->
217228
<zip destfile="${dist.home}/${ant.project.name}-OWASP_Standard_32-${app.version}.zip">
218229
<zipfileset dir="." prefix="${install.home}"
@@ -223,24 +234,41 @@
223234
</zip>
224235
</target>
225236

226-
<target name="Build_OWASP_Standard_Release_64" depends="clean"
227-
description="Builds WebGoat OWASP release">
228-
<antcall target="DeployWar"> </antcall>
237+
<target name="Build_OWASP_Standard_Release_win64" depends="cleanwin64"
238+
description="Builds WebGoat OWASP win64 release">
239+
<antcall target="DeployWarWin64"> </antcall>
229240
<!-- Build the CD image -->
230241
<zip destfile="${dist.home}/${ant.project.name}-OWASP_Standard_64-${app.version}.zip">
231242
<zipfileset dir="." prefix="${install.home}"
232-
includes="java/, tomcat/, read*.txt, webgoat.*, webgoat_8080.*"
233-
excludes="project/.*, project/.settings/**, project/dist/**, project/owasp_distributions/**, project/bin/**, project/build/**"/>
243+
includes=", READ*.txt, webgoat.*, webgoat_8080.*"
244+
excludes=".*, .settings/**,dist/**, owasp_distributions/**, bin/**, build/**"/>
245+
<zipfileset dir="${java64.home}" prefix="${install.home}/java"/>
246+
<zipfileset dir="${tomcat64.home}" prefix="${install.home}/tomcat"/>
247+
</zip>
248+
</target>
249+
250+
<target name="Build_OWASP_Standard_Release_ubuntu32" depends="cleanubuntu32"
251+
description="Builds WebGoat OWASP ubuntu release">
252+
<antcall target="DeployWarUbuntu32"> </antcall>
253+
<!-- Build the CD image -->
254+
<zip destfile="${dist.home}/${ant.project.name}-OWASP_Standard_Ubuntu_32-${app.version}.zip">
255+
<zipfileset dir="." prefix="${install.home}"
256+
includes=", READ*.txt, webgoat.*, webgoat_8080.*"
257+
excludes=".*, .settings/**,dist/**, owasp_distributions/**, bin/**, build/**"/>
258+
<zipfileset dir="${java32.ubuntu.home}" prefix="${install.home}/java"/>
259+
<zipfileset dir="${tomcat32.ubuntu.home}" prefix="${install.home}/tomcat"/>
234260
</zip>
235261
</target>
236262

237263
<!--Build all OWASP release -->
238-
<target name="Build_ALL_OWASP_Releases" depends="clean_all"
264+
<target name="Build_ALL_OWASP_Releases" depends="clean_dist"
239265
description="Creates all binary distributions for OWASP">
240266
<copy file="${basedir}/readme.txt" tofile="${dist.owasp}/readme.txt"/>
241-
<antcall target="Build_OWASP_Standard_Release"> </antcall>
267+
<antcall target="Build_OWASP_Standard_Release_win32"> </antcall>
268+
<copydir dest="${dist.owasp}" src="${dist.home}"/>
269+
<antcall target="Build_OWASP_Standard_Release_win64"> </antcall>
242270
<copydir dest="${dist.owasp}" src="${dist.home}"/>
243-
<antcall target="Build_OWASP_DeveloperLab_release"> </antcall>
271+
<antcall target="Build_OWASP_Standard_Release_ubuntu32"> </antcall>
244272
<copydir dest="${dist.owasp}" src="${dist.home}"/>
245273
</target>
246274

0 commit comments

Comments
 (0)