The following steps describe how to install Apache Archiva 2.1.1  on a Linux server. It will be started by the non-login user archiva and will be set to run on the non-default port 8083 (instead of 8080).
- Switch to the root user
sudo -s su
- Create the non-login user archiva:
useradd -r archiva
- Download the Archiva standalone version
- Unzip the archive
- Move Archiva to the home directory of the archiva user:
cd /home && mkdir archiva && cd archiva && mv /root/apache-archiva-2.1.1 . && cd ..
- Make archiva the owner of the directory and its content
chown -R archiva:archiva archiva
- Change the default port by opening
cd archiva/apache-archiva-2.1.1/conf && vim jetty.xmland then chaning the SystemProperty with name jetty.port to default 8083 (or the port you prefer)
- Set the context path to
cd ../contexts && vim archiva.xml(Makes it easier to configure nginx right)
- Make sure Archiva gets started by the right user with
cd ../bin && vim archivaand then set
- Add Archiva to the startup scripts with
cd /etc/init.d && ln -s /home/archiva/apache-archiva-2.1.1/bin/archiva archiva
- Start Archiva on startup of the server with
cd /etc/cron.d && vim joband add the line
@reboot root service archiva start
Now Archiva can be started with
service archiva start. After starting it, browse to host:8083/archiva and configure it to your needs. I have done the following:
- Create an admin account
- UI Configuration: Set application link, disable registration link
- Disable guest to access internal
- Allow SNAPSHOTs in internal
- Add releases repo
nginx.conf and include inside the server block the proxypass seen in Code snippet 1. Then reload nginx with
nginx -s reload. Afterwards your Archiva instance should be proxypassed over nginx. My instance is running on bleibinha.us/archiva  .
For publishing using sbt (0.13.7)  to your freshly created Archiva instance, take a look at the sbt docs for publishing  to get a basic understanding of the publish task in sbt. Personally I use code seen similar to the one seen in Code snippet 2. My credential files look like the ones seen in Code snippet 3. It is important to get the realm attribute right as it is a common source of error  . For publishing snapshot versions correctly with sbt, projects currently have to use sbt-aether-deploy  1. Sbt also allows to build for different Scala versions using sbt Cross-build  :
crossScalaVersions := Seq("2.10.4", "2.11.5"). For a complete example check out the build.sbt  file of my akka-actor-locking lib  . The published artifacts can be resolved in other projects as seen in Code snippet 4.