Netbeans ant build error 'unsupported customize element'

I upgraded Netbeans 8.0.1 from 7.0.1 and my java program compiles fine if Web Launch is disabled. As soon as Web Launch is on, I get the following error:

C:\NetBeansProjects\SearchCriteriaEditor\nbproject\jnlp-impl.xml:480: unsupported element customize 
  • in this section of the jnlp-impl.xml file:

    <target name="-do-jar-jnlp-application" depends="-init-filename,-test-jnlp-type,-init-macrodef-copylibs" if="is.application+mkdist.available"> <j2seproject3:copylibs manifest="${tmp.manifest.file}"> <customize> <attribute name="Main-Class" value="${main.class}"/> </customize> </j2seproject3:copylibs> <echo>To run this application from the command line without Ant, try:</echo> <property location="${jnlp.dest.dir}/${jnlp.file}" name="jnlp.file.resolved"/> <echo>javaws "${jnlp.file.resolved}"</echo> </target>

The fix, as I understand it, is this: 'add the following to the junit custom macro definition:'

 <attribute default="" name="testmethods"/> <element name="customize" optional="true"/> <customize/> 

The problem is that I have no idea where it is, and I have not changed my ant file anyway ... can someone give me a little more information? I assume the fix is โ€‹โ€‹somewhere in the jnlp-impl.xml file; I just have no idea where to put it.

Edit update: added all sections with links to "copylibs" in the jnlp-impl.xml file -

 <target name="-test-jnlp-type" depends="-test-jnlp-enabled" if="is.jnlp.enabled"> <condition property="is.applet"> <equals arg1="${jnlp.descriptor}" arg2="applet" trim="true"/> </condition> <condition property="is.application"> <equals arg1="${jnlp.descriptor}" arg2="application" trim="true"/> </condition> <condition property="is.component"> <equals arg1="${jnlp.descriptor}" arg2="component" trim="true"/> </condition> <condition property="is.applet+mkdist.available"> <and> <isset property="libs.CopyLibs.classpath"/> <istrue value="${is.applet}"/> </and> </condition> <condition property="is.application+mkdist.available"> <and> <isset property="libs.CopyLibs.classpath"/> <istrue value="${is.application}"/> </and> </condition> <condition property="is.component+mkdist.available"> <and> <isset property="libs.CopyLibs.classpath"/> <istrue value="${is.component}"/> </and> </condition> </target> ...... <target name="-do-jar-jnlp-application" depends="-init-filename,-test-jnlp-type,-init-macrodef-copylibs" if="is.application+mkdist.available"> <j2seproject3:copylibs manifest="${tmp.manifest.file}"> <customize> <attribute name="Main-Class" value="${main.class}"/> </customize> </j2seproject3:copylibs> <echo>To run this application from the command line without Ant, try:</echo> <property location="${jnlp.dest.dir}/${jnlp.file}" name="jnlp.file.resolved"/> <echo>javaws "${jnlp.file.resolved}"</echo> </target> <target name="-do-jar-jnlp-component" depends="-test-jnlp-type,-init-macrodef-copylibs" if="is.component+mkdist.available"> <j2seproject3:copylibs manifest="${tmp.manifest.file}"/> </target> 

Thanks in advance.

+5
source share
1 answer

<j2seproject3:copylibs calls the <j2seproject3:copylibs macro with the j2seproject3 namespace j2seproject3 . There should be a place in the assembly file where the copylibs macro is copylibs , similar (but not necessarily accurate) to:

 <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> 

The above line should logically exist inside the target -init-macrodef-copylibs , and the customize element should also be defined here. Below is a snippet based on a sample NetBeans project that I have. The content probably won't match exactly what you have, so take my answer with salt:

 <macrodef name="copylibs" uri="http://www.netbeans.org/ns/j2se-project/3"> ... <!-- some attributes may be defined here first --> <element name="customize" optional="true"/> <!-- customize should be defined here --> <sequential> ... <!-- somewhere in the macrodef --> <copylibs compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}" manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}"> <fileset dir="${build.classes.dir}"/> <manifest> <attribute name="Class-Path" value="${jar.classpath}"/> <customize/> <!-- this is where customize is used --> </manifest> </copylibs> ... </sequential> </macrodef> 
+2
source

Source: https://habr.com/ru/post/1205606/


All Articles