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.

Bug 231468 - copylibs doesn't support the "excludeFromCopy" attribute
Summary: copylibs doesn't support the "excludeFromCopy" attribute
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Project (show other bugs)
Version: 7.3
Hardware: All Windows 7
: P3 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
: 233020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-06-18 17:38 UTC by assylias
Modified: 2013-10-11 13:28 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (61.78 KB, application/octet-stream)
2013-06-18 17:55 UTC, assylias
Details

Note You need to log in before you can comment on or make changes to this bug.
Description assylias 2013-06-18 17:38:33 UTC
I have run a few updates today and I can't build a simple ant project any more. I get this error:

copylibs doesn't support the "excludeFromCopy" attribute

relating to the following line in build-impl

<copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}" index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
Comment 1 Milos Kleint 2013-06-18 17:46:22 UTC
have you been manually editing the build-impl.xml file?
is your build-impl.xml file in version control? can you do a diff of what was there before the upgrade and what it's there now? (in case the IDE updated the build-impl.xml file).

also please attach the IDE log file - http://wiki.netbeans.org/FaqLogMessagesFile
Comment 2 assylias 2013-06-18 17:51:54 UTC
No I haven't modified the build-impl manually. And unfortunately no, it is not in version control as it is a dummy project that I use for testing. And my projects which are in a version system use maven...

FYI, the problematic line in build-impl is called by:

    <target depends="init,-init-macrodef-copylibs,compile,-pre-pre-jar,-pre-jar,-do-jar-create-manifest,-do-jar-copy-manifest,-do-jar-set-mainclass,-do-jar-set-profile,-do-jar-set-splashscreen" if="do.mkdist" name="-do-jar-copylibs">
        <j2seproject3:copylibs manifest="${tmp.manifest.file}"/>
        <echo level="info">To run this application from the command line without Ant, try:</echo>
        <property location="${dist.jar}" name="dist.jar.resolved"/>
        <echo level="info">${platform.java} -jar "${dist.jar.resolved}"</echo>
    </target>

I'll try to see if I can reproduce with a new project.
Comment 3 assylias 2013-06-18 17:55:28 UTC
Created attachment 135992 [details]
log file
Comment 4 assylias 2013-06-18 18:04:31 UTC
I have created a new project and used the build-impl.xml and the lib folder with the CopyLibs subfolder and the netbeans.properties file.

That solved the issue.
Comment 5 Milos Kleint 2013-06-20 07:10:39 UTC
tzezula: excludeFromCopy was added in may, maybe some sort of incompatibility between the script and the version of copylibs available to the project?
Comment 6 Tomas Zezula 2013-06-20 07:23:35 UTC
New project (project updated created in newer IDE) opened in old (pre NB 7.4) IDE.
Comment 7 Tomas Zezula 2013-06-20 07:27:38 UTC
There are 2 cases:

1st) Shared libraries (project has it's own lib folder containing the CopyLibs.jar) in such a case the CopyLibs.jar is updated to a new version (NB 7.4) when you open the project .

2nd) Non shareable (global) libraries. When you open such a project in older version of NetBeans you don't have a new version of CopyLibs.jar as you run on NB 7.3. In this case you need the older IDE to regenerate the build-impl.xml (for example by deleting it and reopening).
Comment 8 assylias 2013-06-25 12:54:49 UTC
I am not 100% sure but I might have opened the project in the nightly build that I use to test Java 8.
Comment 9 Milos Kleint 2013-07-22 10:59:43 UTC
*** Bug 233020 has been marked as a duplicate of this bug. ***
Comment 10 Kurse 2013-09-13 19:19:10 UTC
I found a fix to this issue however I still have no idea why this happens. You must go to the build-impl.xml and on line 829 and remove the setting that says excludeFromCopy. This will them allow you to successfully compile your code. The resulting file is also runnable and accurate.
Comment 11 areeda 2013-10-10 13:31:43 UTC
This append to me with 7.4.rc2 today.

I opened a project with maybe a dozen dependencies in 7.4rc2, clean and build then when I went back to 7.3.1 and try to clean/build the error reported is:

<path to 1st dependent project>/nbproject/build-impl.xml:990: The following error occurred while executing this line:
<path to 1st dependent project>/nbproject/build-impl.xml:834: copylibs doesn't support the "excludeFromCopy" attribute
BUILD FAILED (total time: 25 seconds)

I'm running this in a VM on my mac laptop (getting ready for a trip) the NetBeans environments are:

7.4.rc2 for testing

Product Version: NetBeans IDE 7.4 RC2 (Build 201309252201)
Java: 1.7.0_25; OpenJDK 64-Bit Server VM 23.7-b01
Runtime: OpenJDK Runtime Environment 1.7.0_25-root_2013_06_20_08_47-b00
System: Linux version 2.6.32-358.18.1.el6.x86_64 running on amd64; UTF-8; en_US (nb)
User directory: /home/joe/.netbeans/7.4rc2
Cache directory: /home/joe/.cache/netbeans/7.4rc2

7.3.1 where error occurs:

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_25; OpenJDK 64-Bit Server VM 23.7-b01
Runtime: OpenJDK Runtime Environment 1.7.0_25-root_2013_06_20_08_47-b00
System: Linux version 2.6.32-358.18.1.el6.x86_64 running on amd64; UTF-8; en_US (nb)
User directory: /home/joe/.netbeans/7.3.1
Cache directory: /home/joe/.cache/netbeans/7.3.1

Editing the build-imp.xml files by hand to remove the excludefromcopy attribute does work.

Joe
Comment 12 Tomas Zezula 2013-10-10 13:38:15 UTC
You tries to load project with (NB 7.4 build-impl.xml) in older version of NB 7.3.
Comment 13 areeda 2013-10-10 13:59:12 UTC
Hi Tomas,

That is correct.  I am in a production environment, this project is a Java Web App running under Apache and Tomcat.  I am trying to confirm that 7.4 is ready to become our development environment on multiple workstations.

If this is a design feature that means code checked in with 7.4 cannot be used with 7.3.1 (without hand editing xml files) so be it but the transition will take longer if it becomes a point of no return.

Thanks,
Joe
Comment 14 Tomas Zezula 2013-10-11 13:21:07 UTC
The IDE needs to update the build script when the project is opened otherwise the new features and bug fixes will not work. 

There is an easy way how to solve the problem, delete the build-impl.xml file and reopen the project in NB 7.3. The build-impl.xml is always regenerated when it's missing when the project is opened.

Other but more complex solution is using shared libraries which copies the custom tasks among libraries.

Hope it helped.
Comment 15 areeda 2013-10-11 13:28:54 UTC
Thanks Tomas,

I understand the need to occasionally break backward compatibility to add new features.

For us I think this means we cannot check in code from 7.4 until everyone agrees to upgrade to 7.4. 

So far I've seen some nice features (better HTML5 support, better code analysis for Java) but no must-haves that can't wait.

With previous versions we were able to have one person work with the pre-release to make sure everything worked while working on actual projects.

This time I think we will wait for the release and do the testing and transition all at once.

Best,
Joe