I am trying to publish some of my SBT projects on my personal webserver. As far as I know you usually export a SBT project as a Maven directory including a POM.xml, that con
From sbt, you can use
project myproject
[myproject] $ publish-local
Which will publish to your local ivy directory (usually ~/.ivy2/local
).
In the output you will see the paths of all the files:
[info] Done packaging.
[info] published myproject_2.9.1 to .../ivy2/...myproject.../poms/myproject_2.9.1.pom
[info] published myproject_2.9.1 to .../ivy2/...myproject.../jars/myproject_2.9.1.jar
[info] published myproject_2.9.1 to .../ivy2/...myproject.../srcs/myproject_2.9.1-sources.jar
[info] published myproject_2.9.1 to .../ivy2/...myproject.../docs/myproject_2.9.1-javadoc.jar
[info] published ivy to .../ivy2/...myproject.../ivys/ivy.xml
Then you can grab those files and upload them to your ftp server.
I would still recommend the approach described in the linked blogpost though. At least that's how we do it. Just a small note on storing credentials. Use the following sbt setting:
val credentials = Credentials(Path.userHome / ".ivy2" / ".my-credentials")
The credentials file will look like this:
realm=Sonatype Nexus Repository Manager
host=nexus.example.com
user=deployment
password=pass
The credentials are the same you use for logging in to the Nexus web interface.