--- a/xml.retriever/src/org/netbeans/modules/xml/retriever/impl/RetrieverImpl.java Sat Jul 30 06:44:20 2011 +0400 +++ a/xml.retriever/src/org/netbeans/modules/xml/retriever/impl/RetrieverImpl.java Mon Aug 01 10:45:42 2011 +0200 @@ -65,6 +65,7 @@ import org.netbeans.modules.xml.retriever.RetrieveEntry; import org.netbeans.modules.xml.retriever.XMLCatalogProvider; import org.netbeans.modules.xml.retriever.catalog.CatalogWriteModel; +import org.netbeans.modules.xml.retriever.catalog.Utilities; import org.netbeans.modules.xml.retriever.catalog.Utilities.DocumentTypesEnum; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; @@ -123,8 +124,14 @@ } URI cfuri = null; if(!relativePathToCatalogFile.isAbsolute()){ - FileObject prjRtFO = prj.getProjectDirectory(); - cfuri = FileUtil.toFile(prjRtFO).toURI().resolve(relativePathToCatalogFile); + if (prj != null) { + FileObject prjRtFO = prj.getProjectDirectory(); + cfuri = FileUtil.toFile(prjRtFO).toURI().resolve(relativePathToCatalogFile); + } else { + // For Maven based projects the project directory doesn't contain cached catalogs. + // In these cases should be used catalog.xml within destination directory. + cfuri = destinationDir.getParent().getURL().toURI().resolve(Utilities.PRIVATE_CATALOG_URI_STR); + } }else{ cfuri = relativePathToCatalogFile; }