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 142466 - [65cat] JARs recreated unnecessarily during incremental build using Ant 1.7.0
Summary: [65cat] JARs recreated unnecessarily during incremental build using Ant 1.7.0
Status: RESOLVED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-07-31 19:43 UTC by Michel Graciano
Modified: 2008-09-27 02:18 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample broken project (4.47 MB, application/octet-stream)
2008-09-26 18:23 UTC, Michel Graciano
Details
SWT linux to compile the project on Linux. Put it in genesis-3.1/genesis/lib/swt (1.63 MB, application/octet-stream)
2008-09-26 18:25 UTC, Michel Graciano
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2008-07-31 19:43:16 UTC
[ BUILD # : 200807291401 ]
[ JDK VERSION : 1.6.0_07 ]

I have a big project based on https://genesis.dev.java.net/ and for
6.5 all of my builds the jars are generated. For previous versions it
didn't happen. Maybe it is something about Compile on Save
misbehaviour?

All my packages are marked as outdate, as below:
XXX.YYYY added as XXX.YYYY/ is outdated.

But, if I run the target on console, everything is ok, no jars are
generated.
Comment 1 Lukas Hasik 2008-08-01 07:04:05 UTC
Michel, could you describe the scenario in more details?
Why P1? http://wiki.netbeans.org/BugPriorityGuidelines

jlahoda, could it be Compile on Save?
Comment 2 Michel Graciano 2008-08-11 20:51:04 UTC
My project when I compile using NetBeans 6.5, some of my jars are regenerated. If I use ant on command line or nb 6.1,
this not happen. I had no idea why is happen, but the jars are just regenerated if something is changed. There is
something in nb 6.5 changing the folders just before the build. If I have nb 6.5 and 6.1 opened in the same time, I can
rebuild the application several times on 6.1, and the problem don't happen, so, I understand that there is no
'background' operations running, it is just before the build, at least it is my impressions. What kind of info I can
provide for you?


Product Version: NetBeans IDE Dev (Build 200808111401)
Java: 1.6.0_06; Java HotSpot(TM) Client VM 10.0-b22
System: Linux version 2.6.24-19-generic running on i386; ISO-8859-1; pt_BR (nb)
Userdir: /home/hmichel/.netbeans/dev
Comment 3 Michel Graciano 2008-08-11 21:02:54 UTC
I found the problem. The problem is the ANT 1.7.1 with NetBeans 6.5. If I change my NetBeans 6.5 to work with ANT from
NetBeans 6.1 everything works great. Any idea about it?
If I use the ANT 1.7.1 from 6.5, even from command line, the problem happen.

Regards
Comment 4 Lukas Hasik 2008-08-12 09:35:53 UTC
AFAIK, there are no plans to rollback the ant to 1.7.0.
Could you look at the http://www.apache.org/dist/ant/RELEASE-NOTES-1.7.1.html

When/where are the jars created? After Save or when you use Clean&Build?
Comment 5 Jan Lahoda 2008-08-12 12:42:55 UTC
I tried this:
-checked-out the sources from https://genesis.dev.java.net/
-tried to build ("ant") the "ant-tasks" subproject, from command line (no IDE involved), using ant 1.7.0. Each time I
built the subproject, I got a new output jar.

So, I am not sure if this is in any way related to the IDE. Could you please described what exactly are you trying to do?

When Compile on Save is enabled, the first time user Runs the project, the output folder is populated with IDE-generated
.class files. The .class files have intentionally broken timestamps, so that if the project is built from the command
line, the .class files are regenerated. But this should happen only once. J2SE Projects force "clean" in this case (only
once again, if you do "build", "build", "build", only the first one should be forced "clean" due to compile on save, and
only if the project has been Run using the compile on save before).
Comment 6 Michel Graciano 2008-08-12 13:42:51 UTC
I am using a free form project. The problem happen just when building the application. I tried it with a small
application but the problem don't happen. I am trying to create a project to simulate it. For now, I am using the ant
1.7.0 from 6.1 (I change my default ant at nb 6.5), and I really think that the problem is on ant. (the ant on NetBeans
is a modified version?)
I saw that ant 1.7.1 have some optimizations for large filesets... I will try to investigate it.
What really is awkward the fact that jars are rebuild because some folders are out to date. All classes and resources
are up to date for ant, but no details about it is shown on output. I already checkout the project again to try it, but
no changes on build behaviour.
About Compile on Save, I don't thing anymore it is the case, because changing the ant the problem is solved, so, if no
change on ant was made, the behaviour should be the same with both ant versions. Any ideas how can I get more details,
or how test it is appreciated.

Regards
Comment 7 Jan Lahoda 2008-08-12 13:49:36 UTC
ant seems to be a better place.
Comment 8 Jesse Glick 2008-08-21 01:08:53 UTC
It is certainly possible that some internal change in Ant 1.7.1 broke timestamp calculations under some conditions. If
you can create a self-contained reproducible test case then it can be investigated.
Comment 9 Lukas Hasik 2008-09-09 13:56:23 UTC
michel, do you still face this issue with latest builds? There used to be some other bugs fixed in the parsing of the 
jars.

Please, reopen if it happens still

Comment 10 Michel Graciano 2008-09-09 16:02:20 UTC
Yes, it is valid yet. But the problem I think is about ant, since I can reproduce it from command line tool, but just
for some projects. I will try to create a small use case to reproduce it asap, but no much time to do it, and all the
tests I tried before didn't work as I expected.
For now I am using Ant from nb 6.1... no way to use ant from nb 6.5.
Comment 11 Michel Graciano 2008-09-26 18:21:31 UTC
Hi,
I hope I can reproduce it know. First of all, get genesis project from
https://genesis.dev.java.net/files/documents/2063/98275/genesis-all-3.1.tar.gz
I will attach a example project with the problem. Just unzip it on genesis-3.1/samples folder. Open this nb project on
IDE and press F11 some times, and you will see that jars and ear are recreated. But, sometimes just the jar is rebuilt
(don't ask me why...). It is a really non deterministic problem, but don't happen before ant 1.7.1. I hope you now can
reproduce it and any thing I additional info you need, just let me know.

btw, it is a P1 because it is a regression.
Comment 12 Michel Graciano 2008-09-26 18:23:41 UTC
Created attachment 70688 [details]
Sample broken project
Comment 13 Michel Graciano 2008-09-26 18:25:56 UTC
Created attachment 70689 [details]
SWT linux to compile the project on Linux. Put it in genesis-3.1/genesis/lib/swt
Comment 14 Michel Graciano 2008-09-26 18:28:35 UTC
I attached swt linux lib too because it is a example with swt too.

Regards
Comment 15 Jesse Glick 2008-09-26 19:22:59 UTC
I will look at it.

Certainly not P1, perhaps P3 if few people are affected; the symptom is not that terrible, and you can always choose to
use Ant 1.7.0 if you prefer.
Comment 16 Jesse Glick 2008-09-26 20:23:16 UTC
Able to reproduce eventually (could not at first).

Setting filesonly="true" on <jar> in samples/admin/master_build.xml cures the issue.
Comment 17 Jesse Glick 2008-09-26 20:59:35 UTC
I think there is something wrong with the handling of filesonly="false" (the default setting), though it is very
difficult to reproduce on your example, and your script is so complex that I can scarcely follow what it is trying to
do, much less come up with a minimal test script. I filed

https://issues.apache.org/bugzilla/show_bug.cgi?id=45902

with a suggested fix in Ant code, but I don't have enough background to know whether it is really right.
Comment 18 Michel Graciano 2008-09-27 02:18:18 UTC
Yes, this works for now. I know that the example is really complex, but it is really hard to reproduce in a "small"
sample. BTW, about priority, for my, following the guidelines, any regression is a P1, even with a workaround or for
third party API, since a IDE feature is no more working correctly as before.
BTW, I had a more complex variant of this script where I put filesonly="true" for some <zip> too.

Thanks for your quickly answer.