38

I have the following maven dependency

   <dependency>
      <groupId>org.apache.hbase</groupId>
      <artifactId>hbase</artifactId>
      <version>0.90.4</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

I know how to specify groupId,artifactId, version and scope

 "org.apache.hbase" % "hbase" % "0.90.4" % "test"

but how do I specify the type (test-jar) so that I'd get hbase-0.90.4-tests.jar from the repo?

Arnon Rotem-Gal-Oz
  • 25,469
  • 3
  • 45
  • 68

1 Answers1

61

"org.apache.hbase" % "hbase" % "0.90.4" % "test" classifier "tests"

alno
  • 3,556
  • 1
  • 19
  • 10
  • 1
    Its confusing that the "type" in maven translates to classifier in sbt. Because, maven has "classifier" in addition to "type". Wonder, what the classifier in maven translate to in sbt ? – smartnut007 Feb 10 '15 at 09:40
  • This is a dark corner of sbt. If you add a dependency that itself has dependencies in it's pom.xml that have a of test-jar then sbt (or possibly ivy) won't download those dependencies. – David Weber Jan 09 '19 at 20:09
  • I'm already opting to specify, and deploy, test-jar artifacts/dependencies explicitly as jar with tests classifier. – Osmund Francis Jul 26 '19 at 10:11