Get parent metadata prior to requiring import dependencies

This commit is contained in:
Alexandre Archambault 2017-05-11 17:48:43 +02:00
parent bb4fcfceb6
commit 83e04a8e45
3 changed files with 42 additions and 21 deletions

View File

@ -785,31 +785,42 @@ final case class Resolution(
project: Project project: Project
): Set[ModuleVersion] = { ): Set[ModuleVersion] = {
val approxProperties0 = val needsParent =
project.parent project.parent.exists { par =>
.flatMap(projectCache.get) val parentFound = projectCache.contains(par) || errorCache.contains(par)
.map(_._2.properties) !parentFound
.fold(project.properties)(project.properties ++ _) }
val approxProperties = propertiesMap(approxProperties0) ++ projectProperties(project) if (needsParent)
project.parent.toSet
else {
val profileDependencies = val approxProperties0 =
profiles( project.parent
project, .flatMap(projectCache.get)
approxProperties, .map(_._2.properties)
osInfo, .fold(project.properties)(project.properties ++ _)
jdkVersion,
userActivations
).flatMap(p => p.dependencies ++ p.dependencyManagement)
val modules = withProperties( val approxProperties = propertiesMap(approxProperties0) ++ projectProperties(project)
project.dependencies ++ project.dependencyManagement ++ profileDependencies,
approxProperties val profileDependencies =
).collect { profiles(
case ("import", dep) => dep.moduleVersion project,
approxProperties,
osInfo,
jdkVersion,
userActivations
).flatMap(p => p.dependencies ++ p.dependencyManagement)
val modules = withProperties(
project.dependencies ++ project.dependencyManagement ++ profileDependencies,
approxProperties
).collect {
case ("import", dep) => dep.moduleVersion
}
modules.toSet
} }
modules.toSet ++ project.parent
} }
/** /**

View File

@ -0,0 +1,2 @@
org.kie:kie-api:6.5.0.Final:compile
org.slf4j:slf4j-api:1.7.2:compile

View File

@ -607,6 +607,14 @@ object CentralTests extends TestSuite {
} }
} }
} }
'parentBeforeImports - {
* - resolutionCheck(
Module("org.kie", "kie-api"),
"6.5.0.Final",
extraRepo = Some(MavenRepository("https://repository.jboss.org/nexus/content/repositories/public"))
)
}
} }
} }