A typical answer about how to skip tests in sbt would be:
sbt "set test in assembly := {}"
However when I run for example
sbt publishLocal
Then that approach does not work. Is there a global "disable" tests flag like
maven -Dmaven.skip.test=True
Or if not .. what would be the way to disable tests just for publishLocal ?
You could disable the test task in the global scope on the sbt shell like this:
set test in ThisBuild := println("tests disabled")
Usually publishLocal does not depend on the test task at all, unless you or a plugin are overriding the task. You can check in the sbt shell to see where it is defined and if there is a dependency on test:
inspect publishLocal
or for the full dependency tree
inspect tree publishLocal
It's possible that it is overriden to indirectly depend on test in another scope, in which case you can override it there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With