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 200634 - catalog.xml dumped in Maven project root dir
Summary: catalog.xml dumped in Maven project root dir
Status: RESOLVED DUPLICATE of bug 197467
Alias: None
Product: xml
Classification: Unclassified
Component: Schema (show other bugs)
Version: 7.0.1
Hardware: PC Linux
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 13:07 UTC by Jesse Glick
Modified: 2011-11-01 21:31 UTC (History)
3 users (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 Jesse Glick 2011-08-03 13:07:44 UTC
I just noticed in 20110801-f9688176dcab that if I try to run schema validation on an XML file in a Maven project, sometimes (when?) a meaningless catalog.xml is written to the project root dir without my consent, producing an alarming VCS modification badge and forcing the user to manually delete the IDE's debris.
Comment 1 Martin Fousek 2011-08-04 07:08:05 UTC
Firstly my steps for reproducing that:
1, create maven web project
2, include spring framework
3, invoke CC in any xml configuration file
-> catalog.xml is written inside the maven project :/

It seems to be cause by caching the catalog. Own retrieved catalog is cached inside USER_DIR/var/cache/mavencachedirs/.. which is perhaps correct but then is written into the project catalog.xml information about all registered catalogs for that project. It's my guessing together with some time spend with debugging:

In org.netbeans.modules.xml.retriever.impl.Util:170 starts the caching procedure and Util:176 creates new catalog.xml file inside the project directory to store already retrieved data. 

There are two questions:
- to XML owners: why there aren't found publicCatFO (but it can perhaps happen)
- to Maven guys: where should be this project related information stored

Anyway, I'm afraid that this happens every time by invoked CC inside XML file  with defined XSD in the header which belongs to the Maven project.
Comment 2 Martin Fousek 2011-08-04 07:13:14 UTC
Sorry, maybe more clearly sounds:

In org.netbeans.modules.xml.retriever.impl.Util:170 starts the caching
procedure and Util:176 creates new catalog.xml file inside the project
directory to store places to already retrieved and cached catalogs for given project.
Comment 3 Jesse Glick 2011-08-04 11:35:22 UTC
(In reply to comment #1)
> - to Maven guys: where should be this project related information stored

Assuming it is just a cache, then use whatever ProjectUtils.getCacheDirectory reports.
Comment 4 owen.farrell 2011-09-08 15:08:29 UTC
(In reply to comment #0)
> I just noticed in 20110801-f9688176dcab that if I try to run schema validation
> on an XML file in a Maven project, sometimes (when?) a meaningless catalog.xml
> is written to the project root dir without my consent, producing an alarming
> VCS modification badge and forcing the user to manually delete the IDE's
> debris.

I'm experiencing this same problem in 7.0.1 - so would this issue be a result of recent updates to the XML or Maven plugins?

~Owen
Comment 5 Jesse Glick 2011-09-09 16:29:08 UTC
(In reply to comment #4)
> I'm experiencing this same problem in 7.0.1

Backdating Version field accordingly. I suspect this is a much older problem.

> would this issue be a result of recent updates to the XML or Maven plugins?

More likely you just did not run into it before, for reasons unrelated to the update.
Comment 6 Martin Fousek 2011-09-12 07:48:52 UTC
> 
> I'm experiencing this same problem in 7.0.1 - so would this issue be a result
> of recent updates to the XML or Maven plugins?
> 

As Jesse said, it shouldn't be. Catalog.xml was stored there already before fix for issue #190570 which was AFAIK the only one patch for XML to nb701.
Comment 7 Svata Dedic 2011-10-18 11:56:18 UTC
catalog.xml is not created or updated in project root dir for auto-added schemas; see Bug #197467
Comment 8 Jesse Glick 2011-11-01 21:18:26 UTC
Was this just fixed recently? What is the changeset fixing it? (Must either have Target Milestone set and a particular changeset mentioned, or be marked a duplicate.)

I saw some problem recently (in a dev build) involving fetch.xml [1]; I edited it (revision 1190402) and later saw some unwanted files in the source tree that seem to have been created by the IDE. (Not ${basedir}/catalog.xml but something in a subdir - cannot remember the exact name now.) Unsure how to reproduce.

[1] https://svn.apache.org/repos/asf/ant/core/trunk/fetch.xml
Comment 9 Jesse Glick 2011-11-01 21:18:51 UTC
(That would have been in an automatic project, FWIW.)
Comment 10 Svata Dedic 2011-11-01 21:22:18 UTC
Changeset: http://hg.netbeans.org/main-golden/rev/a81e7a596f23

automatically retrieved stuff should be in nbproject/private for now. For future release(s) it would be better to rethink the whole XML retriever and add cache/refresh management.
Comment 11 Jesse Glick 2011-11-01 21:31:06 UTC
(In reply to comment #10)
> Changeset: http://hg.netbeans.org/main-golden/rev/a81e7a596f23

So, a dupe.

> automatically retrieved stuff should be in nbproject/private for now.

Or whatever CacheDirectoryProvider says, more generally?

*** This bug has been marked as a duplicate of bug 197467 ***