1.1 --- a/java/nekurak.net-web/nbproject/ant-deploy.xml Sat Jun 19 11:19:27 2010 +0200
1.2 +++ b/java/nekurak.net-web/nbproject/ant-deploy.xml Wed Jul 20 18:55:25 2011 +0200
1.3 @@ -3,6 +3,7 @@
1.4 <target name="-init-cl-deployment-env" if="deploy.ant.enabled">
1.5 <property file="${deploy.ant.properties.file}" />
1.6 <available file="${deploy.ant.docbase.dir}/WEB-INF/sun-web.xml" property="sun.web.present"/>
1.7 + <available file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" property="glassfish.web.present"/>
1.8 <available file="${deploy.ant.resource.dir}" property="has.setup"/>
1.9 <tempfile prefix="gfv3" property="gfv3.password.file" destdir="${java.io.tmpdir}"/> <!-- do not forget to delete this! -->
1.10 <echo message="AS_ADMIN_PASSWORD=${gfv3.password}" file="${gfv3.password.file}"/>
1.11 @@ -23,8 +24,34 @@
1.12 <xmlproperty file="${temp.sun.web}" validate="false">
1.13 </xmlproperty>
1.14 <delete file="${temp.sun.web}"/>
1.15 - <property name="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}"/>
1.16 - <property name="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}"/>
1.17 + <condition property="deploy.ant.client.url" value="${gfv3.url}${sun-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
1.18 + <isset property="sun-web-app.context-root"/>
1.19 + </condition>
1.20 + <condition property="deploy.context.root.argument" value="&contextroot=${sun-web-app.context-root}" else="/${ant.project.name}">
1.21 + <isset property="sun-web-app.context-root"/>
1.22 + </condition>
1.23 + </target>
1.24 + <target name="-parse-glassfish-web" depends="-init-cl-deployment-env" if="glassfish.web.present">
1.25 + <tempfile prefix="gfv3" property="temp.gf.web" destdir="${java.io.tmpdir}"/>
1.26 + <copy file="${deploy.ant.docbase.dir}/WEB-INF/glassfish-web.xml" tofile="${temp.gf.web}"/>
1.27 + <!-- The doctype triggers resolution which can fail -->
1.28 + <replace file="${temp.gf.web}">
1.29 + <replacetoken><![CDATA[<!DOCTYPE]]></replacetoken>
1.30 + <replacevalue><![CDATA[<!-- <!DOCTYPE]]></replacevalue>
1.31 + </replace>
1.32 + <replace file="${temp.gf.web}">
1.33 + <replacetoken><![CDATA[<glassfish-web-app]]></replacetoken>
1.34 + <replacevalue><![CDATA[--> <glassfish-web-app]]></replacevalue>
1.35 + </replace>
1.36 + <xmlproperty file="${temp.gf.web}" validate="false">
1.37 + </xmlproperty>
1.38 + <delete file="${temp.gf.web}"/>
1.39 + <condition property="deploy.ant.client.url" value="${gfv3.url}${glassfish-web-app.context-root}" else="${gfv3.url}/${ant.project.name}">
1.40 + <isset property="glassfish-web-app.context-root"/>
1.41 + </condition>
1.42 + <condition property="deploy.context.root.argument" value="&contextroot=${glassfish-web-app.context-root}" else="/${ant.project.name}">
1.43 + <isset property="glassfish-web-app.context-root"/>
1.44 + </condition>
1.45 </target>
1.46 <target name="-no-parse-sun-web" depends="-init-cl-deployment-env" unless="sun.web.present">
1.47 <property name="deploy.context.root.argument" value=""/>
1.48 @@ -33,7 +60,6 @@
1.49 <tempfile prefix="gfv3" property="gfv3.resources.dir" destdir="${java.io.tmpdir}"/>
1.50 <mkdir dir="${gfv3.resources.dir}"/>
1.51 <mkdir dir="${gfv3.resources.dir}/META-INF"/>
1.52 - <property name="gfv3.resources.file" value="${gfv3.resources.dir}/META-INF/sun-resources.xml"/>
1.53 <copy todir="${gfv3.resources.dir}/META-INF">
1.54 <fileset dir="${deploy.ant.resource.dir}"/>
1.55 </copy>
1.56 @@ -42,7 +68,7 @@
1.57 </jar>
1.58 <delete dir="${gfv3.resources.dir}"/>
1.59 </target>
1.60 - <target name="-deploy-ant" depends="-parse-sun-web,-no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
1.61 + <target name="-deploy-ant" depends="-parse-glassfish-web, -parse-sun-web, -no-parse-sun-web,-add-resources" if="deploy.ant.enabled">
1.62 <antcall target="-deploy-without-pw"/>
1.63 <antcall target="-deploy-with-pw"/>
1.64 </target>