Allow exclusions to have no explicit artifact ID in POM

This commit is contained in:
Alexandre Archambault 2017-09-04 02:01:36 +02:00
parent 8d584d9ae0
commit 964151392b
5 changed files with 50 additions and 8 deletions

View File

@ -23,14 +23,20 @@ object Pom {
}
// TODO Allow no version in some contexts
private def module(node: Node, groupIdIsOptional: Boolean = false): String \/ Module = {
private def module(
node: Node,
defaultGroupId: Option[String] = None,
defaultArtifactId: Option[String] = None
): String \/ Module = {
for {
organization <- {
val e = text(node, "groupId", "Organization")
if (groupIdIsOptional) e.orElse(\/-(""))
else e
defaultGroupId.fold(e)(g => e.orElse(\/-(g)))
}
name <- {
val n = text(node, "artifactId", "Name")
defaultArtifactId.fold(n)(n0 => n.orElse(\/-(n0)))
}
name <- text(node, "artifactId", "Name")
} yield Module(organization, name, Map.empty).trim
}
@ -50,7 +56,7 @@ object Pom {
.getOrElse(Seq.empty)
exclusions <- {
import Scalaz._
xmlExclusions.toList.traverseU(module(_))
xmlExclusions.toList.traverseU(module(_, defaultArtifactId = Some("*")))
}
optional = text(node, "optional", "").toOption.toSeq.contains("true")
} yield scopeOpt.getOrElse("") -> Dependency(
@ -152,7 +158,7 @@ object Pom {
import Scalaz._
for {
projModule <- module(pom, groupIdIsOptional = true)
projModule <- module(pom, defaultGroupId = Some(""))
projVersion = readVersion(pom)
parentOpt = pom.children

View File

@ -44,7 +44,9 @@ object Mima {
// was private, now removed
ProblemFilters.exclude[MissingClassProblem]("coursier.ivy.PropertiesPattern$Parser$"),
// made private so that the shaded fastparse stuff doesn't leak
ProblemFilters.exclude[DirectMissingMethodProblem]("coursier.ivy.PropertiesPattern.parser")
ProblemFilters.exclude[DirectMissingMethodProblem]("coursier.ivy.PropertiesPattern.parser"),
// corresponds to a default value of a private method, not sure why this error is raised
ProblemFilters.exclude[IncompatibleResultTypeProblem]("coursier.maven.Pom.coursier$maven$Pom$$module$default$2")
)
}
}

@ -1 +1 @@
Subproject commit 6b2578a25220930e60b505b90e636092757d6397
Subproject commit 0fedae521fff572d8c3f2f931ac2e1709a026258

View File

@ -0,0 +1,27 @@
com.clearspring.analytics:stream:2.7.0:compile
com.github.stephenc.findbugs:findbugs-annotations:1.3.9-1:compile
com.google.code.findbugs:annotations:2.0.1:compile
com.google.guava:guava:18.0:compile
commons-io:commons-io:2.4:compile
it.unimi.dsi:fastutil:6.5.7:compile
joda-time:joda-time:2.9.2:compile
junit:junit:4.8.2:compile
net.ericaro:neoitertools:1.0.0:compile
net.sf.opencsv:opencsv:2.3:compile
org.apache.commons:commons-compress:1.8.1:compile
org.apache.commons:commons-lang3:3.3.1:compile
org.apache.commons:commons-math3:3.4.1:compile
org.bytedeco:javacpp:1.3.3:compile
org.codehaus.woodstox:stax2-api:3.1.4:compile
org.datavec:datavec-api:0.9.1:compile
org.freemarker:freemarker:2.3.23:compile
org.javassist:javassist:3.18.2-GA:compile
org.nd4j:jackson:0.9.1:compile
org.nd4j:nd4j-api:0.9.1:compile
org.nd4j:nd4j-buffer:0.9.1:compile
org.nd4j:nd4j-common:0.9.1:compile
org.nd4j:nd4j-context:0.9.1:compile
org.projectlombok:lombok:1.16.16:compile
org.reflections:reflections:0.9.10:compile
org.slf4j:slf4j-api:1.7.10:compile
org.yaml:snakeyaml:1.12:compile

View File

@ -850,6 +850,13 @@ abstract class CentralTests extends TestSuite {
assert(expectedUrls.forall(urls))
}
}
'noArtifactIdExclusion - {
val mod = Module("org.datavec", "datavec-api")
val ver = "0.9.1"
* - resolutionCheck(mod, ver)
}
}
}