sbt published maven file missing artifacts with multiple scopes -
say have project b
depends on project a
test->test
, provided
scopes.
val b = project( id = "project-b", base = file("myproject"), ).dependson(a % "test->test;provided")
the published maven pom file b
, however, has test dependency.
why provided
dependency left out ?
update:
this actual sbt codes in our project
lazy val streaming = project( id = "gearpump-streaming", base = file("streaming"), settings = commonsettings ++ myassemblysettings ++ javadocsettings ++ addartifact(artifact("gearpump-streaming"), sbtassembly.assemblykeys.assembly) ++ seq( assemblymergestrategy in assembly := { case "geardefault.conf" => mergestrategy.last case x => val oldstrategy = (assemblymergestrategy in assembly).value oldstrategy(x) }, librarydependencies ++= seq( "com.goldmansachs" % "gs-collections" % gscollectionsversion ), pompostprocess := { (node: xml.node) => changeshadeddeps( set( "com.goldmansachs", "org.scala-lang", "org.scoverage" ), list( getshadeddepxml(organization.value, s"${core.id}_${scalabinaryversion.value}", version.value, "provided")), node) } ) ).dependson(core % "test->test;provided")
the pompostprocess
remove unwanted dependencies published pom file , add core
dependency provided
scope.
without latter, pom file like
<?xml version='1.0' encoding='utf-8'?> <project xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://maven.apache.org/pom/4.0.0"> <modelversion>4.0.0</modelversion> <groupid>org.apache.gearpump</groupid> <artifactid>gearpump-streaming_2.11</artifactid> <packaging>jar</packaging> <description>gearpump-streaming</description> <version>0.8.2-snapshot</version> <name>gearpump-streaming</name> <organization> <name>org.apache.gearpump</name> </organization> <url>https://github.com/apache/incubator-gearpump</url> <licenses> <license> <name>apache 2</name> <url>http://www.apache.org/licenses/license-2.0.txt</url> </license> </licenses> <scm> <connection>scm:git://git.apache.org/incubator-gearpump.git</connection> <developerconnection>scm:git:git@github.com:apache/incubator-gearpump</developerconnection> <url>github.com/apache/incubator-gearpump</url> </scm> <developers> <developer> <id>gearpump</id> <name>gearpump team</name> <url>http://gearpump.incubator.apache.org/community.html#who-we-are</url> </developer> </developers> <dependencies> <dependency> <groupid>org.apache.gearpump</groupid> <artifactid>gearpump-core_2.11</artifactid> <version>0.8.2-snapshot</version> <scope>test</scope> </dependency> </dependencies>
you can see "provided" dependency left out.
Comments
Post a Comment