Skip to content

Commit

Permalink
Merge pull request #303 from balrok/bugfix/fix-missing-artifact-resolver
Browse files Browse the repository at this point in the history
fix missing artifact resolver for the bom-resolution
  • Loading branch information
jk1 authored May 26, 2024
2 parents eecb37e + 999c496 commit bb1231e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class ModuleReaderImpl implements ModuleReader {
extraPomResults.each { ResolvedArtifactResult artifact ->
LOGGER.info("Processing artifact: $artifact ($artifact.file)")
if (artifact.file.exists()) {
def pom = pomReader.readPomData(artifact)
def pom = pomReader.readPomData(project, artifact)
if (pom) moduleData.poms << pom
} else {
LOGGER.info("Skipping artifact file $artifact.file as it does not exist")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ class PomReader {
}
}

PomData readPomData(ResolvedArtifactResult artifact) {
PomData readPomData(Project project, ResolvedArtifactResult artifact) {
resolver = new CachingArtifactResolver(project)
GPathResult pomContent = findAndSlurpPom(artifact.file)
return readPomFile(pomContent)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class PomDependencyResolutionFuncSpec extends AbstractGradleRunnerFunctionalSpec

then:
runResult.task(":generateLicenseReport").outcome == TaskOutcome.SUCCESS
// 2 licenses because it also resolves jackson-parent, which has its own license
configurationsString == """[
{
"dependencies": [
Expand All @@ -80,6 +81,10 @@ class PomDependencyResolutionFuncSpec extends AbstractGradleRunnerFunctionalSpec
{
"url": "http://www.apache.org/licenses/LICENSE-2.0.txt",
"name": "Apache License, Version 2.0"
},
{
"url": "http://www.apache.org/licenses/LICENSE-2.0.txt",
"name": "The Apache Software License, Version 2.0"
}
]
}
Expand Down

0 comments on commit bb1231e

Please sign in to comment.