Skip to content

Commit

Permalink
fix(gradle-inspector): Do not assume all POM artifacts to be metadata…
Browse files Browse the repository at this point in the history
…-only

Dependencies like `kotlinx-coroutines-core` have POM packaging but still
come with associated artifacts, see e.g. [1].

[1]: https://repo1.maven.org/maven2/org/jetbrains/kotlinx/kotlinx-coroutines-core/1.5.2/

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 11, 2024
1 parent 78f0a07 commit 2438448
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ internal class GradleDependencyHandler : DependencyHandler<OrtDependency> {
}
}

val isMetadataOnly = dependency.extension == "pom" || isSpringMetadataProject
val hasNoArtifacts = dependency.pomFile == null || isSpringMetadataProject

val binaryArtifact = when {
isMetadataOnly -> RemoteArtifact.EMPTY
hasNoArtifacts -> RemoteArtifact.EMPTY
else -> with(dependency) {
createRemoteArtifact(pomFile, classifier, extension.takeUnless { it == "bundle" })
}
}

val sourceArtifact = when {
isMetadataOnly -> RemoteArtifact.EMPTY
hasNoArtifacts -> RemoteArtifact.EMPTY
else -> createRemoteArtifact(dependency.pomFile, "sources", "jar")
}

Expand All @@ -118,7 +118,7 @@ internal class GradleDependencyHandler : DependencyHandler<OrtDependency> {
sourceArtifact = sourceArtifact,
vcs = vcs,
vcsProcessed = vcsProcessed,
isMetadataOnly = isMetadataOnly
isMetadataOnly = hasNoArtifacts
)
}
}
Expand Down

0 comments on commit 2438448

Please sign in to comment.