Automated merge with http://hg.netbeans.org/main/contrib
authorTim Boudreau <tboudreau@netbeans.org>
Mon, 26 Oct 2015 22:29:45 -0400
changeset 183430992c33f3ac0
parent 18341 a4a9ce1c0e95
parent 18342 78f82539c7ba
child 18344 733f70cbf7d2
Automated merge with http://hg.netbeans.org/main/contrib
     1.1 --- a/zeroadmin/nbproject/project.properties	Tue Oct 20 01:33:34 2015 -0500
     1.2 +++ b/zeroadmin/nbproject/project.properties	Mon Oct 26 22:29:45 2015 -0400
     1.3 @@ -44,3 +44,4 @@
     1.4  test.unit.cp.extra=../../openide.filesystems/build/test/unit/classes
     1.5  test.unit.run.cp.extra=../../contrib/other/../../openide/fs/build/test/unit/classes:\
     1.6  ${o.n.bootstrap.dir}/lib/boot.jar
     1.7 +spec.version.base.fatal.warning=false
     2.1 --- a/zeroadmin/nbproject/project.xml	Tue Oct 20 01:33:34 2015 -0500
     2.2 +++ b/zeroadmin/nbproject/project.xml	Mon Oct 26 22:29:45 2015 -0400
     2.3 @@ -106,6 +106,14 @@
     2.4                      </run-dependency>
     2.5                  </dependency>
     2.6                  <dependency>
     2.7 +                    <code-name-base>org.openide.filesystems.compat8</code-name-base>
     2.8 +                    <build-prerequisite/>
     2.9 +                    <compile-dependency/>
    2.10 +                    <run-dependency>
    2.11 +                        <specification-version>9.6</specification-version>
    2.12 +                    </run-dependency>
    2.13 +                </dependency>
    2.14 +                <dependency>
    2.15                      <code-name-base>org.openide.loaders</code-name-base>
    2.16                      <build-prerequisite/>
    2.17                      <compile-dependency/>
    2.18 @@ -138,6 +146,22 @@
    2.19                      </run-dependency>
    2.20                  </dependency>
    2.21                  <dependency>
    2.22 +                    <code-name-base>org.openide.util.lookup</code-name-base>
    2.23 +                    <build-prerequisite/>
    2.24 +                    <compile-dependency/>
    2.25 +                    <run-dependency>
    2.26 +                        <specification-version>8.32</specification-version>
    2.27 +                    </run-dependency>
    2.28 +                </dependency>
    2.29 +                <dependency>
    2.30 +                    <code-name-base>org.openide.util.ui</code-name-base>
    2.31 +                    <build-prerequisite/>
    2.32 +                    <compile-dependency/>
    2.33 +                    <run-dependency>
    2.34 +                        <specification-version>9.4</specification-version>
    2.35 +                    </run-dependency>
    2.36 +                </dependency>
    2.37 +                <dependency>
    2.38                      <code-name-base>org.openide.windows</code-name-base>
    2.39                      <build-prerequisite/>
    2.40                      <compile-dependency/>
     3.1 --- a/zeroadmin/server/build.xml	Tue Oct 20 01:33:34 2015 -0500
     3.2 +++ b/zeroadmin/server/build.xml	Mon Oct 26 22:29:45 2015 -0400
     3.3 @@ -2,6 +2,11 @@
     3.4  <!-- You may freely edit this file. See commented blocks below for -->
     3.5  <!-- some examples of how to customize the build. -->
     3.6  <!-- (If you delete it and reopen the project it will be recreated.) -->
     3.7 +<!-- By default, only the Clean and Build commands use this build script. -->
     3.8 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
     3.9 +<!-- the Compile on Save feature is turned off for the project. -->
    3.10 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    3.11 +<!-- in the project's Project Properties dialog box.-->
    3.12  <project name="server" default="default" basedir=".">
    3.13      <description>Builds, tests, and runs the project server.</description>
    3.14      <import file="nbproject/build-impl.xml"/>
    3.15 @@ -21,8 +26,8 @@
    3.16        -post-compile-test:        called after javac compilation of JUnit tests
    3.17        -pre-compile-test-single:  called before javac compilation of single JUnit test
    3.18        -post-compile-test-single: called after javac compilation of single JUunit test
    3.19 -      -pre-dist:                 called before jar building 
    3.20 -      -post-dist:                called after jar building 
    3.21 +      -pre-dist:                 called before archive building 
    3.22 +      -post-dist:                called after archive building 
    3.23        -post-clean:               called after cleaning build products 
    3.24        -pre-run-deploy:           called before deploying
    3.25        -post-run-deploy:          called after deploying
    3.26 @@ -45,7 +50,7 @@
    3.27        init-macrodef-javac:    defines macro for javac compilation
    3.28        init-macrodef-junit:   defines macro for junit execution
    3.29        init-macrodef-debug:    defines macro for class debugging
    3.30 -      do-dist:                jar archive building
    3.31 +      do-dist:                archive building
    3.32        run:                    execution of project 
    3.33        javadoc-build:          javadoc generation 
    3.34  
     4.1 --- a/zeroadmin/server/nbproject/build-impl.xml	Tue Oct 20 01:33:34 2015 -0500
     4.2 +++ b/zeroadmin/server/nbproject/build-impl.xml	Mon Oct 26 22:29:45 2015 -0400
     4.3 @@ -11,14 +11,21 @@
     4.4          - execution
     4.5          - debugging
     4.6          - javadoc
     4.7 -        - junit compilation
     4.8 -        - junit execution
     4.9 -        - junit debugging
    4.10 +        - test compilation
    4.11 +        - test execution
    4.12 +        - test debugging
    4.13          - cleanup
    4.14  
    4.15          -->
    4.16 -<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="build" name="server-impl">
    4.17 +<project xmlns:webproject1="http://www.netbeans.org/ns/web-project/1" xmlns:webproject2="http://www.netbeans.org/ns/web-project/2" xmlns:webproject3="http://www.netbeans.org/ns/web-project/3" basedir=".." default="default" name="server-impl">
    4.18      <import file="ant-deploy.xml"/>
    4.19 +    <fail message="Please build using Ant 1.7.1 or higher.">
    4.20 +        <condition>
    4.21 +            <not>
    4.22 +                <antversion atleast="1.7.1"/>
    4.23 +            </not>
    4.24 +        </condition>
    4.25 +    </fail>
    4.26      <target depends="dist,javadoc" description="Build whole project." name="default"/>
    4.27      <!--
    4.28                  INITIALIZATION SECTION
    4.29 @@ -40,12 +47,8 @@
    4.30      <target depends="-pre-init,-init-private,-init-user" name="-init-project">
    4.31          <property file="nbproject/project.properties"/>
    4.32      </target>
    4.33 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init">
    4.34 -        <property name="build.meta.inf.dir" value="${build.ear.web.dir}/META-INF"/>
    4.35 -        <property name="build.classes.dir.real" value="${build.ear.classes.dir}"/>
    4.36 -        <property name="build.web.dir.real" value="${build.ear.web.dir}"/>
    4.37 -    </target>
    4.38 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property,-do-ear-init" name="-do-init">
    4.39 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" if="dist.ear.dir" name="-do-ear-init"/>
    4.40 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property" name="-do-init">
    4.41          <condition property="have.tests">
    4.42              <or>
    4.43                  <available file="${test.src.dir}"/>
    4.44 @@ -80,11 +83,50 @@
    4.45          <condition property="do.compile.jsps">
    4.46              <istrue value="${compile.jsps}"/>
    4.47          </condition>
    4.48 +        <condition property="do.debug.server">
    4.49 +            <or>
    4.50 +                <not>
    4.51 +                    <isset property="debug.server"/>
    4.52 +                </not>
    4.53 +                <istrue value="${debug.server}"/>
    4.54 +                <and>
    4.55 +                    <not>
    4.56 +                        <istrue value="${debug.server}"/>
    4.57 +                    </not>
    4.58 +                    <not>
    4.59 +                        <istrue value="${debug.client}"/>
    4.60 +                    </not>
    4.61 +                </and>
    4.62 +            </or>
    4.63 +        </condition>
    4.64 +        <condition property="do.debug.client">
    4.65 +            <istrue value="${debug.client}"/>
    4.66 +        </condition>
    4.67          <condition property="do.display.browser">
    4.68              <istrue value="${display.browser}"/>
    4.69          </condition>
    4.70 +        <condition property="do.display.browser.debug.old">
    4.71 +            <and>
    4.72 +                <isset property="do.display.browser"/>
    4.73 +                <not>
    4.74 +                    <isset property="do.debug.client"/>
    4.75 +                </not>
    4.76 +                <not>
    4.77 +                    <isset property="browser.context"/>
    4.78 +                </not>
    4.79 +            </and>
    4.80 +        </condition>
    4.81 +        <condition property="do.display.browser.debug">
    4.82 +            <and>
    4.83 +                <isset property="do.display.browser"/>
    4.84 +                <not>
    4.85 +                    <isset property="do.debug.client"/>
    4.86 +                </not>
    4.87 +                <isset property="browser.context"/>
    4.88 +            </and>
    4.89 +        </condition>
    4.90          <available file="${conf.dir}/MANIFEST.MF" property="has.custom.manifest"/>
    4.91 -        <available file="${conf.dir}/persistence.xml" property="has.persistence.xml"/>
    4.92 +        <available file="${persistence.xml.dir}/persistence.xml" property="has.persistence.xml"/>
    4.93          <condition property="do.war.package.with.custom.manifest">
    4.94              <isset property="has.custom.manifest"/>
    4.95          </condition>
    4.96 @@ -96,7 +138,10 @@
    4.97          <condition property="do.tmp.war.package.with.custom.manifest">
    4.98              <and>
    4.99                  <isset property="has.custom.manifest"/>
   4.100 -                <isfalse value="${directory.deployment.supported}"/>
   4.101 +                <or>
   4.102 +                    <isfalse value="${directory.deployment.supported}"/>
   4.103 +                    <isset property="dist.ear.dir"/>
   4.104 +                </or>
   4.105              </and>
   4.106          </condition>
   4.107          <condition property="do.tmp.war.package.without.custom.manifest">
   4.108 @@ -104,12 +149,19 @@
   4.109                  <not>
   4.110                      <isset property="has.custom.manifest"/>
   4.111                  </not>
   4.112 -                <isfalse value="${directory.deployment.supported}"/>
   4.113 +                <or>
   4.114 +                    <isfalse value="${directory.deployment.supported}"/>
   4.115 +                    <isset property="dist.ear.dir"/>
   4.116 +                </or>
   4.117              </and>
   4.118          </condition>
   4.119 +        <condition property="do.tmp.war.package">
   4.120 +            <or>
   4.121 +                <isfalse value="${directory.deployment.supported}"/>
   4.122 +                <isset property="dist.ear.dir"/>
   4.123 +            </or>
   4.124 +        </condition>
   4.125          <property name="build.meta.inf.dir" value="${build.web.dir}/META-INF"/>
   4.126 -        <property name="build.classes.dir.real" value="${build.classes.dir}"/>
   4.127 -        <property name="build.web.dir.real" value="${build.web.dir}"/>
   4.128          <condition else="" property="application.args.param" value="${application.args}">
   4.129              <and>
   4.130                  <isset property="application.args"/>
   4.131 @@ -128,6 +180,54 @@
   4.132              </and>
   4.133          </condition>
   4.134          <property name="javadoc.encoding.used" value="${source.encoding}"/>
   4.135 +        <property name="includes" value="**"/>
   4.136 +        <property name="excludes" value=""/>
   4.137 +        <property name="runmain.jvmargs" value=""/>
   4.138 +        <path id="endorsed.classpath.path" path="${endorsed.classpath}"/>
   4.139 +        <condition else="" property="endorsed.classpath.cmd.line.arg" value="-Xbootclasspath/p:'${toString:endorsed.classpath.path}'">
   4.140 +            <and>
   4.141 +                <isset property="endorsed.classpath"/>
   4.142 +                <length length="0" string="${endorsed.classpath}" when="greater"/>
   4.143 +            </and>
   4.144 +        </condition>
   4.145 +        <condition else="false" property="jdkBug6558476">
   4.146 +            <and>
   4.147 +                <matches pattern="1\.[56]" string="${java.specification.version}"/>
   4.148 +                <not>
   4.149 +                    <os family="unix"/>
   4.150 +                </not>
   4.151 +            </and>
   4.152 +        </condition>
   4.153 +        <property name="javac.fork" value="${jdkBug6558476}"/>
   4.154 +        <condition property="junit.available">
   4.155 +            <or>
   4.156 +                <available classname="org.junit.Test" classpath="${run.test.classpath}"/>
   4.157 +                <available classname="junit.framework.Test" classpath="${run.test.classpath}"/>
   4.158 +            </or>
   4.159 +        </condition>
   4.160 +        <condition property="testng.available">
   4.161 +            <available classname="org.testng.annotations.Test" classpath="${run.test.classpath}"/>
   4.162 +        </condition>
   4.163 +        <condition property="junit+testng.available">
   4.164 +            <and>
   4.165 +                <istrue value="${junit.available}"/>
   4.166 +                <istrue value="${testng.available}"/>
   4.167 +            </and>
   4.168 +        </condition>
   4.169 +        <condition else="testng" property="testng.mode" value="mixed">
   4.170 +            <istrue value="${junit+testng.available}"/>
   4.171 +        </condition>
   4.172 +        <condition else="" property="testng.debug.mode" value="-mixed">
   4.173 +            <istrue value="${junit+testng.available}"/>
   4.174 +        </condition>
   4.175 +    </target>
   4.176 +    <target depends="init" name="-init-cos" unless="deploy.on.save">
   4.177 +        <condition property="deploy.on.save" value="true">
   4.178 +            <or>
   4.179 +                <istrue value="${j2ee.deploy.on.save}"/>
   4.180 +                <istrue value="${j2ee.compile.on.save}"/>
   4.181 +            </or>
   4.182 +        </condition>
   4.183      </target>
   4.184      <target name="-post-init">
   4.185          <!-- Empty placeholder for easier customization. -->
   4.186 @@ -146,6 +246,27 @@
   4.187          <fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
   4.188          <fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
   4.189          <fail unless="dist.war">Must set dist.war</fail>
   4.190 +        <condition property="missing.j2ee.server.home">
   4.191 +            <and>
   4.192 +                <matches pattern="j2ee.server.home" string="${j2ee.platform.classpath}"/>
   4.193 +                <not>
   4.194 +                    <isset property="j2ee.server.home"/>
   4.195 +                </not>
   4.196 +            </and>
   4.197 +        </condition>
   4.198 +        <fail if="missing.j2ee.server.home">
   4.199 +The Java EE server classpath is not correctly set up - server home directory is missing.
   4.200 +Either open the project in the IDE and assign the server or setup the server classpath manually.
   4.201 +For example like this:
   4.202 +   ant -Dj2ee.server.home=&lt;app_server_installation_directory&gt;
   4.203 +                </fail>
   4.204 +        <fail unless="j2ee.platform.classpath">
   4.205 +The Java EE server classpath is not correctly set up. Your active server type is ${j2ee.server.type}.
   4.206 +Either open the project in the IDE and assign the server or setup the server classpath manually.
   4.207 +For example like this:
   4.208 +   ant -Duser.properties.file=&lt;path_to_property_file&gt; (where you put the property "j2ee.platform.classpath" in a .properties file)
   4.209 +or ant -Dj2ee.platform.classpath=&lt;server_classpath&gt; (where no properties file is used)
   4.210 +                </fail>
   4.211      </target>
   4.212      <target name="-init-macrodef-property">
   4.213          <macrodef name="property" uri="http://www.netbeans.org/ns/web-project/1">
   4.214 @@ -156,55 +277,431 @@
   4.215              </sequential>
   4.216          </macrodef>
   4.217      </target>
   4.218 -    <target name="-init-macrodef-javac">
   4.219 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
   4.220          <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
   4.221              <attribute default="${src.dir}" name="srcdir"/>
   4.222 -            <attribute default="${build.classes.dir.real}" name="destdir"/>
   4.223 +            <attribute default="${build.classes.dir}" name="destdir"/>
   4.224              <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   4.225 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   4.226 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   4.227 +            <attribute default="${includes}" name="includes"/>
   4.228 +            <attribute default="${excludes}" name="excludes"/>
   4.229              <attribute default="${javac.debug}" name="debug"/>
   4.230 -            <attribute default="" name="javac.compilerargs.jaxws"/>
   4.231 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   4.232              <element name="customize" optional="true"/>
   4.233              <sequential>
   4.234 -                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" includeantruntime="false" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
   4.235 +                <property location="${build.dir}/empty" name="empty.dir"/>
   4.236 +                <mkdir dir="${empty.dir}"/>
   4.237 +                <mkdir dir="@{apgeneratedsrcdir}"/>
   4.238 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
   4.239 +                    <src>
   4.240 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   4.241 +                            <include name="*"/>
   4.242 +                        </dirset>
   4.243 +                    </src>
   4.244                      <classpath>
   4.245                          <path path="@{classpath}"/>
   4.246                      </classpath>
   4.247 -                    <compilerarg line="${javac.compilerargs} @{javac.compilerargs.jaxws}"/>
   4.248 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.249 +                    <compilerarg line="${javac.compilerargs}"/>
   4.250 +                    <compilerarg value="-processorpath"/>
   4.251 +                    <compilerarg path="@{processorpath}:${empty.dir}"/>
   4.252 +                    <compilerarg line="${ap.processors.internal}"/>
   4.253 +                    <compilerarg value="-s"/>
   4.254 +                    <compilerarg path="@{apgeneratedsrcdir}"/>
   4.255 +                    <compilerarg line="${ap.proc.none.internal}"/>
   4.256                      <customize/>
   4.257                  </javac>
   4.258              </sequential>
   4.259          </macrodef>
   4.260      </target>
   4.261 -    <target name="-init-macrodef-junit">
   4.262 +    <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
   4.263 +        <macrodef name="javac" uri="http://www.netbeans.org/ns/web-project/2">
   4.264 +            <attribute default="${src.dir}" name="srcdir"/>
   4.265 +            <attribute default="${build.classes.dir}" name="destdir"/>
   4.266 +            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   4.267 +            <attribute default="${javac.processorpath}" name="processorpath"/>
   4.268 +            <attribute default="${build.generated.sources.dir}/ap-source-output" name="apgeneratedsrcdir"/>
   4.269 +            <attribute default="${includes}" name="includes"/>
   4.270 +            <attribute default="${excludes}" name="excludes"/>
   4.271 +            <attribute default="${javac.debug}" name="debug"/>
   4.272 +            <attribute default="${empty.dir}" name="gensrcdir"/>
   4.273 +            <element name="customize" optional="true"/>
   4.274 +            <sequential>
   4.275 +                <property location="${build.dir}/empty" name="empty.dir"/>
   4.276 +                <mkdir dir="${empty.dir}"/>
   4.277 +                <javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" includeantruntime="false" includes="@{includes}" source="${javac.source}" srcdir="@{srcdir}" target="${javac.target}">
   4.278 +                    <src>
   4.279 +                        <dirset dir="@{gensrcdir}" erroronmissingdir="false">
   4.280 +                            <include name="*"/>
   4.281 +                        </dirset>
   4.282 +                    </src>
   4.283 +                    <classpath>
   4.284 +                        <path path="@{classpath}"/>
   4.285 +                    </classpath>
   4.286 +                    <compilerarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.287 +                    <compilerarg line="${javac.compilerargs}"/>
   4.288 +                    <customize/>
   4.289 +                </javac>
   4.290 +            </sequential>
   4.291 +        </macrodef>
   4.292 +    </target>
   4.293 +    <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
   4.294 +        <macrodef name="depend" uri="http://www.netbeans.org/ns/web-project/2">
   4.295 +            <attribute default="${src.dir}" name="srcdir"/>
   4.296 +            <attribute default="${build.classes.dir}" name="destdir"/>
   4.297 +            <attribute default="${javac.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   4.298 +            <sequential>
   4.299 +                <depend cache="${build.dir}/depcache" destdir="@{destdir}" excludes="${excludes}" includes="${includes}" srcdir="@{srcdir}">
   4.300 +                    <classpath>
   4.301 +                        <path path="@{classpath}"/>
   4.302 +                    </classpath>
   4.303 +                </depend>
   4.304 +            </sequential>
   4.305 +        </macrodef>
   4.306 +        <macrodef name="force-recompile" uri="http://www.netbeans.org/ns/web-project/2">
   4.307 +            <attribute default="${build.classes.dir}" name="destdir"/>
   4.308 +            <sequential>
   4.309 +                <fail unless="javac.includes">Must set javac.includes</fail>
   4.310 +                <pathconvert pathsep="${line.separator}" property="javac.includes.binary">
   4.311 +                    <path>
   4.312 +                        <filelist dir="@{destdir}" files="${javac.includes}"/>
   4.313 +                    </path>
   4.314 +                    <globmapper from="*.java" to="*.class"/>
   4.315 +                </pathconvert>
   4.316 +                <tempfile deleteonexit="true" property="javac.includesfile.binary"/>
   4.317 +                <echo file="${javac.includesfile.binary}" message="${javac.includes.binary}"/>
   4.318 +                <delete>
   4.319 +                    <files includesfile="${javac.includesfile.binary}"/>
   4.320 +                </delete>
   4.321 +                <delete file="${javac.includesfile.binary}"/>
   4.322 +            </sequential>
   4.323 +        </macrodef>
   4.324 +    </target>
   4.325 +    <target if="${junit.available}" name="-init-macrodef-junit-init">
   4.326 +        <condition else="false" property="nb.junit.batch" value="true">
   4.327 +            <and>
   4.328 +                <istrue value="${junit.available}"/>
   4.329 +                <not>
   4.330 +                    <isset property="test.method"/>
   4.331 +                </not>
   4.332 +            </and>
   4.333 +        </condition>
   4.334 +        <condition else="false" property="nb.junit.single" value="true">
   4.335 +            <and>
   4.336 +                <istrue value="${junit.available}"/>
   4.337 +                <isset property="test.method"/>
   4.338 +            </and>
   4.339 +        </condition>
   4.340 +    </target>
   4.341 +    <target name="-init-test-properties">
   4.342 +        <property name="test.binaryincludes" value="&lt;nothing&gt;"/>
   4.343 +        <property name="test.binarytestincludes" value=""/>
   4.344 +        <property name="test.binaryexcludes" value=""/>
   4.345 +    </target>
   4.346 +    <target if="${nb.junit.single}" name="-init-macrodef-junit-single" unless="${nb.junit.batch}">
   4.347          <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
   4.348 -            <attribute default="**/*Test.java" name="includes"/>
   4.349 +            <attribute default="${includes}" name="includes"/>
   4.350 +            <attribute default="${excludes}" name="excludes"/>
   4.351 +            <attribute default="**" name="testincludes"/>
   4.352 +            <attribute default="" name="testmethods"/>
   4.353 +            <element name="customize" optional="true"/>
   4.354              <sequential>
   4.355 -                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true">
   4.356 -                    <batchtest todir="${build.test.results.dir}">
   4.357 -                        <fileset dir="${test.src.dir}" includes="@{includes}"/>
   4.358 -                    </batchtest>
   4.359 -                    <classpath>
   4.360 -                        <path path="${run.test.classpath}"/>
   4.361 -                    </classpath>
   4.362 +                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
   4.363 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   4.364                      <syspropertyset>
   4.365                          <propertyref prefix="test-sys-prop."/>
   4.366                          <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.367                      </syspropertyset>
   4.368                      <formatter type="brief" usefile="false"/>
   4.369                      <formatter type="xml"/>
   4.370 +                    <jvmarg value="-ea"/>
   4.371 +                    <customize/>
   4.372                  </junit>
   4.373              </sequential>
   4.374          </macrodef>
   4.375      </target>
   4.376 +    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-batch" unless="${nb.junit.single}">
   4.377 +        <macrodef name="junit" uri="http://www.netbeans.org/ns/web-project/2">
   4.378 +            <attribute default="${includes}" name="includes"/>
   4.379 +            <attribute default="${excludes}" name="excludes"/>
   4.380 +            <attribute default="**" name="testincludes"/>
   4.381 +            <attribute default="" name="testmethods"/>
   4.382 +            <element name="customize" optional="true"/>
   4.383 +            <sequential>
   4.384 +                <property name="run.jvmargs.ide" value=""/>
   4.385 +                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
   4.386 +                    <batchtest todir="${build.test.results.dir}">
   4.387 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   4.388 +                            <filename name="@{testincludes}"/>
   4.389 +                        </fileset>
   4.390 +                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   4.391 +                            <filename name="${test.binarytestincludes}"/>
   4.392 +                        </fileset>
   4.393 +                    </batchtest>
   4.394 +                    <syspropertyset>
   4.395 +                        <propertyref prefix="test-sys-prop."/>
   4.396 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.397 +                    </syspropertyset>
   4.398 +                    <formatter type="brief" usefile="false"/>
   4.399 +                    <formatter type="xml"/>
   4.400 +                    <jvmarg value="-ea"/>
   4.401 +                    <jvmarg line="${run.jvmargs.ide}"/>
   4.402 +                    <customize/>
   4.403 +                </junit>
   4.404 +            </sequential>
   4.405 +        </macrodef>
   4.406 +    </target>
   4.407 +    <target depends="-init-macrodef-junit-init,-init-macrodef-junit-single, -init-macrodef-junit-batch" if="${junit.available}" name="-init-macrodef-junit"/>
   4.408 +    <target if="${testng.available}" name="-init-macrodef-testng">
   4.409 +        <macrodef name="testng" uri="http://www.netbeans.org/ns/web-project/2">
   4.410 +            <attribute default="${includes}" name="includes"/>
   4.411 +            <attribute default="${excludes}" name="excludes"/>
   4.412 +            <attribute default="**" name="testincludes"/>
   4.413 +            <attribute default="" name="testmethods"/>
   4.414 +            <element name="customize" optional="true"/>
   4.415 +            <sequential>
   4.416 +                <condition else="" property="testng.methods.arg" value="@{testincludes}.@{testmethods}">
   4.417 +                    <isset property="test.method"/>
   4.418 +                </condition>
   4.419 +                <union id="test.set">
   4.420 +                    <fileset dir="${test.src.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
   4.421 +                        <filename name="@{testincludes}"/>
   4.422 +                    </fileset>
   4.423 +                </union>
   4.424 +                <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/>
   4.425 +                <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="server" testname="TestNG tests" workingDir="${basedir}">
   4.426 +                    <xmlfileset dir="${build.test.classes.dir}" includes="@{testincludes}"/>
   4.427 +                    <propertyset>
   4.428 +                        <propertyref prefix="test-sys-prop."/>
   4.429 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.430 +                    </propertyset>
   4.431 +                    <customize/>
   4.432 +                </testng>
   4.433 +            </sequential>
   4.434 +        </macrodef>
   4.435 +    </target>
   4.436 +    <target name="-init-macrodef-test-impl">
   4.437 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
   4.438 +            <attribute default="${includes}" name="includes"/>
   4.439 +            <attribute default="${excludes}" name="excludes"/>
   4.440 +            <attribute default="**" name="testincludes"/>
   4.441 +            <attribute default="" name="testmethods"/>
   4.442 +            <element implicit="true" name="customize" optional="true"/>
   4.443 +            <sequential>
   4.444 +                <echo>No tests executed.</echo>
   4.445 +            </sequential>
   4.446 +        </macrodef>
   4.447 +    </target>
   4.448 +    <target depends="-init-macrodef-junit" if="${junit.available}" name="-init-macrodef-junit-impl">
   4.449 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
   4.450 +            <attribute default="${includes}" name="includes"/>
   4.451 +            <attribute default="${excludes}" name="excludes"/>
   4.452 +            <attribute default="**" name="testincludes"/>
   4.453 +            <attribute default="" name="testmethods"/>
   4.454 +            <element implicit="true" name="customize" optional="true"/>
   4.455 +            <sequential>
   4.456 +                <webproject2:junit excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   4.457 +                    <customize/>
   4.458 +                </webproject2:junit>
   4.459 +            </sequential>
   4.460 +        </macrodef>
   4.461 +    </target>
   4.462 +    <target depends="-init-macrodef-testng" if="${testng.available}" name="-init-macrodef-testng-impl">
   4.463 +        <macrodef name="test-impl" uri="http://www.netbeans.org/ns/web-project/2">
   4.464 +            <attribute default="${includes}" name="includes"/>
   4.465 +            <attribute default="${excludes}" name="excludes"/>
   4.466 +            <attribute default="**" name="testincludes"/>
   4.467 +            <attribute default="" name="testmethods"/>
   4.468 +            <element implicit="true" name="customize" optional="true"/>
   4.469 +            <sequential>
   4.470 +                <webproject2:testng excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   4.471 +                    <customize/>
   4.472 +                </webproject2:testng>
   4.473 +            </sequential>
   4.474 +        </macrodef>
   4.475 +    </target>
   4.476 +    <target depends="-init-macrodef-test-impl,-init-macrodef-junit-impl,-init-macrodef-testng-impl" name="-init-macrodef-test">
   4.477 +        <macrodef name="test" uri="http://www.netbeans.org/ns/web-project/2">
   4.478 +            <attribute default="${includes}" name="includes"/>
   4.479 +            <attribute default="${excludes}" name="excludes"/>
   4.480 +            <attribute default="**" name="testincludes"/>
   4.481 +            <attribute default="" name="testmethods"/>
   4.482 +            <sequential>
   4.483 +                <webproject2:test-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   4.484 +                    <customize>
   4.485 +                        <classpath>
   4.486 +                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
   4.487 +                        </classpath>
   4.488 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.489 +                        <jvmarg line="${runmain.jvmargs}"/>
   4.490 +                    </customize>
   4.491 +                </webproject2:test-impl>
   4.492 +            </sequential>
   4.493 +        </macrodef>
   4.494 +    </target>
   4.495 +    <target if="${junit.available}" name="-init-macrodef-junit-debug" unless="${nb.junit.batch}">
   4.496 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
   4.497 +            <attribute default="${includes}" name="includes"/>
   4.498 +            <attribute default="${excludes}" name="excludes"/>
   4.499 +            <attribute default="**" name="testincludes"/>
   4.500 +            <attribute default="" name="testmethods"/>
   4.501 +            <element name="customize" optional="true"/>
   4.502 +            <sequential>
   4.503 +                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${java.io.tmpdir}">
   4.504 +                    <test methods="@{testmethods}" name="@{testincludes}" todir="${build.test.results.dir}"/>
   4.505 +                    <syspropertyset>
   4.506 +                        <propertyref prefix="test-sys-prop."/>
   4.507 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.508 +                    </syspropertyset>
   4.509 +                    <formatter type="brief" usefile="false"/>
   4.510 +                    <formatter type="xml"/>
   4.511 +                    <jvmarg value="-ea"/>
   4.512 +                    <jvmarg line="${debug-args-line}"/>
   4.513 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   4.514 +                    <customize/>
   4.515 +                </junit>
   4.516 +            </sequential>
   4.517 +        </macrodef>
   4.518 +    </target>
   4.519 +    <target depends="-init-test-properties" if="${nb.junit.batch}" name="-init-macrodef-junit-debug-batch">
   4.520 +        <macrodef name="junit-debug" uri="http://www.netbeans.org/ns/web-project/2">
   4.521 +            <attribute default="${includes}" name="includes"/>
   4.522 +            <attribute default="${excludes}" name="excludes"/>
   4.523 +            <attribute default="**" name="testincludes"/>
   4.524 +            <attribute default="" name="testmethods"/>
   4.525 +            <element name="customize" optional="true"/>
   4.526 +            <sequential>
   4.527 +                <property name="run.jvmargs.ide" value=""/>
   4.528 +                <junit dir="${basedir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" showoutput="true" tempdir="${build.dir}">
   4.529 +                    <batchtest todir="${build.test.results.dir}">
   4.530 +                        <fileset dir="${test.src.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
   4.531 +                            <filename name="@{testincludes}"/>
   4.532 +                        </fileset>
   4.533 +                        <fileset dir="${build.test.classes.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}">
   4.534 +                            <filename name="${test.binarytestincludes}"/>
   4.535 +                        </fileset>
   4.536 +                    </batchtest>
   4.537 +                    <syspropertyset>
   4.538 +                        <propertyref prefix="test-sys-prop."/>
   4.539 +                        <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.540 +                    </syspropertyset>
   4.541 +                    <formatter type="brief" usefile="false"/>
   4.542 +                    <formatter type="xml"/>
   4.543 +                    <jvmarg value="-ea"/>
   4.544 +                    <jvmarg line="${run.jvmargs.ide}"/>
   4.545 +                    <jvmarg line="${debug-args-line}"/>
   4.546 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   4.547 +                    <customize/>
   4.548 +                </junit>
   4.549 +            </sequential>
   4.550 +        </macrodef>
   4.551 +    </target>
   4.552 +    <target depends="-init-macrodef-junit-debug,-init-macrodef-junit-debug-batch" if="${junit.available}" name="-init-macrodef-junit-debug-impl">
   4.553 +        <macrodef name="test-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
   4.554 +            <attribute default="${includes}" name="includes"/>
   4.555 +            <attribute default="${excludes}" name="excludes"/>
   4.556 +            <attribute default="**" name="testincludes"/>
   4.557 +            <attribute default="" name="testmethods"/>
   4.558 +            <element implicit="true" name="customize" optional="true"/>
   4.559 +            <sequential>
   4.560 +                <webproject2:junit-debug excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   4.561 +                    <customize/>
   4.562 +                </webproject2:junit-debug>
   4.563 +            </sequential>
   4.564 +        </macrodef>
   4.565 +    </target>
   4.566 +    <target if="${testng.available}" name="-init-macrodef-testng-debug">
   4.567 +        <macrodef name="testng-debug" uri="http://www.netbeans.org/ns/web-project/2">
   4.568 +            <attribute default="${main.class}" name="testClass"/>
   4.569 +            <attribute default="" name="testMethod"/>
   4.570 +            <element name="customize2" optional="true"/>
   4.571 +            <sequential>
   4.572 +                <condition else="-testclass @{testClass}" property="test.class.or.method" value="-methods @{testClass}.@{testMethod}">
   4.573 +                    <isset property="test.method"/>
   4.574 +                </condition>
   4.575 +                <condition else="-suitename server -testname @{testClass} ${test.class.or.method}" property="testng.cmd.args" value="@{testClass}">
   4.576 +                    <matches pattern=".*\.xml" string="@{testClass}"/>
   4.577 +                </condition>
   4.578 +                <delete dir="${build.test.results.dir}" quiet="true"/>
   4.579 +                <mkdir dir="${build.test.results.dir}"/>
   4.580 +                <webproject1:debug args="${testng.cmd.args}" classname="org.testng.TestNG" classpath="${debug.test.classpath}:${j2ee.platform.embeddableejb.classpath}">
   4.581 +                    <customize>
   4.582 +                        <customize2/>
   4.583 +                        <jvmarg value="-ea"/>
   4.584 +                        <arg line="${testng.debug.mode}"/>
   4.585 +                        <arg line="-d ${build.test.results.dir}"/>
   4.586 +                        <arg line="-listener org.testng.reporters.VerboseReporter"/>
   4.587 +                    </customize>
   4.588 +                </webproject1:debug>
   4.589 +            </sequential>
   4.590 +        </macrodef>
   4.591 +    </target>
   4.592 +    <target depends="-init-macrodef-testng-debug" if="${testng.available}" name="-init-macrodef-testng-debug-impl">
   4.593 +        <macrodef name="testng-debug-impl" uri="http://www.netbeans.org/ns/web-project/2">
   4.594 +            <attribute default="${main.class}" name="testClass"/>
   4.595 +            <attribute default="" name="testMethod"/>
   4.596 +            <element implicit="true" name="customize2" optional="true"/>
   4.597 +            <sequential>
   4.598 +                <webproject2:testng-debug testClass="@{testClass}" testMethod="@{testMethod}">
   4.599 +                    <customize2/>
   4.600 +                </webproject2:testng-debug>
   4.601 +            </sequential>
   4.602 +        </macrodef>
   4.603 +    </target>
   4.604 +    <target depends="-init-macrodef-junit-debug-impl" if="${junit.available}" name="-init-macrodef-test-debug-junit">
   4.605 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
   4.606 +            <attribute default="${includes}" name="includes"/>
   4.607 +            <attribute default="${excludes}" name="excludes"/>
   4.608 +            <attribute default="**" name="testincludes"/>
   4.609 +            <attribute default="" name="testmethods"/>
   4.610 +            <attribute default="${main.class}" name="testClass"/>
   4.611 +            <attribute default="" name="testMethod"/>
   4.612 +            <sequential>
   4.613 +                <webproject2:test-debug-impl excludes="@{excludes}" includes="@{includes}" testincludes="@{testincludes}" testmethods="@{testmethods}">
   4.614 +                    <customize>
   4.615 +                        <classpath>
   4.616 +                            <path path="${run.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}"/>
   4.617 +                        </classpath>
   4.618 +                        <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.619 +                        <jvmarg line="${runmain.jvmargs}"/>
   4.620 +                    </customize>
   4.621 +                </webproject2:test-debug-impl>
   4.622 +            </sequential>
   4.623 +        </macrodef>
   4.624 +    </target>
   4.625 +    <target depends="-init-macrodef-testng-debug-impl" if="${testng.available}" name="-init-macrodef-test-debug-testng">
   4.626 +        <macrodef name="test-debug" uri="http://www.netbeans.org/ns/web-project/2">
   4.627 +            <attribute default="${includes}" name="includes"/>
   4.628 +            <attribute default="${excludes}" name="excludes"/>
   4.629 +            <attribute default="**" name="testincludes"/>
   4.630 +            <attribute default="" name="testmethods"/>
   4.631 +            <attribute default="${main.class}" name="testClass"/>
   4.632 +            <attribute default="" name="testMethod"/>
   4.633 +            <sequential>
   4.634 +                <webproject2:testng-debug-impl testClass="@{testClass}" testMethod="@{testMethod}">
   4.635 +                    <customize2>
   4.636 +                        <syspropertyset>
   4.637 +                            <propertyref prefix="test-sys-prop."/>
   4.638 +                            <mapper from="test-sys-prop.*" to="*" type="glob"/>
   4.639 +                        </syspropertyset>
   4.640 +                    </customize2>
   4.641 +                </webproject2:testng-debug-impl>
   4.642 +            </sequential>
   4.643 +        </macrodef>
   4.644 +    </target>
   4.645 +    <target depends="-init-macrodef-test-debug-junit,-init-macrodef-test-debug-testng" name="-init-macrodef-test-debug"/>
   4.646      <target name="-init-macrodef-java">
   4.647          <macrodef name="java" uri="http://www.netbeans.org/ns/web-project/1">
   4.648              <attribute default="${main.class}" name="classname"/>
   4.649 +            <attribute default="${debug.classpath}" name="classpath"/>
   4.650              <element name="customize" optional="true"/>
   4.651              <sequential>
   4.652                  <java classname="@{classname}" fork="true">
   4.653 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.654                      <jvmarg line="${runmain.jvmargs}"/>
   4.655                      <classpath>
   4.656 -                        <path path="${build.classes.dir.real}:${javac.classpath}:${j2ee.platform.classpath}"/>
   4.657 +                        <path path="@{classpath}:${j2ee.platform.classpath}"/>
   4.658                      </classpath>
   4.659                      <syspropertyset>
   4.660                          <propertyref prefix="run-sys-prop."/>
   4.661 @@ -215,12 +712,20 @@
   4.662              </sequential>
   4.663          </macrodef>
   4.664      </target>
   4.665 -    <target name="-init-macrodef-nbjpda">
   4.666 +    <target name="-init-macrodef-nbjsdebug">
   4.667 +        <macrodef name="nbjsdebugstart" uri="http://www.netbeans.org/ns/web-project/1">
   4.668 +            <attribute default="${client.url}" name="webUrl"/>
   4.669 +            <sequential>
   4.670 +                <nbjsdebugstart urlPart="${client.urlPart}" webUrl="@{webUrl}"/>
   4.671 +            </sequential>
   4.672 +        </macrodef>
   4.673 +    </target>
   4.674 +    <target depends="-init-debug-args" name="-init-macrodef-nbjpda">
   4.675          <macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/web-project/1">
   4.676              <attribute default="${main.class}" name="name"/>
   4.677 -            <attribute default="${debug.classpath}" name="classpath"/>
   4.678 +            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   4.679              <sequential>
   4.680 -                <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="dt_socket">
   4.681 +                <nbjpdastart addressproperty="jpda.address" name="@{name}" transport="${debug-transport}">
   4.682                      <classpath>
   4.683                          <path path="@{classpath}"/>
   4.684                      </classpath>
   4.685 @@ -228,13 +733,20 @@
   4.686              </sequential>
   4.687          </macrodef>
   4.688          <macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/web-project/1">
   4.689 -            <attribute default="${build.classes.dir.real}" name="dir"/>
   4.690 +            <attribute default="${build.classes.dir}" name="dir"/>
   4.691              <sequential>
   4.692                  <nbjpdareload>
   4.693 -                    <fileset dir="@{dir}" includes="${fix.includes}*.class"/>
   4.694 +                    <fileset dir="@{dir}" includes="${fix.classes}">
   4.695 +                        <include name="${fix.includes}*.class"/>
   4.696 +                    </fileset>
   4.697                  </nbjpdareload>
   4.698              </sequential>
   4.699          </macrodef>
   4.700 +        <macrodef name="nbjpdaappreloaded" uri="http://www.netbeans.org/ns/web-project/1">
   4.701 +            <sequential>
   4.702 +                <nbjpdaappreloaded/>
   4.703 +            </sequential>
   4.704 +        </macrodef>
   4.705      </target>
   4.706      <target name="-init-debug-args">
   4.707          <property name="version-output" value="java version &quot;${ant.java.version}"/>
   4.708 @@ -249,17 +761,24 @@
   4.709          <condition else="-Xdebug" property="debug-args-line" value="-Xdebug -Xnoagent -Djava.compiler=none">
   4.710              <istrue value="${have-jdk-older-than-1.4}"/>
   4.711          </condition>
   4.712 +        <condition else="dt_socket" property="debug-transport-by-os" value="dt_shmem">
   4.713 +            <os family="windows"/>
   4.714 +        </condition>
   4.715 +        <condition else="${debug-transport-by-os}" property="debug-transport" value="${debug.transport}">
   4.716 +            <isset property="debug.transport"/>
   4.717 +        </condition>
   4.718      </target>
   4.719      <target depends="-init-debug-args" name="-init-macrodef-debug">
   4.720          <macrodef name="debug" uri="http://www.netbeans.org/ns/web-project/1">
   4.721              <attribute default="${main.class}" name="classname"/>
   4.722 -            <attribute default="${debug.classpath}" name="classpath"/>
   4.723 +            <attribute default="${debug.classpath}:${j2ee.platform.classpath}" name="classpath"/>
   4.724              <attribute default="${application.args.param}" name="args"/>
   4.725              <element name="customize" optional="true"/>
   4.726              <sequential>
   4.727                  <java classname="@{classname}" fork="true">
   4.728 +                    <jvmarg line="${endorsed.classpath.cmd.line.arg}"/>
   4.729                      <jvmarg line="${debug-args-line}"/>
   4.730 -                    <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
   4.731 +                    <jvmarg value="-Xrunjdwp:transport=${debug-transport},address=${jpda.address}"/>
   4.732                      <jvmarg line="${runmain.jvmargs}"/>
   4.733                      <classpath>
   4.734                          <path path="@{classpath}"/>
   4.735 @@ -274,38 +793,62 @@
   4.736              </sequential>
   4.737          </macrodef>
   4.738      </target>
   4.739 -    <target name="-init-macrodef-copy-ear-war">
   4.740 -        <macrodef name="copy-ear-war">
   4.741 -            <attribute name="file"/>
   4.742 -            <attribute name="propname"/>
   4.743 -            <sequential>
   4.744 -                <basename file="@{file}" property="base_@{propname}"/>
   4.745 -                <zipfileset id="tld.files_@{propname}" includes="META-INF/*.tld META-INF/tlds/*.tld" src="@{file}"/>
   4.746 -                <pathconvert property="tld.files.path_@{propname}" refid="tld.files_@{propname}"/>
   4.747 -                <condition property="hastlds_@{propname}" value="yes">
   4.748 -                    <contains casesensitive="false" string="${tld.files.path_@{propname}}" substring=".tld"/>
   4.749 -                </condition>
   4.750 -                <condition property="copy.to.dir_@{propname}" value="${build.web.dir.real}/WEB-INF/lib">
   4.751 -                    <isset property="hastlds_@{propname}"/>
   4.752 -                </condition>
   4.753 -                <condition property="copy.to.dir_@{propname}" value="${dist.ear.dir}">
   4.754 -                    <not>
   4.755 -                        <isset property="hastlds_@{propname}"/>
   4.756 -                    </not>
   4.757 -                </condition>
   4.758 -                <copy file="@{file}" todir="${copy.to.dir_@{propname}}"/>
   4.759 -                <condition property="@{propname}" value="${base_@{propname}}">
   4.760 -                    <not>
   4.761 -                        <isset property="hastlds_@{propname}"/>
   4.762 -                    </not>
   4.763 -                </condition>
   4.764 -                <condition property="@{propname}" value="">
   4.765 -                    <isset property="hastlds_@{propname}"/>
   4.766 -                </condition>
   4.767 -            </sequential>
   4.768 -        </macrodef>
   4.769 +    <target name="-init-taskdefs">
   4.770 +        <fail unless="libs.CopyLibs.classpath">
   4.771 +The libs.CopyLibs.classpath property is not set up.
   4.772 +This property must point to 
   4.773 +org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part
   4.774 +of NetBeans IDE installation and is usually located at 
   4.775 +&lt;netbeans_installation&gt;/java&lt;version&gt;/ant/extra folder.
   4.776 +Either open the project in the IDE and make sure CopyLibs library
   4.777 +exists or setup the property manually. For example like this:
   4.778 + ant -Dlibs.CopyLibs.classpath=a/path/to/org-netbeans-modules-java-j2seproject-copylibstask.jar
   4.779 +                </fail>
   4.780 +        <taskdef classpath="${libs.CopyLibs.classpath}" resource="org/netbeans/modules/java/j2seproject/copylibstask/antlib.xml"/>
   4.781      </target>
   4.782 -    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-copy-ear-war" name="init"/>
   4.783 +    <target name="-init-ap-cmdline-properties">
   4.784 +        <property name="annotation.processing.enabled" value="true"/>
   4.785 +        <property name="annotation.processing.processors.list" value=""/>
   4.786 +        <property name="annotation.processing.run.all.processors" value="true"/>
   4.787 +        <property name="javac.processorpath" value="${javac.classpath}"/>
   4.788 +        <property name="javac.test.processorpath" value="${javac.test.classpath}"/>
   4.789 +        <condition property="ap.supported.internal" value="true">
   4.790 +            <not>
   4.791 +                <matches pattern="1\.[0-5](\..*)?" string="${javac.source}"/>
   4.792 +            </not>
   4.793 +        </condition>
   4.794 +    </target>
   4.795 +    <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-ap-cmdline-supported">
   4.796 +        <condition else="" property="ap.processors.internal" value="-processor ${annotation.processing.processors.list}">
   4.797 +            <isfalse value="${annotation.processing.run.all.processors}"/>
   4.798 +        </condition>
   4.799 +        <condition else="" property="ap.proc.none.internal" value="-proc:none">
   4.800 +            <isfalse value="${annotation.processing.enabled}"/>
   4.801 +        </condition>
   4.802 +    </target>
   4.803 +    <target depends="-init-ap-cmdline-properties,-init-ap-cmdline-supported" name="-init-ap-cmdline">
   4.804 +        <property name="ap.cmd.line.internal" value=""/>
   4.805 +    </target>
   4.806 +    <!--
   4.807 +                pre NB7.2 profiling section; consider it deprecated
   4.808 +            -->
   4.809 +    <target depends="-profile-pre-init, init, -profile-post-init, -profile-init-check" if="profiler.info.jvmargs.agent" name="profile-init"/>
   4.810 +    <target if="profiler.info.jvmargs.agent" name="-profile-pre-init">
   4.811 +        <!-- Empty placeholder for easier customization. -->
   4.812 +        <!-- You can override this target in the ../build.xml file. -->
   4.813 +    </target>
   4.814 +    <target if="profiler.info.jvmargs.agent" name="-profile-post-init">
   4.815 +        <!-- Empty placeholder for easier customization. -->
   4.816 +        <!-- You can override this target in the ../build.xml file. -->
   4.817 +    </target>
   4.818 +    <target depends="-profile-pre-init, init, -profile-post-init" if="profiler.info.jvmargs.agent" name="-profile-init-check">
   4.819 +        <fail unless="profiler.info.jvm">Must set JVM to use for profiling in profiler.info.jvm</fail>
   4.820 +        <fail unless="profiler.info.jvmargs.agent">Must set profiler agent JVM arguments in profiler.info.jvmargs.agent</fail>
   4.821 +    </target>
   4.822 +    <!--
   4.823 +                end of pre NB7.2 profiling section
   4.824 +            -->
   4.825 +    <target depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-test,-init-macrodef-test-debug,-init-macrodef-java,-init-macrodef-nbjpda,-init-macrodef-nbjsdebug,-init-macrodef-debug,-init-taskdefs,-init-ap-cmdline" name="init"/>
   4.826      <!--
   4.827                  COMPILATION SECTION
   4.828              -->
   4.829 @@ -313,57 +856,24 @@
   4.830      <target depends="init" if="dist.ear.dir" name="deps-ear-jar" unless="no.deps"/>
   4.831      <target depends="init, deps-module-jar, deps-ear-jar" name="deps-jar" unless="no.deps"/>
   4.832      <target depends="init,deps-jar" name="-pre-pre-compile">
   4.833 -        <mkdir dir="${build.classes.dir.real}"/>
   4.834 +        <mkdir dir="${build.classes.dir}"/>
   4.835      </target>
   4.836      <target name="-pre-compile">
   4.837          <!-- Empty placeholder for easier customization. -->
   4.838          <!-- You can override this target in the ../build.xml file. -->
   4.839      </target>
   4.840      <target name="-copy-webdir">
   4.841 -        <copy todir="${build.web.dir.real}">
   4.842 -            <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes}"/>
   4.843 +        <copy todir="${build.web.dir}">
   4.844 +            <fileset dir="${web.docbase.dir}" excludes="${build.web.excludes},${excludes}" includes="${includes}"/>
   4.845          </copy>
   4.846 -        <copy todir="${build.web.dir.real}/WEB-INF">
   4.847 +        <copy todir="${build.web.dir}/WEB-INF">
   4.848              <fileset dir="${webinf.dir}" excludes="${build.web.excludes}"/>
   4.849          </copy>
   4.850      </target>
   4.851 -    <target if="rest.support.on" name="-init-rest">
   4.852 -        <condition property="platform.restlib.classpath" value="${j2ee.platform.classpath}">
   4.853 -            <and>
   4.854 -                <isset property="restlib.ignore.platform"/>
   4.855 -                <isfalse value="${restlib.ignore.platform}"/>
   4.856 -            </and>
   4.857 -        </condition>
   4.858 -        <taskdef classname="com.sun.ws.rest.tools.ant.WebResourcesProcessorTask" name="restapt">
   4.859 -            <classpath>
   4.860 -                <path path="${platform.restlib.classpath}"/>
   4.861 -                <path path="${libs.restlib.classpath}"/>
   4.862 -            </classpath>
   4.863 -        </taskdef>
   4.864 -    </target>
   4.865 -    <target depends="-init-rest" if="rest.support.on" name="-rest-post-compile">
   4.866 -        <mkdir dir="${build.generated.dir}/rest-gen"/>
   4.867 -        <restapt destdir="${build.generated.dir}/rest-gen" fork="true" nocompile="true" sourcePath="${src.dir}" sourcedestdir="${build.generated.dir}/rest-gen" xEndorsed="true">
   4.868 -            <classpath>
   4.869 -                <path path="${javac.classpath}"/>
   4.870 -                <path path="${libs.jaxws21.classpath}"/>
   4.871 -                <path path="${j2ee.platform.classpath}"/>
   4.872 -                <pathelement location="${build.web.dir}/WEB-INF/classes"/>
   4.873 -            </classpath>
   4.874 -            <source dir="${src.dir}">
   4.875 -                <include name="**/*.java"/>
   4.876 -            </source>
   4.877 -        </restapt>
   4.878 -        <webproject2:javac destdir="${build.classes.dir.real}" srcdir="${build.generated.dir}/rest-gen"/>
   4.879 -        <copy todir="${build.classes.dir.real}">
   4.880 -            <fileset dir="${build.generated.dir}/rest-gen" includes="**/*.wadl"/>
   4.881 -        </copy>
   4.882 -    </target>
   4.883 -    <target name="-do-ws-compile"/>
   4.884 -    <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest,-do-ws-compile" if="have.sources" name="-do-compile">
   4.885 -        <webproject2:javac destdir="${build.classes.dir.real}"/>
   4.886 -        <copy todir="${build.classes.dir.real}">
   4.887 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
   4.888 +    <target depends="init, deps-jar, -pre-pre-compile, -pre-compile, -copy-manifest, -copy-persistence-xml, -copy-webdir, library-inclusion-in-archive,library-inclusion-in-manifest" if="have.sources" name="-do-compile">
   4.889 +        <webproject2:javac destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/>
   4.890 +        <copy todir="${build.classes.dir}">
   4.891 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   4.892          </copy>
   4.893      </target>
   4.894      <target if="has.custom.manifest" name="-copy-manifest">
   4.895 @@ -373,29 +883,25 @@
   4.896          </copy>
   4.897      </target>
   4.898      <target if="has.persistence.xml" name="-copy-persistence-xml">
   4.899 -        <mkdir dir="${build.web.dir.real}/WEB-INF/classes/META-INF"/>
   4.900 -        <copy todir="${build.web.dir.real}/WEB-INF/classes/META-INF">
   4.901 -            <fileset dir="${conf.dir}" includes="persistence.xml"/>
   4.902 +        <mkdir dir="${build.web.dir}/WEB-INF/classes/META-INF"/>
   4.903 +        <copy todir="${build.web.dir}/WEB-INF/classes/META-INF">
   4.904 +            <fileset dir="${persistence.xml.dir}" includes="persistence.xml orm.xml"/>
   4.905          </copy>
   4.906      </target>
   4.907      <target name="-post-compile">
   4.908          <!-- Empty placeholder for easier customization. -->
   4.909          <!-- You can override this target in the ../build.xml file. -->
   4.910      </target>
   4.911 -    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-rest-post-compile,-post-compile" description="Compile project." name="compile"/>
   4.912 +    <target depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project." name="compile"/>
   4.913      <target name="-pre-compile-single">
   4.914          <!-- Empty placeholder for easier customization. -->
   4.915          <!-- You can override this target in the ../build.xml file. -->
   4.916      </target>
   4.917      <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
   4.918          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
   4.919 -        <webproject2:javac>
   4.920 -            <customize>
   4.921 -                <patternset includes="${javac.includes}"/>
   4.922 -            </customize>
   4.923 -        </webproject2:javac>
   4.924 -        <copy todir="${build.classes.dir.real}">
   4.925 -            <fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
   4.926 +        <webproject2:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}"/>
   4.927 +        <copy todir="${build.classes.dir}">
   4.928 +            <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
   4.929          </copy>
   4.930      </target>
   4.931      <target name="-post-compile-single">
   4.932 @@ -403,34 +909,48 @@
   4.933          <!-- You can override this target in the ../build.xml file. -->
   4.934      </target>
   4.935      <target depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single" name="compile-single"/>
   4.936 +    <property name="jspc.schemas" value="/resources/schemas/"/>
   4.937 +    <property name="jspc.dtds" value="/resources/dtds/"/>
   4.938      <target depends="compile" description="Test compile JSP pages to expose compilation errors." if="do.compile.jsps" name="compile-jsps">
   4.939          <mkdir dir="${build.generated.dir}/src"/>
   4.940          <java classname="org.netbeans.modules.web.project.ant.JspC" failonerror="true" fork="true">
   4.941              <arg value="-uriroot"/>
   4.942 -            <arg file="${basedir}/${build.web.dir.real}"/>
   4.943 +            <arg file="${basedir}/${build.web.dir}"/>
   4.944              <arg value="-d"/>
   4.945              <arg file="${basedir}/${build.generated.dir}/src"/>
   4.946              <arg value="-die1"/>
   4.947 -            <classpath path="${java.home}/../lib/tools.jar:${copyfiles.classpath}:${jspcompilation.classpath}"/>
   4.948 +            <arg value="-schemas ${jspc.schemas}"/>
   4.949 +            <arg value="-dtds ${jspc.dtds}"/>
   4.950 +            <arg value="-compilerSourceVM ${javac.source}"/>
   4.951 +            <arg value="-compilerTargetVM ${javac.target}"/>
   4.952 +            <arg value="-javaEncoding ${source.encoding}"/>
   4.953 +            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
   4.954 +            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
   4.955          </java>
   4.956          <mkdir dir="${build.generated.dir}/classes"/>
   4.957 -        <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir.real}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
   4.958 +        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src"/>
   4.959      </target>
   4.960      <target depends="compile" if="jsp.includes" name="-do-compile-single-jsp">
   4.961          <fail unless="javac.jsp.includes">Must select some files in the IDE or set javac.jsp.includes</fail>
   4.962          <mkdir dir="${build.generated.dir}/src"/>
   4.963          <java classname="org.netbeans.modules.web.project.ant.JspCSingle" failonerror="true" fork="true">
   4.964              <arg value="-uriroot"/>
   4.965 -            <arg file="${basedir}/${build.web.dir.real}"/>
   4.966 +            <arg file="${basedir}/${build.web.dir}"/>
   4.967              <arg value="-d"/>
   4.968              <arg file="${basedir}/${build.generated.dir}/src"/>
   4.969              <arg value="-die1"/>
   4.970 +            <arg value="-schemas ${jspc.schemas}"/>
   4.971 +            <arg value="-dtds ${jspc.dtds}"/>
   4.972 +            <arg value="-sysClasspath ${libs.jsp-compilation-syscp.classpath}"/>
   4.973              <arg value="-jspc.files"/>
   4.974              <arg path="${jsp.includes}"/>
   4.975 -            <classpath path="${java.home}/../lib/tools.jar:${copyfiles.classpath}:${jspcompilation.classpath}"/>
   4.976 +            <arg value="-compilerSourceVM ${javac.source}"/>
   4.977 +            <arg value="-compilerTargetVM ${javac.target}"/>
   4.978 +            <arg value="-javaEncoding ${source.encoding}"/>
   4.979 +            <classpath path="${java.home}/../lib/tools.jar:${libs.jsp-compiler.classpath}:${libs.jsp-compilation.classpath}"/>
   4.980          </java>
   4.981          <mkdir dir="${build.generated.dir}/classes"/>
   4.982 -        <webproject2:javac classpath="${j2ee.platform.classpath}:${build.classes.dir.real}:${jspcompilation.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
   4.983 +        <webproject2:javac classpath="${build.classes.dir}:${libs.jsp-compilation.classpath}:${javac.classpath}:${j2ee.platform.classpath}" destdir="${build.generated.dir}/classes" srcdir="${build.generated.dir}/src">
   4.984              <customize>
   4.985                  <patternset includes="${javac.jsp.includes}"/>
   4.986              </customize>
   4.987 @@ -451,48 +971,47 @@
   4.988          <dirname file="${dist.war}" property="dist.jar.dir"/>
   4.989          <mkdir dir="${dist.jar.dir}"/>
   4.990          <jar compress="${jar.compress}" jarfile="${dist.war}">
   4.991 -            <fileset dir="${build.web.dir.real}"/>
   4.992 +            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
   4.993          </jar>
   4.994      </target>
   4.995      <target depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.with.custom.manifest" name="-do-dist-with-manifest">
   4.996          <dirname file="${dist.war}" property="dist.jar.dir"/>
   4.997          <mkdir dir="${dist.jar.dir}"/>
   4.998          <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
   4.999 -            <fileset dir="${build.web.dir.real}"/>
  4.1000 +            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
  4.1001          </jar>
  4.1002      </target>
  4.1003      <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.without.custom.manifest" name="-do-tmp-dist-without-manifest">
  4.1004          <dirname file="${dist.war}" property="dist.jar.dir"/>
  4.1005          <mkdir dir="${dist.jar.dir}"/>
  4.1006          <jar compress="${jar.compress}" jarfile="${dist.war}">
  4.1007 -            <fileset dir="${build.web.dir.real}"/>
  4.1008 +            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
  4.1009          </jar>
  4.1010      </target>
  4.1011      <target depends="init,compile,compile-jsps,-pre-dist" if="do.tmp.war.package.with.custom.manifest" name="-do-tmp-dist-with-manifest">
  4.1012          <dirname file="${dist.war}" property="dist.jar.dir"/>
  4.1013          <mkdir dir="${dist.jar.dir}"/>
  4.1014          <jar compress="${jar.compress}" jarfile="${dist.war}" manifest="${build.meta.inf.dir}/MANIFEST.MF">
  4.1015 -            <fileset dir="${build.web.dir.real}"/>
  4.1016 +            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
  4.1017          </jar>
  4.1018      </target>
  4.1019      <target depends="init,compile,compile-jsps,-pre-dist,-do-dist-with-manifest,-do-dist-without-manifest" name="do-dist"/>
  4.1020      <target depends="init" if="dist.ear.dir" name="library-inclusion-in-manifest">
  4.1021 -        <basename file="${libs.Xerces.classpath}" property="included.lib.libs.Xerces.classpath"/>
  4.1022 -        <copy-ear-war file="${libs.Xerces.classpath}" propname="included.lib.libs.Xerces.classpath.X"/>
  4.1023 -        <mkdir dir="${build.web.dir.real}/META-INF"/>
  4.1024 -        <manifest file="${build.web.dir.real}/META-INF/MANIFEST.MF" mode="update">
  4.1025 -            <attribute name="Class-Path" value="${included.lib.libs.Xerces.classpath} "/>
  4.1026 -        </manifest>
  4.1027 -        <delete dir="${dist.ear.dir}/temp"/>
  4.1028 +        <copyfiles files="${libs.Xerces.classpath}" iftldtodir="${build.web.dir}/WEB-INF" todir="${dist.ear.dir}"/>
  4.1029 +        <mkdir dir="${build.web.dir}/META-INF"/>
  4.1030 +        <manifest file="${build.web.dir}/META-INF/MANIFEST.MF" mode="update"/>
  4.1031      </target>
  4.1032      <target depends="init" name="library-inclusion-in-archive" unless="dist.ear.dir">
  4.1033 -        <copy file="${libs.Xerces.classpath}" todir="${build.web.dir.real}/WEB-INF/lib"/>
  4.1034 +        <copyfiles files="${libs.Xerces.classpath}" todir="${build.web.dir}/WEB-INF/lib"/>
  4.1035      </target>
  4.1036 -    <target depends="init,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" name="do-ear-dist">
  4.1037 +    <target depends="init" if="dist.ear.dir" name="-clean-webinf-lib">
  4.1038 +        <delete dir="${build.web.dir}/WEB-INF/lib"/>
  4.1039 +    </target>
  4.1040 +    <target depends="init,-clean-webinf-lib,compile,compile-jsps,-pre-dist,library-inclusion-in-manifest" if="do.tmp.war.package" name="do-ear-dist">
  4.1041          <dirname file="${dist.ear.war}" property="dist.jar.dir"/>
  4.1042          <mkdir dir="${dist.jar.dir}"/>
  4.1043 -        <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir.real}/META-INF/MANIFEST.MF">
  4.1044 -            <fileset dir="${build.web.dir.real}"/>
  4.1045 +        <jar compress="${jar.compress}" jarfile="${dist.ear.war}" manifest="${build.web.dir}/META-INF/MANIFEST.MF">
  4.1046 +            <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/>
  4.1047          </jar>
  4.1048      </target>
  4.1049      <target name="-post-dist">
  4.1050 @@ -500,7 +1019,7 @@
  4.1051          <!-- You can override this target in the ../build.xml file. -->
  4.1052      </target>
  4.1053      <target depends="init,compile,-pre-dist,do-dist,-post-dist" description="Build distribution (WAR)." name="dist"/>
  4.1054 -    <target depends="init,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
  4.1055 +    <target depends="init,-clean-webinf-lib,-init-cos,compile,-pre-dist,do-ear-dist,-post-dist" description="Build distribution (WAR) to be packaged into an EAR." name="dist-ear"/>
  4.1056      <!--
  4.1057                  EXECUTION SECTION
  4.1058              -->
  4.1059 @@ -524,7 +1043,7 @@
  4.1060      <target name="-run-deploy-am">
  4.1061          <!-- Task to deploy to the Access Manager runtime. -->
  4.1062      </target>
  4.1063 -    <target depends="init,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy" name="run-deploy"/>
  4.1064 +    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest,-pre-run-deploy,-pre-nbmodule-run-deploy,-run-deploy-nb,-init-deploy-ant,-deploy-ant,-run-deploy-am,-post-nbmodule-run-deploy,-post-run-deploy,-do-update-breakpoints" name="run-deploy"/>
  4.1065      <target if="netbeans.home" name="-run-deploy-nb">
  4.1066          <nbdeploy clientUrlPart="${client.urlPart}" debugmode="false" forceRedeploy="${forceRedeploy}"/>
  4.1067      </target>
  4.1068 @@ -541,17 +1060,31 @@
  4.1069      <target depends="init,-pre-dist,dist,-post-dist" name="verify">
  4.1070          <nbverify file="${dist.war}"/>
  4.1071      </target>
  4.1072 -    <target depends="run-deploy,-init-display-browser,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
  4.1073 +    <target depends="run-deploy,-init-display-browser,-display-browser-nb-old,-display-browser-nb,-display-browser-cl" name="run-display-browser"/>
  4.1074      <target if="do.display.browser" name="-init-display-browser">
  4.1075 +        <condition property="do.display.browser.nb.old">
  4.1076 +            <and>
  4.1077 +                <isset property="netbeans.home"/>
  4.1078 +                <not>
  4.1079 +                    <isset property="browser.context"/>
  4.1080 +                </not>
  4.1081 +            </and>
  4.1082 +        </condition>
  4.1083          <condition property="do.display.browser.nb">
  4.1084 -            <isset property="netbeans.home"/>
  4.1085 +            <and>
  4.1086 +                <isset property="netbeans.home"/>
  4.1087 +                <isset property="browser.context"/>
  4.1088 +            </and>
  4.1089          </condition>
  4.1090          <condition property="do.display.browser.cl">
  4.1091              <isset property="deploy.ant.enabled"/>
  4.1092          </condition>
  4.1093      </target>
  4.1094 +    <target if="do.display.browser.nb.old" name="-display-browser-nb-old">
  4.1095 +        <nbbrowse url="${client.url}"/>
  4.1096 +    </target>
  4.1097      <target if="do.display.browser.nb" name="-display-browser-nb">
  4.1098 -        <nbbrowse url="${client.url}"/>
  4.1099 +        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
  4.1100      </target>
  4.1101      <target if="do.display.browser.cl" name="-get-browser" unless="browser">
  4.1102          <condition property="browser" value="rundll32">
  4.1103 @@ -602,36 +1135,59 @@
  4.1104              <arg line="${browser.args} ${browse.url}"/>
  4.1105          </exec>
  4.1106      </target>
  4.1107 -    <target depends="init,compile-single" name="run-main">
  4.1108 +    <target depends="init,-init-cos,compile-single" name="run-main">
  4.1109          <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  4.1110          <webproject1:java classname="${run.class}"/>
  4.1111      </target>
  4.1112 -    <target depends="run-deploy,-init-display-browser" name="test-restbeans">
  4.1113 -        <replace file="${restbeans.test.file}" token="${base.url.token}" value="${client.url}"/>
  4.1114 -        <nbbrowse url="${restbeans.test.url}"/>
  4.1115 +    <target depends="init,compile-test-single,-pre-test-run-single" name="run-test-with-main">
  4.1116 +        <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
  4.1117 +        <webproject1:java classname="${run.class}" classpath="${run.test.classpath}"/>
  4.1118 +    </target>
  4.1119 +    <target depends="init" if="netbeans.home" name="-do-update-breakpoints">
  4.1120 +        <webproject1:nbjpdaappreloaded/>
  4.1121      </target>
  4.1122      <!--
  4.1123                  DEBUGGING SECTION
  4.1124              -->
  4.1125 -    <target depends="init,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
  4.1126 -        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true"/>
  4.1127 +    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" description="Debug project in IDE." if="netbeans.home" name="debug">
  4.1128 +        <nbstartserver debugmode="true"/>
  4.1129          <antcall target="connect-debugger"/>
  4.1130 +        <nbdeploy clientUrlPart="${client.urlPart}" debugmode="true" forceRedeploy="true"/>
  4.1131 +        <antcall target="debug-display-browser-old"/>
  4.1132          <antcall target="debug-display-browser"/>
  4.1133 +        <antcall target="connect-client-debugger"/>
  4.1134      </target>
  4.1135 -    <target name="connect-debugger" unless="is.debugged">
  4.1136 -        <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" name="${name}" transport="${jpda.transport}">
  4.1137 +    <target if="do.debug.server" name="connect-debugger" unless="is.debugged">
  4.1138 +        <condition property="listeningcp" value="sourcepath">
  4.1139 +            <istrue value="${j2ee.compile.on.save}"/>
  4.1140 +        </condition>
  4.1141 +        <nbjpdaconnect address="${jpda.address}" host="${jpda.host}" listeningcp="${listeningcp}" name="${name}" transport="${jpda.transport}">
  4.1142              <classpath>
  4.1143 -                <path path="${debug.classpath}:${ws.debug.classpaths}"/>
  4.1144 +                <path path="${debug.classpath}:${j2ee.platform.classpath}"/>
  4.1145              </classpath>
  4.1146              <sourcepath>
  4.1147 -                <path path="${web.docbase.dir}:${ws.web.docbase.dirs}"/>
  4.1148 +                <path path="${web.docbase.dir}"/>
  4.1149              </sourcepath>
  4.1150          </nbjpdaconnect>
  4.1151      </target>
  4.1152 -    <target if="do.display.browser" name="debug-display-browser">
  4.1153 +    <target if="do.display.browser.debug.old" name="debug-display-browser-old">
  4.1154          <nbbrowse url="${client.url}"/>
  4.1155      </target>
  4.1156 +    <target if="do.display.browser.debug" name="debug-display-browser">
  4.1157 +        <nbbrowse context="${browser.context}" url="${client.url}" urlPath="${client.urlPart}"/>
  4.1158 +    </target>
  4.1159 +    <target if="do.debug.client" name="connect-client-debugger">
  4.1160 +        <webproject1:nbjsdebugstart webUrl="${client.url}"/>
  4.1161 +    </target>
  4.1162 +    <target depends="init,compile-test-single" if="netbeans.home" name="-debug-start-debuggee-main-test">
  4.1163 +        <fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
  4.1164 +        <webproject1:debug classname="${debug.class}" classpath="${debug.test.classpath}"/>
  4.1165 +    </target>
  4.1166 +    <target depends="init,compile-test-single,-debug-start-debugger-main-test,-debug-start-debuggee-main-test" if="netbeans.home" name="debug-test-with-main"/>
  4.1167      <target depends="init,compile,compile-jsps,-do-compile-single-jsp,debug" if="netbeans.home" name="debug-single"/>
  4.1168 +    <target depends="init" if="netbeans.home" name="-debug-start-debugger-main-test">
  4.1169 +        <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${debug.class}"/>
  4.1170 +    </target>
  4.1171      <target depends="init" if="netbeans.home" name="-debug-start-debugger">
  4.1172          <webproject1:nbjpdastart name="${debug.class}"/>
  4.1173      </target>
  4.1174 @@ -649,20 +1205,110 @@
  4.1175      </target>
  4.1176      <target depends="init,-pre-debug-fix,-do-debug-fix" if="netbeans.home" name="debug-fix"/>
  4.1177      <!--
  4.1178 +            =================
  4.1179 +            PROFILING SECTION
  4.1180 +            =================
  4.1181 +            -->
  4.1182 +    <!--
  4.1183 +                pre NB7.2 profiling section; consider it deprecated
  4.1184 +            -->
  4.1185 +    <target description="Profile a J2EE project in the IDE." if="profiler.info.jvmargs.agent" name="-profile-pre72">
  4.1186 +        <condition else="start-profiled-server" property="profiler.startserver.target" value="start-profiled-server-extraargs">
  4.1187 +            <isset property="profiler.info.jvmargs.extra"/>
  4.1188 +        </condition>
  4.1189 +        <antcall target="${profiler.startserver.target}"/>
  4.1190 +        <antcall target="run"/>
  4.1191 +        <antcall target="-profile-start-loadgen"/>
  4.1192 +    </target>
  4.1193 +    <target if="profiler.info.jvmargs.agent" name="start-profiled-server">
  4.1194 +        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
  4.1195 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  4.1196 +            <jvmarg value="${profiler.j2ee.agentID}"/>
  4.1197 +        </nbstartprofiledserver>
  4.1198 +    </target>
  4.1199 +    <target if="profiler.info.jvmargs.agent" name="start-profiled-server-extraargs">
  4.1200 +        <nbstartprofiledserver forceRestart="${profiler.j2ee.serverForceRestart}" javaPlatform="${profiler.info.javaPlatform}" startupTimeout="${profiler.j2ee.serverStartupTimeout}">
  4.1201 +            <jvmarg value="${profiler.info.jvmargs.extra}"/>
  4.1202 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  4.1203 +            <jvmarg value="${profiler.j2ee.agentID}"/>
  4.1204 +        </nbstartprofiledserver>
  4.1205 +    </target>
  4.1206 +    <target depends="profile-init,compile-test-single" if="profiler.info.jvmargs.agent" name="-profile-test-single-pre72">
  4.1207 +        <fail unless="netbeans.home">This target only works when run from inside the NetBeans IDE.</fail>
  4.1208 +        <nbprofiledirect>
  4.1209 +            <classpath>
  4.1210 +                <path path="${run.test.classpath}"/>
  4.1211 +                <path path="${j2ee.platform.classpath}"/>
  4.1212 +            </classpath>
  4.1213 +        </nbprofiledirect>
  4.1214 +        <junit dir="${profiler.info.dir}" errorproperty="tests.failed" failureproperty="tests.failed" fork="true" jvm="${profiler.info.jvm}" showoutput="true">
  4.1215 +            <env key="${profiler.info.pathvar}" path="${profiler.info.agentpath}:${profiler.current.path}"/>
  4.1216 +            <jvmarg value="${profiler.info.jvmargs.agent}"/>
  4.1217 +            <jvmarg line="${profiler.info.jvmargs}"/>
  4.1218 +            <test name="${profile.class}"/>
  4.1219 +            <classpath>
  4.1220 +                <path path="${run.test.classpath}"/>
  4.1221 +                <path path="${j2ee.platform.classpath}"/>
  4.1222 +            </classpath>
  4.1223 +            <syspropertyset>
  4.1224 +                <propertyref prefix="test-sys-prop."/>
  4.1225 +                <mapper from="test-sys-prop.*" to="*" type="glob"/>
  4.1226 +            </syspropertyset>
  4.1227 +            <formatter type="brief" usefile="false"/>
  4.1228 +            <formatter type="xml"/>
  4.1229 +        </junit>
  4.1230 +    </target>
  4.1231 +    <target if="netbeans.home" name="-profile-check">
  4.1232 +        <condition property="profiler.configured">
  4.1233 +            <or>
  4.1234 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-agentpath:"/>
  4.1235 +                <contains casesensitive="true" string="${run.jvmargs.ide}" substring="-javaagent:"/>
  4.1236 +            </or>
  4.1237 +        </condition>
  4.1238 +    </target>
  4.1239 +    <target depends="init,-init-cos,compile,compile-jsps,-do-compile-single-jsp,-pre-dist,-do-tmp-dist-with-manifest,-do-tmp-dist-without-manifest" name="-do-profile">
  4.1240 +        <startprofiler/>
  4.1241 +        <nbstartserver profilemode="true"/>
  4.1242 +        <nbdeploy clientUrlPart="${client.urlPart}" forceRedeploy="true" profilemode="true"/>
  4.1243 +        <antcall target="debug-display-browser-old"/>
  4.1244 +        <antcall target="debug-display-browser"/>
  4.1245 +        <antcall target="-profile-start-loadgen"/>
  4.1246 +    </target>
  4.1247 +    <target depends="-profile-check,-profile-pre72" description="Profile a J2EE project in the IDE." if="profiler.configured" name="profile" unless="profiler.info.jvmargs.agent">
  4.1248 +        <antcall target="-do-profile"/>
  4.1249 +    </target>
  4.1250 +    <target depends="-profile-test-single-pre72" name="profile-test-single"/>
  4.1251 +    <target depends="-profile-check" if="profiler.configured" name="profile-test" unless="profiler.info.jvmargs.agent">
  4.1252 +        <startprofiler/>
  4.1253 +        <antcall target="test-single"/>
  4.1254 +    </target>
  4.1255 +    <target if="profiler.loadgen.path" name="-profile-start-loadgen">
  4.1256 +        <loadgenstart path="${profiler.loadgen.path}"/>
  4.1257 +    </target>
  4.1258 +    <!--
  4.1259                  JAVADOC SECTION
  4.1260              -->
  4.1261 -    <target depends="init" name="javadoc-build">
  4.1262 +    <target depends="init" if="have.sources" name="javadoc-build">
  4.1263          <mkdir dir="${dist.javadoc.dir}"/>
  4.1264 -        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" destdir="${dist.javadoc.dir}" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  4.1265 +        <javadoc additionalparam="${javadoc.additionalparam}" author="${javadoc.author}" charset="UTF-8" destdir="${dist.javadoc.dir}" docencoding="UTF-8" encoding="${javadoc.encoding.used}" failonerror="true" noindex="${javadoc.noindex}" nonavbar="${javadoc.nonavbar}" notree="${javadoc.notree}" private="${javadoc.private}" source="${javac.source}" splitindex="${javadoc.splitindex}" use="${javadoc.use}" useexternalfile="true" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}">
  4.1266              <classpath>
  4.1267                  <path path="${javac.classpath}:${j2ee.platform.classpath}"/>
  4.1268              </classpath>
  4.1269 -            <sourcepath>
  4.1270 -                <pathelement location="${src.dir}"/>
  4.1271 -            </sourcepath>
  4.1272 -            <packageset dir="${src.dir}" includes="*/**"/>
  4.1273 -            <fileset dir="${src.dir}" includes="*.java"/>
  4.1274 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  4.1275 +                <filename name="**/*.java"/>
  4.1276 +            </fileset>
  4.1277 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  4.1278 +                <include name="**/*.java"/>
  4.1279 +            </fileset>
  4.1280          </javadoc>
  4.1281 +        <copy todir="${dist.javadoc.dir}">
  4.1282 +            <fileset dir="${src.dir}" excludes="${excludes}" includes="${includes}">
  4.1283 +                <filename name="**/doc-files/**"/>
  4.1284 +            </fileset>
  4.1285 +            <fileset dir="${build.generated.sources.dir}" erroronmissingdir="false">
  4.1286 +                <include name="**/doc-files/**"/>
  4.1287 +            </fileset>
  4.1288 +        </copy>
  4.1289      </target>
  4.1290      <target depends="init,javadoc-build" if="netbeans.home" name="javadoc-browse" unless="no.javadoc.preview">
  4.1291          <nbbrowse file="${dist.javadoc.dir}/index.html"/>
  4.1292 @@ -670,19 +1316,20 @@
  4.1293      <target depends="init,javadoc-build,javadoc-browse" description="Build Javadoc." name="javadoc"/>
  4.1294      <!--
  4.1295                  
  4.1296 -                JUNIT COMPILATION SECTION
  4.1297 +                TEST COMPILATION SECTION
  4.1298              -->
  4.1299      <target depends="init,compile" if="have.tests" name="-pre-pre-compile-test">
  4.1300          <mkdir dir="${build.test.classes.dir}"/>
  4.1301 +        <property name="j2ee.platform.embeddableejb.classpath" value=""/>
  4.1302      </target>
  4.1303      <target name="-pre-compile-test">
  4.1304          <!-- Empty placeholder for easier customization. -->
  4.1305          <!-- You can override this target in the ../build.xml file. -->
  4.1306      </target>
  4.1307      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test" if="have.tests" name="-do-compile-test">
  4.1308 -        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  4.1309 +        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}"/>
  4.1310          <copy todir="${build.test.classes.dir}">
  4.1311 -            <fileset dir="${test.src.dir}" excludes="**/*.java"/>
  4.1312 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  4.1313          </copy>
  4.1314      </target>
  4.1315      <target name="-post-compile-test">
  4.1316 @@ -696,13 +1343,9 @@
  4.1317      </target>
  4.1318      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
  4.1319          <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
  4.1320 -        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}" debug="true" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}">
  4.1321 -            <customize>
  4.1322 -                <patternset includes="${javac.includes}"/>
  4.1323 -            </customize>
  4.1324 -        </webproject2:javac>
  4.1325 +        <webproject2:javac classpath="${javac.test.classpath}:${j2ee.platform.classpath}:${j2ee.platform.embeddableejb.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" srcdir="${test.src.dir}"/>
  4.1326          <copy todir="${build.test.classes.dir}">
  4.1327 -            <fileset dir="${test.src.dir}" excludes="**/*.java"/>
  4.1328 +            <fileset dir="${test.src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
  4.1329          </copy>
  4.1330      </target>
  4.1331      <target name="-post-compile-test-single">
  4.1332 @@ -712,16 +1355,16 @@
  4.1333      <target depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single" name="compile-test-single"/>
  4.1334      <!--
  4.1335                  
  4.1336 -                JUNIT EXECUTION SECTION
  4.1337 +                TEST EXECUTION SECTION
  4.1338              -->
  4.1339      <target depends="init" if="have.tests" name="-pre-test-run">
  4.1340          <mkdir dir="${build.test.results.dir}"/>
  4.1341      </target>
  4.1342      <target depends="init,compile-test,-pre-test-run" if="have.tests" name="-do-test-run">
  4.1343 -        <webproject2:junit/>
  4.1344 +        <webproject2:test includes="${includes}" testincludes="**/*Test.java"/>
  4.1345      </target>
  4.1346      <target depends="init,compile-test,-pre-test-run,-do-test-run" if="have.tests" name="-post-test-run">
  4.1347 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  4.1348 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  4.1349      </target>
  4.1350      <target depends="init" if="have.tests" name="test-report"/>
  4.1351      <target depends="init" if="netbeans.home+have.tests" name="-test-browse"/>
  4.1352 @@ -731,34 +1374,39 @@
  4.1353      </target>
  4.1354      <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single">
  4.1355          <fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
  4.1356 -        <webproject2:junit includes="${test.includes}"/>
  4.1357 +        <webproject2:test excludes="" includes="${test.includes}" testincludes="${test.includes}"/>
  4.1358      </target>
  4.1359      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single" if="have.tests" name="-post-test-run-single">
  4.1360 -        <fail if="tests.failed">Some tests failed; see details above.</fail>
  4.1361 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  4.1362      </target>
  4.1363      <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test." name="test-single"/>
  4.1364 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-do-test-run-single-method">
  4.1365 +        <fail unless="test.class">Must select some files in the IDE or set test.class</fail>
  4.1366 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  4.1367 +        <webproject2:test excludes="" includes="${javac.includes}" testincludes="${test.class}" testmethods="${test.method}"/>
  4.1368 +    </target>
  4.1369 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method" if="have.tests" name="-post-test-run-single-method">
  4.1370 +        <fail if="tests.failed" unless="ignore.failing.tests">Some tests failed; see details above.</fail>
  4.1371 +    </target>
  4.1372 +    <target depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single-method,-post-test-run-single-method" description="Run single unit test." name="test-single-method"/>
  4.1373      <!--
  4.1374                  
  4.1375 -                JUNIT DEBUGGING SECTION
  4.1376 +                TEST DEBUGGING SECTION
  4.1377              -->
  4.1378 -    <target depends="init,compile-test" if="have.tests" name="-debug-start-debuggee-test">
  4.1379 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test">
  4.1380          <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  4.1381 -        <property location="${build.test.results.dir}/TEST-${test.class}.xml" name="test.report.file"/>
  4.1382 -        <delete file="${test.report.file}"/>
  4.1383 -        <!-- must exist, otherwise the XML formatter would fail -->
  4.1384 -        <mkdir dir="${build.test.results.dir}"/>
  4.1385 -        <webproject1:debug args="${test.class}" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner" classpath="${ant.home}/lib/ant.jar:${ant.home}/lib/ant-junit.jar:${debug.test.classpath}">
  4.1386 -            <customize>
  4.1387 -                <arg value="showoutput=true"/>
  4.1388 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.BriefJUnitResultFormatter"/>
  4.1389 -                <arg value="formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,${test.report.file}"/>
  4.1390 -            </customize>
  4.1391 -        </webproject1:debug>
  4.1392 +        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testincludes="${javac.includes}"/>
  4.1393 +    </target>
  4.1394 +    <target depends="init,compile-test-single,-pre-test-run-single" if="have.tests" name="-debug-start-debuggee-test-method">
  4.1395 +        <fail unless="test.class">Must select one file in the IDE or set test.class</fail>
  4.1396 +        <fail unless="test.method">Must select some method in the IDE or set test.method</fail>
  4.1397 +        <webproject2:test-debug excludes="" includes="${javac.includes}" testClass="${test.class}" testMethod="${test.method}" testincludes="${test.class}" testmethods="${test.method}"/>
  4.1398      </target>
  4.1399      <target depends="init,compile-test" if="netbeans.home+have.tests" name="-debug-start-debugger-test">
  4.1400          <webproject1:nbjpdastart classpath="${debug.test.classpath}" name="${test.class}"/>
  4.1401      </target>
  4.1402      <target depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test" name="debug-test"/>
  4.1403 +    <target depends="init,compile-test-single,-debug-start-debugger-test,-debug-start-debuggee-test-method" name="debug-test-method"/>
  4.1404      <target depends="init,-pre-debug-fix,compile-test-single" if="netbeans.home" name="-do-debug-fix-test">
  4.1405          <webproject1:nbjpdareload dir="${build.test.classes.dir}"/>
  4.1406      </target>
  4.1407 @@ -767,12 +1415,12 @@
  4.1408                  
  4.1409                  CLEANUP SECTION
  4.1410              -->
  4.1411 -    <target depends="init" if="no.dist.ear.dir" name="deps-clean" unless="no.deps"/>
  4.1412 +    <target depends="init" name="deps-clean" unless="no.deps"/>
  4.1413      <target depends="init" name="do-clean">
  4.1414 -        <condition property="build.dir.to.clean" value="${build.web.dir.real}">
  4.1415 +        <condition property="build.dir.to.clean" value="${build.web.dir}">
  4.1416              <isset property="dist.ear.dir"/>
  4.1417          </condition>
  4.1418 -        <property name="build.dir.to.clean" value="${build.web.dir.real}"/>
  4.1419 +        <property name="build.dir.to.clean" value="${build.web.dir}"/>
  4.1420          <delete includeEmptyDirs="true" quiet="true">
  4.1421              <fileset dir="${build.dir.to.clean}/WEB-INF/lib"/>
  4.1422          </delete>
  4.1423 @@ -781,13 +1429,16 @@
  4.1424          <delete dir="${dist.dir}"/>
  4.1425      </target>
  4.1426      <target depends="do-clean" if="status.clean-failed" name="check-clean">
  4.1427 -        <echo message="Warning: unable to delete some files in ${build.web.dir.real}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
  4.1428 +        <echo message="Warning: unable to delete some files in ${build.web.dir}/WEB-INF/lib - they are probably locked by the J2EE server. "/>
  4.1429          <echo level="info" message="To delete all files undeploy the module from Server Registry in Runtime tab and then use Clean again."/>
  4.1430      </target>
  4.1431 +    <target depends="init" if="netbeans.home" name="undeploy-clean">
  4.1432 +        <nbundeploy failOnError="false" startServer="false"/>
  4.1433 +    </target>
  4.1434      <target name="-post-clean">
  4.1435          <!-- Empty placeholder for easier customization. -->
  4.1436          <!-- You can override this target in the ../build.xml file. -->
  4.1437      </target>
  4.1438 -    <target depends="init,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
  4.1439 +    <target depends="init,undeploy-clean,deps-clean,do-clean,check-clean,-post-clean" description="Clean build products." name="clean"/>
  4.1440      <target depends="clean" description="Clean build products." name="clean-ear"/>
  4.1441  </project>
     5.1 --- a/zeroadmin/server/nbproject/genfiles.properties	Tue Oct 20 01:33:34 2015 -0500
     5.2 +++ b/zeroadmin/server/nbproject/genfiles.properties	Mon Oct 26 22:29:45 2015 -0400
     5.3 @@ -1,8 +1,8 @@
     5.4 -build.xml.data.CRC32=ff7c4cc1
     5.5 -build.xml.script.CRC32=ecb8ed25
     5.6 -build.xml.stylesheet.CRC32=e92cbef9
     5.7 +build.xml.data.CRC32=b8bc84a5
     5.8 +build.xml.script.CRC32=aae66dba
     5.9 +build.xml.stylesheet.CRC32=651128d4@1.76.0.1
    5.10  # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
    5.11  # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
    5.12 -nbproject/build-impl.xml.data.CRC32=ff7c4cc1
    5.13 -nbproject/build-impl.xml.script.CRC32=0e51e4f6
    5.14 -nbproject/build-impl.xml.stylesheet.CRC32=a455ba79
    5.15 +nbproject/build-impl.xml.data.CRC32=b8bc84a5
    5.16 +nbproject/build-impl.xml.script.CRC32=3fc4e1b3
    5.17 +nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.76.0.1
     6.1 --- a/zeroadmin/server/nbproject/project.properties	Tue Oct 20 01:33:34 2015 -0500
     6.2 +++ b/zeroadmin/server/nbproject/project.properties	Mon Oct 26 22:29:45 2015 -0400
     6.3 @@ -1,9 +1,13 @@
     6.4 +annotation.processing.enabled=true
     6.5 +annotation.processing.enabled.in.editor=true
     6.6 +annotation.processing.processors.list=
     6.7 +annotation.processing.run.all.processors=true
     6.8 +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
     6.9  build.classes.dir=${build.web.dir}/WEB-INF/classes
    6.10  build.classes.excludes=**/*.java,**/*.form
    6.11  build.dir=build
    6.12 -build.ear.classes.dir=${build.ear.web.dir}/WEB-INF/classes
    6.13 -build.ear.web.dir=${build.dir}/web
    6.14  build.generated.dir=${build.dir}/generated
    6.15 +build.generated.sources.dir=${build.dir}/generated-sources
    6.16  build.test.classes.dir=${build.dir}/test/classes
    6.17  build.test.results.dir=${build.dir}/test/results
    6.18  build.web.dir=${build.dir}/web
    6.19 @@ -11,7 +15,7 @@
    6.20  client.urlPart=/desktop/nbconfig
    6.21  compile.jsps=false
    6.22  conf.dir=conf
    6.23 -debug.classpath=${javac.classpath}:${build.classes.dir}:${build.ear.classes.dir}
    6.24 +debug.classpath=${javac.classpath}:${build.classes.dir}
    6.25  debug.test.classpath=\
    6.26      ${run.test.classpath}
    6.27  display.browser=true
    6.28 @@ -19,6 +23,11 @@
    6.29  dist.ear.war=${dist.dir}/${war.ear.name}
    6.30  dist.javadoc.dir=${dist.dir}/javadoc
    6.31  dist.war=${dist.dir}/${war.name}
    6.32 +excludes=
    6.33 +includes=**
    6.34 +j2ee.compile.on.save=false
    6.35 +j2ee.copy.static.files.on.save=false
    6.36 +j2ee.deploy.on.save=false
    6.37  j2ee.platform=1.4
    6.38  j2ee.server.type=Tomcat55
    6.39  jar.compress=false
    6.40 @@ -28,12 +37,14 @@
    6.41  javac.compilerargs=
    6.42  javac.debug=true
    6.43  javac.deprecation=false
    6.44 +javac.processorpath=${javac.classpath}
    6.45  javac.source=1.5
    6.46  javac.target=1.5
    6.47  javac.test.classpath=\
    6.48      ${javac.classpath}:\
    6.49      ${build.classes.dir}:\
    6.50      ${libs.junit.classpath}
    6.51 +javac.test.processorpath=${javac.test.classpath}
    6.52  javadoc.additionalparam=
    6.53  javadoc.author=false
    6.54  javadoc.encoding=
    6.55 @@ -51,6 +62,7 @@
    6.56  # Property libs.Xerces.classpath is set here just to make sharing of project simpler.
    6.57  # The library definition has always preference over this property.
    6.58  libs.Xerces.classpath=../../../contrib/other/../../../../../usr/local/java/netbeans-dev/enterprise2/jakarta-tomcat-5.5.9/common/endorsed/xercesImpl.jar:../../../contrib/other/../../../../../usr/local/java/netbeans-dev/enterprise2/jakarta-tomcat-5.5.9/common/endorsed/xml-apis.jar
    6.59 +persistence.xml.dir=${conf.dir}
    6.60  platform.active=default_platform
    6.61  resource.dir=setup
    6.62  run.test.classpath=\
     7.1 --- a/zeroadmin/src/org/netbeans/modules/zeroadmin/XMLBufferFileSystem.java	Tue Oct 20 01:33:34 2015 -0500
     7.2 +++ b/zeroadmin/src/org/netbeans/modules/zeroadmin/XMLBufferFileSystem.java	Mon Oct 26 22:29:45 2015 -0400
     7.3 @@ -117,11 +117,6 @@
     7.4          fileChangeListener = FileUtil.weakFileChangeListener(this, null);
     7.5      }
     7.6      
     7.7 -    @Override
     7.8 -    public Status getStatus () {
     7.9 -        return this;
    7.10 -    }
    7.11 -    
    7.12      private void writeObject (ObjectOutputStream out) throws IOException {
    7.13          throw new NotSerializableException ("XMLBufferFileSystem is not persistent");
    7.14      }
     8.1 --- a/zeroadmin/src/org/netbeans/modules/zeroadmin/ZeroAdminInstall.java	Tue Oct 20 01:33:34 2015 -0500
     8.2 +++ b/zeroadmin/src/org/netbeans/modules/zeroadmin/ZeroAdminInstall.java	Mon Oct 26 22:29:45 2015 -0400
     8.3 @@ -44,10 +44,10 @@
     8.4  import java.beans.PropertyChangeListener;
     8.5  import java.net.*;
     8.6  import java.util.*;
     8.7 -import java.lang.reflect.*;
     8.8  import java.io.*;
     8.9  import java.awt.event.ActionEvent;
    8.10  import java.awt.event.ActionListener;
    8.11 +import java.lang.reflect.Method;
    8.12  import java.util.logging.Level;
    8.13  import java.util.logging.Logger;
    8.14  import javax.swing.SwingUtilities;
    8.15 @@ -61,11 +61,9 @@
    8.16  import org.openide.modules.ModuleInstall;
    8.17  import org.openide.util.RequestProcessor;
    8.18  import org.openide.util.NbBundle;
    8.19 -import org.openide.util.Lookup;
    8.20 -
    8.21 -import org.netbeans.core.NbTopManager;
    8.22  import org.netbeans.modules.remotesfs.MemoryFileSystem;
    8.23  import org.openide.NotifyDescriptor;
    8.24 +import org.openide.windows.WindowManager;
    8.25  
    8.26  /**
    8.27   * This class is needed because
    8.28 @@ -392,8 +390,7 @@
    8.29                      return;
    8.30                  }
    8.31                  // force the core to save pending stuff:
    8.32 -                NbTopManager.WindowSystem windowSystem = (NbTopManager.WindowSystem)Lookup.getDefault().lookup(NbTopManager.WindowSystem.class);
    8.33 -                windowSystem.save();
    8.34 +                saveWindowSystem();
    8.35                  
    8.36                  XMLBufferFileSystem bufFs = new XMLBufferFileSystem();
    8.37                  copy(writableLayer.getRoot(), bufFs.getRoot(), true);
    8.38 @@ -574,4 +571,24 @@
    8.39              return data.toString();
    8.40          }
    8.41      }
    8.42 +    
    8.43 +    public static void saveWindowSystem() {
    8.44 +        try {
    8.45 +            WindowManager mgr = WindowManager.getDefault();
    8.46 +            Method m = mgr.getClass().getDeclaredMethod("save");
    8.47 +            m.invoke(mgr);
    8.48 +        } catch (Exception ex) {
    8.49 +            throw new RuntimeException(ex);
    8.50 +        }
    8.51 +    }
    8.52 +
    8.53 +    public static void reloadWindowSystem() {
    8.54 +        try {
    8.55 +            WindowManager mgr = WindowManager.getDefault();
    8.56 +            Method m = mgr.getClass().getDeclaredMethod("load");
    8.57 +            m.invoke(mgr);
    8.58 +        } catch (Exception ex) {
    8.59 +            throw new RuntimeException(ex);
    8.60 +        }
    8.61 +    }
    8.62  }
     9.1 --- a/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/RefreshConfigAction.java	Tue Oct 20 01:33:34 2015 -0500
     9.2 +++ b/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/RefreshConfigAction.java	Mon Oct 26 22:29:45 2015 -0400
     9.3 @@ -49,10 +49,9 @@
     9.4  import org.openide.util.SharedClassObject;
     9.5  import org.openide.util.actions.CallableSystemAction;
     9.6  import org.openide.util.HelpCtx;
     9.7 -import org.openide.util.Lookup;
     9.8  
     9.9  import org.netbeans.modules.zeroadmin.*;
    9.10 -import org.netbeans.core.NbTopManager;
    9.11 +import static org.netbeans.modules.zeroadmin.ZeroAdminInstall.saveWindowSystem;
    9.12  
    9.13  /**
    9.14   * Refresh the operator configuration.
    9.15 @@ -69,8 +68,7 @@
    9.16              public void run() {
    9.17                  try {
    9.18                      // force the core to save pending stuff:
    9.19 -                    NbTopManager.WindowSystem windowSystem = (NbTopManager.WindowSystem)Lookup.getDefault().lookup(NbTopManager.WindowSystem.class);
    9.20 -                    windowSystem.save();
    9.21 +                    saveWindowSystem();
    9.22                      z.writableLayer.runAtomicAction(new FileSystem.AtomicAction() {
    9.23                          // atomic action --> should be faster???
    9.24                          public void run() throws IOException {
    10.1 --- a/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/ResetConfigAction.java	Tue Oct 20 01:33:34 2015 -0500
    10.2 +++ b/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/ResetConfigAction.java	Mon Oct 26 22:29:45 2015 -0400
    10.3 @@ -49,12 +49,12 @@
    10.4  import org.openide.util.SharedClassObject;
    10.5  import org.openide.util.actions.CallableSystemAction;
    10.6  import org.openide.util.HelpCtx;
    10.7 -import org.openide.util.Lookup;
    10.8  
    10.9  import org.netbeans.modules.zeroadmin.*;
   10.10 +import static org.netbeans.modules.zeroadmin.ZeroAdminInstall.reloadWindowSystem;
   10.11  
   10.12  // core dependency
   10.13 -import org.netbeans.core.NbTopManager;
   10.14 +import static org.netbeans.modules.zeroadmin.ZeroAdminInstall.saveWindowSystem;
   10.15  
   10.16  /**
   10.17   * Reset to operator configuration.
   10.18 @@ -71,8 +71,7 @@
   10.19              public void run() {
   10.20                  try {
   10.21                      // force the core to save pending stuff:
   10.22 -                    NbTopManager.WindowSystem windowSystem = (NbTopManager.WindowSystem)Lookup.getDefault().lookup(NbTopManager.WindowSystem.class);
   10.23 -                    windowSystem.save();
   10.24 +                    saveWindowSystem();
   10.25  
   10.26                      final FileObject[] ch = z.writableLayer.getRoot().getChildren();
   10.27                      z.writableLayer.runAtomicAction(new FileSystem.AtomicAction() {
   10.28 @@ -139,7 +138,6 @@
   10.29       * Copied from core from WindowManagerImpl.
   10.30       */
   10.31      static void updateWindowManager2() {
   10.32 -        NbTopManager.WindowSystem windowSystem = (NbTopManager.WindowSystem)Lookup.getDefault().lookup(NbTopManager.WindowSystem.class);
   10.33 -        windowSystem.load();
   10.34 +        reloadWindowSystem();
   10.35      }
   10.36  }
    11.1 --- a/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/SaveOperatorConfigAction.java	Tue Oct 20 01:33:34 2015 -0500
    11.2 +++ b/zeroadmin/src/org/netbeans/modules/zeroadmin/actions/SaveOperatorConfigAction.java	Mon Oct 26 22:29:45 2015 -0400
    11.3 @@ -44,14 +44,12 @@
    11.4  import java.util.logging.Logger;
    11.5  import javax.swing.SwingUtilities;
    11.6  
    11.7 -import org.openide.filesystems.*;
    11.8  import org.openide.util.actions.CallableSystemAction;
    11.9  import org.openide.util.HelpCtx;
   11.10 -import org.openide.util.Lookup;
   11.11  import org.openide.util.SharedClassObject;
   11.12  
   11.13  import org.netbeans.modules.zeroadmin.*;
   11.14 -import org.netbeans.core.NbTopManager;
   11.15 +import static org.netbeans.modules.zeroadmin.ZeroAdminInstall.saveWindowSystem;
   11.16  
   11.17  /**
   11.18   * Saves the configuration to the remote storage. Depends
   11.19 @@ -75,8 +73,7 @@
   11.20                      try {
   11.21              
   11.22                          // force the core to save pending stuff:
   11.23 -                        NbTopManager.WindowSystem windowSystem = (NbTopManager.WindowSystem)Lookup.getDefault().lookup(NbTopManager.WindowSystem.class);
   11.24 -                        windowSystem.save();
   11.25 +                        saveWindowSystem();
   11.26  
   11.27                          XMLBufferFileSystem bufFs = new XMLBufferFileSystem();
   11.28                          ZeroAdminInstall.copy(z.writableLayer.getRoot(), bufFs.getRoot(), true);