Permalink
Browse files

Allow exclusions to have no explicit artifact ID in POM

  • Loading branch information...
alexarchambault committed Sep 4, 2017
1 parent 8d584d9 commit 964151392b8b808a1e6e34e7f55a7d2e028cc240
@@ -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
@@ -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")
)
}
}
Submodule metadata updated 32 files
+51 −0 https/repo1.maven.org/maven2/com/github/stephenc/findbugs/findbugs-annotations/1.3.9-1/.directory
+192 −0 ...maven.org/maven2/com/github/stephenc/findbugs/findbugs-annotations/1.3.9-1/findbugs-annotations-1.3.9-1.pom
+51 −0 https/repo1.maven.org/maven2/net/sf/opencsv/opencsv/2.3/.directory
+195 −0 https/repo1.maven.org/maven2/net/sf/opencsv/opencsv/2.3/opencsv-2.3.pom
+71 −0 https/repo1.maven.org/maven2/org/apache/commons/commons-math3/3.3/.directory
+690 −0 https/repo1.maven.org/maven2/org/apache/commons/commons-math3/3.3/commons-math3-3.3.pom
+51 −0 https/repo1.maven.org/maven2/org/bytedeco/javacpp/1.3.3/.directory
+325 −0 https/repo1.maven.org/maven2/org/bytedeco/javacpp/1.3.3/javacpp-1.3.3.pom
+43 −0 https/repo1.maven.org/maven2/org/datavec/datavec-api/0.9.1/.directory
+158 −0 https/repo1.maven.org/maven2/org/datavec/datavec-api/0.9.1/datavec-api-0.9.1.pom
+31 −0 https/repo1.maven.org/maven2/org/datavec/datavec-parent/0.9.1/.directory
+675 −0 https/repo1.maven.org/maven2/org/datavec/datavec-parent/0.9.1/datavec-parent-0.9.1.pom
+43 −0 https/repo1.maven.org/maven2/org/nd4j/jackson/0.9.1/.directory
+184 −0 https/repo1.maven.org/maven2/org/nd4j/jackson/0.9.1/jackson-0.9.1.pom
+31 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-api-parent/0.9.1/.directory
+19 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-api-parent/0.9.1/nd4j-api-parent-0.9.1.pom
+43 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-api/0.9.1/.directory
+147 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-api/0.9.1/nd4j-api-0.9.1.pom
+31 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-backends/0.9.1/.directory
+21 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-backends/0.9.1/nd4j-backends-0.9.1.pom
+43 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-buffer/0.9.1/.directory
+129 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-buffer/0.9.1/nd4j-buffer-0.9.1.pom
+43 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-common/0.9.1/.directory
+94 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-common/0.9.1/nd4j-common-0.9.1.pom
+43 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-context/0.9.1/.directory
+22 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-context/0.9.1/nd4j-context-0.9.1.pom
+31 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-shade/0.9.1/.directory
+18 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j-shade/0.9.1/nd4j-shade-0.9.1.pom
+31 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j/0.9.1/.directory
+749 −0 https/repo1.maven.org/maven2/org/nd4j/nd4j/0.9.1/nd4j-0.9.1.pom
+51 −0 https/repo1.maven.org/maven2/org/projectlombok/lombok/1.16.16/.directory
+48 −0 https/repo1.maven.org/maven2/org/projectlombok/lombok/1.16.16/lombok-1.16.16.pom
@@ -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
@@ -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)
}
}
}

0 comments on commit 9641513

Please sign in to comment.