This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
[dev-200503141900, JDK 1.5.0_02] There is no way how user could exclude classes from final jar built by building the project. 'Exclude From JAR File' property in project properties doesn't exclude classes only things that are copied from src/ to dist/ folders.
Is there an use case for it? In my opinion there is no relevant one. If you need something so obscure you should rewrite the jar target in way you like. Sorry, but until someone else will complain about it I am not going to change it for the reasons David has described in the issue #51953. I don't want to create new additional exlude for jar target. But the fix of issue #49371 may help you in future.
OK, but I don't think that jarring part of my source tree is obscure use case, changing to ENHANCEMENT.
*** Issue 65958 has been marked as a duplicate of this issue. ***
Increasing prio.
(In reply to Tomas Zezula from comment #1) > Is there an use case for it? Here's mine. For Vaadin projects, it's normal to build your own widgetsets (js files generated from java files by GWT). When you have client classes, you don't need those packed into a WAR as class files, only as js.
Is it possible to attach such a sample project? Does the Vadim project use gwt compiler instead of java compiler to generate both js and class files into build/classes?
(In reply to Tomas Zezula from comment #6) > Is it possible to attach such a sample project? It's not that trivial, that needs a bunch of jars. > Does the Vadim project use gwt compiler instead of java compiler to generate > both js and class files into build/classes? It's spelled VAADIN. They seem to be Eclipse guys, but NetBeans is partially supported, too. Here's the relevant doc: https://vaadin.com/directory/help/using-vaadin-add-ons/netbeans The build file build-widgetset.xml (that works with vaadin version 6) is linked on that page. All the classes in the project are compiled to build/WEB-INF/classes because of the "compile" dependency. But I don't think that dependency is strictly necessary. I guess it's just for validating the sources. The js files are generated into web/VAADIN/widgetsets/*/. Here's my workaround: <target name="-do-dist-without-manifest" depends="init,compile,compile-jsps,-pre-dist" if="do.war.package.without.custom.manifest"> <dirname file="${dist.war}" property="dist.jar.dir"/> <mkdir dir="${dist.jar.dir}"/> <jar jarfile="${dist.war}" compress="${jar.compress}"> <fileset dir="${build.web.dir}" excludes="WEB-INF/classes/com/vaadin/client/**,WEB-INF/classes/.netbeans_*,${dist.archive.excludes}"/> </jar> </target> That leaves an empty com/vaadin directory in the WAR, so probably excluding from compilation would be better: <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"> <webproject2:javac excludes="**/com/vaadin/client/**" destdir="${build.classes.dir}" gensrcdir="${build.generated.sources.dir}"/> <copy todir="${build.classes.dir}" includeEmptyDirs="false"> <fileset dir="${src.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> </copy> </target>
Here is a use case that we have and would love to have a solution for. we have certain classes - let's say Dev License Mock objects that are part of our project. In the development version we would like our factory to return this class and in production a real License Object. We also dont want to be shipping our Dev License file in the jar. This exposes a security loophole.