The Artifacts page in the wiki has a section on defining custom
artifacts, so that seems like a good place to start. It looks like I
want to define a custom artifact, and map it to the assembly or publish
task. However, I immediately have some questions.
What is the best way to declare the artifact? Is it
Artifact(testapp-assembly, jar, jar)
where testapp is the project name? The assembly jar's name is
testapp-assembly-1.0.0.jar. This would probably be obvious if I knew ivy.
The example in the wiki shows custom artifacts with a fragment from a
full configuration. Can this be done in a basic configuration? I
couldn't find addArtifact in the online api, so even if I can define the
artifact, I don't know what to add it to.
Thanks
> I am trying out sbt-assembly, to generate a single jar for deployment,
> and I would like to publish the jar to a local Nexus repo. It seems like
> it should be straightforward, but I am running into (noobish) problems,
> and wondered if someone could help. I already have "publish" set up to
> publish the project jar (without the dependencies) to the repo. I would
> like to add the assembly jar.
>
> The Artifacts page in the wiki has a section on defining custom
> artifacts, so that seems like a good place to start. It looks like I
> want to define a custom artifact, and map it to the assembly or publish
> task. However, I immediately have some questions.
>
> What is the best way to declare the artifact? Is it
>
> Artifact(testapp-assembly, jar, jar)
>
> where testapp is the project name? The assembly jar's name is
> testapp-assembly-1.0.0.jar. This would probably be obvious if I knew ivy.
It depends on what you want to accomplish by publishing it, but using the normal artifact name and an "assembly" classifier might be a good choice:
Artifact("testapp", "assembly")
> The example in the wiki shows custom artifacts with a fragment from a
> full configuration. Can this be done in a basic configuration? I
> couldn't find addArtifact in the online api, so even if I can define the
> artifact, I don't know what to add it to.
Yes, addArtifact can go in a basic configuration. It is defined in:
http://harrah.github.com/xsbt/latest/api/sbt/BuildExtra.html
This is mixed into the sbt package object. There is no API documentation generated for the package object because I haven't gotten it to work.
If used in a full definition, it should be:
Project(...) settings(addArtifact(...).settings : _*)
-Mark