Skip to content

Commit

Permalink
fix - add null checks for groupId, artifactId, and version attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marko Milic committed Nov 12, 2024
1 parent 1c66653 commit 17279c8
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,15 @@ private List<IClasspathEntry> getDependencyJars(DependencyModulesResult dependen
attributes.add(optionalAttribute);
}
attributes.add(buildServerAttribute);
attributes.add(JavaCore.newClasspathAttribute("groupId", mavenDependencyModule.getOrganization()));
attributes.add(JavaCore.newClasspathAttribute("artifactId", mavenDependencyModule.getName()));
attributes.add(JavaCore.newClasspathAttribute("version", mavenDependencyModule.getVersion()));

String groupId = mavenDependencyModule.getOrganization();
String artifactId = mavenDependencyModule.getName();
String version = mavenDependencyModule.getVersion();
if (!StringUtils.isAllEmpty(groupId, artifactId, version)) {
attributes.add(JavaCore.newClasspathAttribute("groupId", groupId));
attributes.add(JavaCore.newClasspathAttribute("artifactId", artifactId));
attributes.add(JavaCore.newClasspathAttribute("version", version));
}

dependencyEntries.add(JavaCore.newLibraryEntry(
new Path(artifact.getAbsolutePath()),
Expand Down

0 comments on commit 17279c8

Please sign in to comment.