From ee2ad247a45cc9d177a11a9c932cf27ade4f8b34 Mon Sep 17 00:00:00 2001 From: Svata Dedic Date: Thu, 30 May 2019 15:01:01 +0200 Subject: [PATCH] [NETBEANS-2577] Prevent Maven libraries from being exluded --- .../org/netbeans/nbbuild/ModuleSelector.java | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/nbbuild/antsrc/org/netbeans/nbbuild/ModuleSelector.java b/nbbuild/antsrc/org/netbeans/nbbuild/ModuleSelector.java index 321c156d176e..fbe61a40bc96 100644 --- a/nbbuild/antsrc/org/netbeans/nbbuild/ModuleSelector.java +++ b/nbbuild/antsrc/org/netbeans/nbbuild/ModuleSelector.java @@ -78,24 +78,6 @@ private Boolean checkSelected(File dir, File file) throws BuildException { } String module = null; - if (file.getName().endsWith(".jar")) { - try (JarFile jar = new JarFile(file)) { - Manifest m = jar.getManifest(); - if (m != null) { - module = m.getMainAttributes().getValue("OpenIDE-Module"); // NOI18N - if (module == null && !isExt(file)) { - module = m.getMainAttributes().getValue("Bundle-SymbolicName"); // NOI18N - int semicolon = module == null ? -1 : module.indexOf(';'); - if (semicolon >= 0) { - module = module.substring(0, semicolon); - } - } - } - } catch (IOException ex) { - throw new BuildException("Problem with " + file + ": " + ex, ex, getLocation()); - } - } - String name = file.getName(); File p = file.getParentFile(); for(;;) { @@ -124,6 +106,24 @@ private Boolean checkSelected(File dir, File file) throws BuildException { name = p.getName() + '/' + name; p = p.getParentFile(); } + + if (module == null && name.endsWith(".jar")) { + try (JarFile jar = new JarFile(file)) { + Manifest m = jar.getManifest(); + if (m != null) { + module = m.getMainAttributes().getValue("OpenIDE-Module"); // NOI18N + if (module == null && !isExt(file)) { + module = m.getMainAttributes().getValue("Bundle-SymbolicName"); // NOI18N + int semicolon = module == null ? -1 : module.indexOf(';'); + if (semicolon >= 0) { + module = module.substring(0, semicolon); + } + } + } + } catch (IOException ex) { + throw new BuildException("Problem with " + file + ": " + ex, ex, getLocation()); + } + } if (module == null) { log("No module in: " + file, Project.MSG_VERBOSE);