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 50676 - taskdef class org.netbeans.modules.web.project.ant.CopyFiles cannot be found - remove copyfiles
Summary: taskdef class org.netbeans.modules.web.project.ant.CopyFiles cannot be found ...
Status: CLOSED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Pavel Buzek
URL:
Keywords:
: 45284 (view as bug list)
Depends on:
Blocks: 54476 54570
  Show dependency tree
 
Reported: 2004-10-20 21:48 UTC by wqtnetbeans
Modified: 2006-03-24 12:54 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wqtnetbeans 2004-10-20 21:48:44 UTC
Version:
netbeans-4_0-qbuild-bin-200410181322-windows-18_Oct_2004_1322.exe

I created a version-controlled webapp using the
"web application with existing sources" wizard.
Everything runs fine within NB (WindowsXP), so I
checked the generated "build.xml" and the entire
"nbproject" folder into CVS (minus the "private"
folder of course). 

After that, I checked out the webapp module from
CVS on a Linux box, together with the NB meta
stuff - build.xml and "nbproject" folder. I tried
running 

$ant dist

and got the following error:

==============================
$ ant dist
Buildfile: build.xml

-pre-init:

-init-private:

-init-user:

-init-project:

-init-macrodef-property:

-do-init:

-post-init:

-init-check:

-init-macrodef-javac:

-init-macrodef-java:

-init-macrodef-nbjpda:

-init-macrodef-debug:

-init-taskdefs:

BUILD FAILED
/home/qingtian/vcs/nb/tel-web-ube/nbproject/build-impl.xml:167:
taskdef class
org.netbeans.modules.web.project.ant.CopyFiles
cannot be found

===============================

It seems the script is missing some NB specific
jar files. I think this should be a bug since the
promise was that the generated build script should
run even outside of NB. On the other hand, the
promise is kept in the case of "standard java"
project - I can use the generated script as it is
outside of the IDE.
Comment 1 Petr Jiricka 2004-10-21 15:20:26 UTC
Hi, what I think could help is the following:

- install the IDE on the other machine
- start the IDE
- open the project checked out from CVS
- shut down the IDE
- run the build from command line

Does that fix this problem? Thanks.

Comment 2 wqtnetbeans 2004-10-21 19:43:37 UTC
Hi,

I followed your instruction step by step. It does fix the problem if I
execute the instruction with daily-build, but not with beta2.

However, this is not a solution regardless, if we want to use the
generated script on our Unix server: We only have console access to
the Unix box, and are not allowed to use any "X-Window" software to
install/run anything on it. A real solution to this matter would be
really really appreciated.

Thanks!!
Comment 3 Pavel Buzek 2004-10-21 21:25:59 UTC
If you cannot open the project after check out here is another simple
workaround. You can set user.properties.file to point to location of
netbeans userdir. Or you can only take the copyfiles.jar and set the
copyfiles.classpath property to point to it.

More info at: http://projects.netbeans.org/buildsys/design.html#headless

The copyfiles library will hopefully be removed in future.
Comment 4 wqtnetbeans 2004-10-21 23:14:03 UTC
Thanks for the suggestions. It's sort of sad, though, to read the link
you send where it implies customized Ant stuff seems to be un-avoidable.

I do have a suggestion: The IDE should have a standard way of bundle
NB specific build stuff into the "nbproject" folder, such that the NB
add-ons are transparent to the "headless builder".

In this case, for example, the IDE could copy the entire "ant/extra"
folder that contains the NB jar files needed for the build, into the
"nbproject" folder, and specify the "copyfile.classpath" property in
the "project.properties" file using RELATIVE path pointing to
"nbproject/ant/extra/copyfiles.jar". That way, a non-NB user can still
checks out from the CVS and run "$ant dist" without even knowing
what's going on under the hood.

Just my two cents.

Thanks again!
Comment 5 navneet 2004-11-29 10:25:09 UTC
It is interesting that you are raising this again. I had raised this a
whole lot earlier in the Netbeans 4.0 dev cycle and here is a trace of
what i heard from them:

http://www.netbeans.org/issues/show_bug.cgi?id=45283

And then they filed another issue at:

http://www.netbeans.org/issues/show_bug.cgi?id=45284
Comment 6 wqtnetbeans 2004-11-30 14:24:40 UTC
Navneet- I was just using this issue to ask a more general question,
not to "raise it again". Since the issue applies only to web/j2ee
project in nb4.0, not j2se project, I am concerned that it will become
a general trend in nb4.1, wherein more and more j2ee project scripts
are not runnable outside of NB "the way they are".
Comment 7 zikmund 2004-11-30 17:39:21 UTC
QA agrees that it should be fixed in 4.1 in both (web/j2ee project).

Setting correct Version, resetting TM to TBD and increasing priority.
Comment 8 navneet 2004-12-01 07:08:31 UTC
I totally agree with your view point, and that is the reason i too had
raised this.

Its good that QA now agrees with the view points of all of us and has
decided to fix this in the next release. I just hope it is sooner than
4.1 ( maybe 4.0.1 ).

Comment 9 zikmund 2004-12-01 09:24:25 UTC
The closest release after 4.0 is 4.1. No chance to build another one,
sorry.
Comment 10 zikmund 2004-12-01 10:52:23 UTC
Changing Version to 4.1 - it's legitimate P2 in 4.1, but as designed
(= at most P3) in 4.0.
Comment 11 zikmund 2005-02-15 10:40:55 UTC
*** Issue 45284 has been marked as a duplicate of this issue. ***
Comment 12 zikmund 2005-02-15 10:41:59 UTC
See duplicate issue 45284 for Jesse's and Yarda's comments on solution.
Comment 13 zikmund 2005-02-15 17:15:45 UTC
*** Issue 45284 has been marked as a duplicate of this issue. ***
Comment 14 zikmund 2005-02-15 17:18:44 UTC
The fix will be: removing copyfiles task, it can't stay in 4.1 projects.
Comment 15 Pavel Buzek 2005-02-25 17:48:13 UTC
The copyfiles is doing 2 things: works for multiple files/folders and
distinguishes between files and folders.

The solution is to add: lib.foo.classpath.libfileX,
lib.foo.classpath.libdirX (X=0..number of files in library) into
private.properties when adding a library or additional war content,
update this when the library changes; the <library> tag in project.xml
will have attributes files=A and/or dirs=B. The build-impl.xml will
generate <copy file="${lib.foo.classpath.libfileX} ..> or <copy
..><fileset dir="${lib.foo.classpath.libdirX}>..
The version of web project will have to be increased to contain the
attribute for number of files/dirs in library tag. If the project does
not have this the build-impl.xml will have to be generated the old
way, ie. with copyfiles.
Comment 16 Pavel Buzek 2005-02-25 22:21:35 UTC
fixed
Comment 17 wqtnetbeans 2005-03-14 17:13:14 UTC
When will the fix be available? It's not in 4.1 beta. Should I look for it in
daily builds? Thanks. -Qingtian
Comment 18 zikmund 2005-03-14 17:54:31 UTC
Yes, it is fixed in daily builds.
Comment 19 wqtnetbeans 2005-03-16 22:33:46 UTC
I checked in Mar-15-2005 qbuild. The copy functionality works only for files,
but not directories. i.e. It won't work if you specify an entire folder to be
copied to the WAR file in the "packaging" node of the project properties. -Qingtian

Comment 20 zikmund 2005-03-18 12:53:48 UTC
There were some additional fixes after Q-build branching. Please try build
200503172015 or later (as soon as it will be downloadable). It works fine for me
there.
If it won't work for you, please file a new issue, thanks.

This issue is verified.