Skip to content

Commit

Permalink
[NETBEANS-2577] Prevent Maven libraries from being exluded
Browse files Browse the repository at this point in the history
  • Loading branch information
sdedic committed May 30, 2019
1 parent a01e4c2 commit ee2ad24
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions nbbuild/antsrc/org/netbeans/nbbuild/ModuleSelector.java
Expand Up @@ -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(;;) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ee2ad24

Please sign in to comment.