5

In sbt there are a few custom classifier types that are built-in which are super easy to use.

For example specifying publishArtifact in Test := true in your build file automatically generates an artifact with the 'test' classifier with the sources that appear in the 'test' directory of your project.

Similarly using publishArtifact in IntegrationTest := true generates an artifact with the 'it' classifier with the sources that appear in the 'it' directory of your project.

Both of these depend on the compile phase.

I'd like to add a new type of classifier in this style, e.g. publishArtifact in CustomClassifier := true, that takes the sources from a given directory, and would also depend on the compile phase.

From my research it seems that this is possible, but all I can find are snippets of code that I can't quite piece together. It'd be great to have one complete example.

Chris Salij
  • 3,096
  • 5
  • 26
  • 43
  • https://stackoverflow.com/questions/17616425/how-to-publish-additional-artifact-with-sbt-one-jar describes some of it, but in the context of the onejar plugin, which kind of buries what's actually happening. There's other examples too. I agree this needs to be consolidated, I've been looking for an much of a day to find the answer to this myself. – Brian Topping Dec 22 '16 at 18:05

0 Answers0