Skip to content

Commit

Permalink
enhancement - add groupId, artifactId and version attributes (#1620)
Browse files Browse the repository at this point in the history
* enhancement - add groupId, artifactId and version attributes
---------

Co-authored-by: Marko Milic <milic@tyntec.com>
Co-authored-by: Sheng Chen <sheche@microsoft.com>
  • Loading branch information
3 people authored Nov 14, 2024
1 parent 28eb056 commit 89f600b
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,16 @@ private List<IClasspathEntry> getDependencyJars(DependencyModulesResult dependen
}
attributes.add(buildServerAttribute);

String groupId = mavenDependencyModule.getOrganization();
String artifactId = mavenDependencyModule.getName();
String version = mavenDependencyModule.getVersion();
if (StringUtils.isNotBlank(groupId) && StringUtils.isNotBlank(artifactId)
&& StringUtils.isNotBlank(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()),
sourceArtifact == null ? null : new Path(sourceArtifact.getAbsolutePath()),
Expand Down

0 comments on commit 89f600b

Please sign in to comment.