From a0e04a6c85c9a9ffbf20c7eb918c705e41fbe1bb Mon Sep 17 00:00:00 2001 From: Alexandre Archambault Date: Tue, 20 Jun 2017 18:23:31 +0200 Subject: [PATCH] Tweak dependency management scope overriding --- .../main/scala/coursier/core/Resolution.scala | 2 +- tests/metadata | 2 +- .../resolutions/org.apache.tika/tika-app/1.13 | 108 ++++++++++++++++++ .../scala/coursier/test/CentralTests.scala | 7 ++ 4 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 tests/shared/src/test/resources/resolutions/org.apache.tika/tika-app/1.13 diff --git a/core/shared/src/main/scala/coursier/core/Resolution.scala b/core/shared/src/main/scala/coursier/core/Resolution.scala index 7530e6b3c..c45646005 100644 --- a/core/shared/src/main/scala/coursier/core/Resolution.scala +++ b/core/shared/src/main/scala/coursier/core/Resolution.scala @@ -268,7 +268,7 @@ object Resolution { if (mgmtDep.version.nonEmpty) dep = dep.copy(version = mgmtDep.version) - if (mgmtConfig.nonEmpty) + if (config.isEmpty) config = mgmtConfig // FIXME The version and scope/config from dependency management, if any, are substituted diff --git a/tests/metadata b/tests/metadata index ebc1985f3..ba7f6c18c 160000 --- a/tests/metadata +++ b/tests/metadata @@ -1 +1 @@ -Subproject commit ebc1985f31be10b3ac434ae708c94b9cf3a49b44 +Subproject commit ba7f6c18c146c992cc4b3cddc40f0687a4d1e349 diff --git a/tests/shared/src/test/resources/resolutions/org.apache.tika/tika-app/1.13 b/tests/shared/src/test/resources/resolutions/org.apache.tika/tika-app/1.13 new file mode 100644 index 000000000..6dc679eca --- /dev/null +++ b/tests/shared/src/test/resources/resolutions/org.apache.tika/tika-app/1.13 @@ -0,0 +1,108 @@ +c3p0:c3p0:0.9.1.1:compile +com.adobe.xmp:xmpcore:5.1.2:compile +com.beust:jcommander:1.35:compile +com.drewnoakes:metadata-extractor:2.8.1:compile +com.fasterxml.jackson.core:jackson-core:2.7.1:compile +com.github.junrar:junrar:0.7:compile +com.github.virtuald:curvesapi:1.03:compile +com.google.code.gson:gson:2.6.2:compile +com.google.guava:guava:17.0:compile +com.google.protobuf:protobuf-java:2.5.0:compile +com.googlecode.json-simple:json-simple:1.1.1:compile +com.googlecode.juniversalchardet:juniversalchardet:1.0.3:compile +com.googlecode.mp4parser:isoparser:1.1.18:compile +com.healthmarketscience.jackcess:jackcess:2.1.3:compile +com.healthmarketscience.jackcess:jackcess-encrypt:2.1.1:compile +com.intellij:annotations:12.0:compile +com.optimaize.languagedetector:language-detector:0.5:compile +com.pff:java-libpst:0.8.1:compile +com.rometools:rome:1.5.1:compile +com.rometools:rome-utils:1.5.1:compile +commons-cli:commons-cli:1.3.1:compile +commons-codec:commons-codec:1.10:compile +commons-io:commons-io:2.4:compile +commons-lang:commons-lang:2.6:compile +commons-logging:commons-logging:1.2:compile +commons-logging:commons-logging-api:1.1:compile +de.l3s.boilerpipe:boilerpipe:1.1.0:compile +edu.ucar:cdm:4.5.5:compile +edu.ucar:grib:4.5.5:compile +edu.ucar:httpservices:4.5.5:compile +edu.ucar:jj2000:5.2:compile +edu.ucar:netcdf4:4.5.5:compile +edu.ucar:udunits:4.5.5:compile +javax.annotation:javax.annotation-api:1.2:compile +javax.measure:jsr-275:0.9.3:compile +javax.ws.rs:javax.ws.rs-api:2.0.1:compile +joda-time:joda-time:2.2:compile +log4j:log4j:1.2.17:compile +net.arnx:jsonic:1.2.11:compile +net.java.dev.jna:jna:4.1.0:compile +net.jcip:jcip-annotations:1.0:compile +net.sf.ehcache:ehcache-core:2.6.2:compile +net.sf.jwordnet:jwnl:1.3.3:compile +net.sourceforge.jmatio:jmatio:1.0:compile +org.apache.commons:commons-compress:1.11:compile +org.apache.commons:commons-csv:1.0:compile +org.apache.commons:commons-exec:1.3:compile +org.apache.commons:commons-vfs2:2.0:compile +org.apache.cxf:cxf-core:3.0.3:compile +org.apache.cxf:cxf-rt-frontend-jaxrs:3.0.3:compile +org.apache.cxf:cxf-rt-rs-client:3.0.3:compile +org.apache.cxf:cxf-rt-transports-http:3.0.3:compile +org.apache.httpcomponents:httpclient:4.2.6:compile +org.apache.httpcomponents:httpcore:4.2.5:compile +org.apache.httpcomponents:httpmime:4.2.6:compile +org.apache.james:apache-mime4j-core:0.7.2:compile +org.apache.james:apache-mime4j-dom:0.7.2:compile +org.apache.maven.scm:maven-scm-api:1.4:compile +org.apache.maven.scm:maven-scm-provider-svn-commons:1.4:compile +org.apache.maven.scm:maven-scm-provider-svnexe:1.4:compile +org.apache.opennlp:opennlp-maxent:3.0.3:compile +org.apache.opennlp:opennlp-tools:1.5.3:compile +org.apache.pdfbox:fontbox:2.0.1:compile +org.apache.pdfbox:jempbox:1.8.12:compile +org.apache.pdfbox:pdfbox:2.0.1:compile +org.apache.pdfbox:pdfbox-debugger:2.0.1:compile +org.apache.pdfbox:pdfbox-tools:2.0.1:compile +org.apache.poi:poi:3.15-beta1:compile +org.apache.poi:poi-ooxml:3.15-beta1:compile +org.apache.poi:poi-ooxml-schemas:3.15-beta1:compile +org.apache.poi:poi-scratchpad:3.15-beta1:compile +org.apache.sis.core:sis-metadata:0.6:compile +org.apache.sis.core:sis-referencing:0.6:compile +org.apache.sis.core:sis-utility:0.6:compile +org.apache.sis.storage:sis-netcdf:0.6:compile +org.apache.sis.storage:sis-storage:0.6:compile +org.apache.tika:tika-app:1.13:compile +org.apache.tika:tika-batch:1.13:compile +org.apache.tika:tika-core:1.13:compile +org.apache.tika:tika-langdetect:1.13:compile +org.apache.tika:tika-parsers:1.13:compile +org.apache.tika:tika-serialization:1.13:compile +org.apache.tika:tika-xmp:1.13:compile +org.apache.ws.xmlschema:xmlschema-core:2.1.0:compile +org.apache.xmlbeans:xmlbeans:2.6.0:compile +org.bouncycastle:bcmail-jdk15on:1.54:compile +org.bouncycastle:bcpkix-jdk15on:1.54:compile +org.bouncycastle:bcprov-jdk15on:1.54:compile +org.ccil.cowan.tagsoup:tagsoup:1.2.1:compile +org.codehaus.plexus:plexus-utils:1.5.6:compile +org.codehaus.woodstox:stax2-api:3.1.4:compile +org.codehaus.woodstox:woodstox-core-asl:4.4.1:compile +org.codelibs:jhighlight:1.0.2:compile +org.gagravarr:vorbis-java-core:0.8:compile +org.gagravarr:vorbis-java-tika:0.8:compile +org.itadaki:bzip2:0.9.1:compile +org.jdom:jdom2:2.0.4:compile +org.json:json:20140107:compile +org.jsoup:jsoup:1.7.2:compile +org.opengis:geoapi:3.0.0:compile +org.ow2.asm:asm:5.0.4:compile +org.quartz-scheduler:quartz:2.2.0:compile +org.slf4j:jcl-over-slf4j:1.7.12:compile +org.slf4j:jul-to-slf4j:1.7.12:compile +org.slf4j:slf4j-api:1.7.12:compile +org.slf4j:slf4j-log4j12:1.7.12:compile +org.tukaani:xz:1.5:compile +regexp:regexp:1.3:compile \ No newline at end of file diff --git a/tests/shared/src/test/scala/coursier/test/CentralTests.scala b/tests/shared/src/test/scala/coursier/test/CentralTests.scala index 1663cfff2..0fae3072e 100644 --- a/tests/shared/src/test/scala/coursier/test/CentralTests.scala +++ b/tests/shared/src/test/scala/coursier/test/CentralTests.scala @@ -764,6 +764,13 @@ abstract class CentralTests extends TestSuite { * - resolutionCheck(mod, ver) } + + 'dependencyManagementScopeOverriding - { + val mod = Module("org.apache.tika", "tika-app") + val ver = "1.13" + + * - resolutionCheck(mod, ver) + } } }