I have a small scala build utility with test classes in a special test folder. Compiling and then publish-local creates the package in my local repository.
As expected, the test folder is automatically excluded from the local utility package banner.
However, as a result, the POM still contains related dependencies defined in sbt. SBT dependencies:
libraryDependencies ++= Seq( "org.scalactic" %% "scalactic" % "3.0.0" % Test, "org.scalatest" %% "scalatest" % "3.0.0" % Test )
POM segment:
<dependency> <groupId>org.scalactic</groupId> <artifactId>scalactic_2.11</artifactId> <version>3.0.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.scalatest</groupId> <artifactId>scalatest_2.11</artifactId> <version>3.0.0</version> <scope>test</scope> </dependency>
Obviously, the scope should be a check to prevent problems in another project (main) that uses this library. In particular, testing the main project otherwise includes these test libraries, which causes version conflicts, etc.
Since these dependencies apply only to the test suite not included, their presence in the POM seems silly. How do I tell SBT that these test area dependencies are not included in the final POM?
source share