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 37957 - PMD appears twice in alpha AU
Summary: PMD appears twice in alpha AU
Status: RESOLVED FIXED
Alias: None
Product: updatecenters
Classification: Unclassified
Component: AU Masters (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: rnovak
URL:
Keywords:
: 38223 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-12-10 08:09 UTC by Daniel Blaukopf
Modified: 2003-12-19 11:35 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
ide.log with exceptions (13.75 KB, text/plain)
2003-12-10 10:06 UTC, Lukas Hasik
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Blaukopf 2003-12-10 08:09:48 UTC
In the latest dev build (Dec 9), I already had PMD
0.90 installed. When I tried to upgrade to 0.91 in
the alpha AU, I saw that PMD appeared twice under
"Tools". When I select the first, I get an
exception  when the download starts. Selecting and
installing the second entry works correctly.
Comment 1 Lukas Hasik 2003-12-10 09:31:33 UTC
could you please attach the exception ? - as attachment
and I've noticed that you always set the version as 'current', it's
more useful to set it as '4.0 dev' (for now) because some bugs stay
unresolved for longer time and the versions change :)

thanks for reports
Comment 2 Lukas Hasik 2003-12-10 10:06:03 UTC
Created attachment 12494 [details]
ide.log with exceptions
Comment 3 Lukas Hasik 2003-12-10 10:25:36 UTC
I did try it from NB UC Alpha and here is what I've found :

1, download and install only [Tools-PMD] 
- it doesn't work -> NPE during downloading - first two NPE in ide.log

2, download and install [Developing Netbeans - PMD Rules for NB]
-everything works ok -> 'PMD rules ...' and 'PMD' modules are
downloaded and installed. Only the IOException appears in console -
see ide.log

- I've just found that the sequence of PMD modules in UC wizard in
'Include to Install' has to be 'PMD rules...' first otherwise it
doesnt work and the NPE appears

3, PMD is twice in NB UC Alpha under [Tools-PMD] and it's there even
if it's been already installed.


I think that there is something wrong in UC Alpha config - twice PMD
-> attaching rnovak

And there is problem in PMD itself -> dont know who to attach, Radim
could you help ?
Comment 4 Lukas Hasik 2003-12-10 15:50:17 UTC
Jesse, PMD is your 'work'. Could you please check it ? or reassign if
I'm wrong, thanks.
Comment 5 Jesse Glick 2003-12-10 17:50:50 UTC
Yes, it's in the Tools category of www/www/updates/alpha/dev_1.6_.xml
twice. I don't know why. It is listed in nbbuild/build.properties,
just once.
Comment 6 rbalada 2003-12-11 12:24:46 UTC
There are four NBM files with "pmd" string in filename found in local
cache of NetBeans dev Alpha Update Centre. Let me know which file
should be removed from the local cache, so it won't appear twice on
dev Alpha Update Centre. My guess is to remove file
org-netbeans-modules-pmd-ext.nbm, which is probable former filename
for PMD NBM.

ffjre@ferda:/space/NetBeans/nbtrunk/auc/safe/nbms/alpha/dev$ ls -la *pmd*
-rw-r--r--   1 ffjre    ffjre      11239 Nov 28 01:26
org-netbeans-modules-pmd-ext.nbm
-rw-r--r--   1 ffjre    ffjre     717729 Dec  8 15:41 pmd-subst.nbm
-rw-r--r--   1 ffjre    ffjre     719343 Dec  8 15:41 pmd.nbm
-rw-r--r--   1 ffjre    ffjre      21087 Nov 21 03:26 tasklist-pmd.nbm
ffjre@ferda:/space/NetBeans/nbtrunk/auc/safe/nbms/alpha/dev$

Comment 7 Jesse Glick 2003-12-11 14:17:48 UTC
org-netbeans-modules-pmd-ext.nbm is a separate module
(contrib/pmd-nb-ext) and should remain. tasklist-pmd.nbm similarly is
another module which should remain.

pmd.nbm should be there. pmd-subst.nbm should not. How did it get
there? contrib/pmd-nb-wrapper does create such a file in its tmp/
subdirectory; why is it getting published?

IMHO only *.nbm in the top level of a module listed in the module
config should be published. (Note that tasklist/* modules create NBMs
directly in tasklist/*.nbm which is wrong and should be fixed.)
Comment 8 rbalada 2003-12-12 15:13:09 UTC
Jesse,

why the nbm is created when it should not be used? That doesn't make
sense to me.

The file is there for simple reason. The alpha NBMs build, if
successful, then parses the Ant's build log for lines ending with
'\.nbm$' and the files are then packed into alpha-nbm package.

Taking just *.nbm files from 'root-modules' doesn't work. Part of
modules do produce to root module, part of them produce to it's
submodule subdirectories. 

I'm curious why it's created, when it's not about to be used. If the
file should not be there, then it should not be created. Otherwise I
need different solution how to gather exactly&only the NBM files,
which were built during alpha NBMs build. The problem is, that simple
'find' finds also files committed to repository (in www subdirs). On
this place I have to say, that using *_nowww aliases is not reliable
enough due to possible desync between CVSROOT/modules and
nbbuild/build.properties. So the parsing of build log file is the most
exact and reliable option.

So my proposal is:

1) someone has to fix contrib/pmd-nb-wrapper to not produce
   confusing crap introduced by pmd-subst.nbm and let me know
   when the fix is in place
2) I'll remove pmd-subst.nbm from local cache and rebuild
   Alpha NBMs catalog

Any other suggestions?
Comment 9 Jesse Glick 2003-12-12 16:36:43 UTC
$basedir/tmp/pmd-subst.nbm is a temporary file created as part of the
build process. Packaging up a proper $basedir/pmd.nbm is a little
complex and requires several stages (cf. $basedir/build.xml). This is
one of them. It is not intended to be used for anything other than as
an intermediate file in one build step. I don't see why a module build
script should be restricted in what it does in its own private scratch
directories as part of the build process; this should not be the
business of the master build system.

My proposal I already gave - remove whatever complex tricks you have
in the publishing script to scan the build log etc., and just publish
${basedir}/*.nbm where basedir is ${nbroot}/${module} and module is an
entry in ${config.modules.daily-alpha-nbms}. Only a few modules put
their NBMs in weird places - so just fix those modules (*) to put
their NBMs in the normal place, and you are done. Mostly
search-and-replace in a few build scripts; shouldn't take more than an
hour or two to do incl. testing it on the standard alpha AU config.

(In the longer term, NBM names like module JAR names should probably
be standardized to use the module code name base, e.g.
org-netbeans-modules-java.nbm. And/or the master system should define
an Ant property giving a location where NBMs should be built, so that
there is no need to scan module directories for build products;
similar to mzlamal's ongoing patches.)

As a temporary workaround I can use a temp filename that does not end
in ".nbm", if that is the exact criterion you use to find things to
publish.

(*) To find potentially affected scripts, try

$ egrep 'file="[^"]*/[^"]*\.nbm"' */build.xml */*/build.xml
*/*/*/build.xml
Comment 10 rbalada 2003-12-12 20:53:46 UTC
Jesse,

I don't see a worth in implementing large, complicated and less
reliable procedure against simple deleting or renaming of unused file.
From my point of view, your proposal is more complex and tricky (at
least more tricky than current procedure). Michal already prepared
"clusters" implementation, which would also help producing NBM files
into one directory.

In the short term (say till NB 3.6 FCS) deleting/renaming is enough.
If the file is not found, it's ignored.

Actually I'm not willing to remove scan of build log file, when it's
the only reliable procedure I can follow.

If the file is just temporary file, simple delete or renaming seems to
be the best and easiest solution.
Comment 11 Jesse Glick 2003-12-12 23:59:26 UTC
Yes "clusters" was what I wanted to refer to re. long-term goals.

Can't really understand how fixing a handful of nonstandard build
scripts is "large, complicated, and less reliable", but whatever.
Renaming temp file in contrib/pmd-nb-wrapper.

contrib/pmd-nb-wrapper/build.xml 1.4

Please check that the stale NBM is actually cleared from the AU server
on the next publishing cycle - sounds like you may need to do it manually.
Comment 12 Lukas Hasik 2003-12-19 10:44:09 UTC
*** Issue 38223 has been marked as a duplicate of this issue. ***
Comment 13 rbalada 2003-12-19 11:35:06 UTC
FIXED.

I've forgot to mark this issue FIXED. It's fixed since the weekend Dec
13-14.

Also it's strange that the duplicate issue 38223 appeared, even the
pmd-subst.nbm is not referred from Alpha AU catalog.