Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

Getting Started with Archiva

To build

Run 'mvn install'. If this is the first time, and if you've not pulled this down for some other reason then it will save time to do the following first:

  • Download the 1.0 connector from: http://java.sun.com/j2ee/connector/download.html
  • Unpack the zip to get the jar
  • Run: mvn install:install-file -DgroupId=javax.resource -DartifactId=connector -Dversion=1.0 -Dpackaging=jar -Dfile=connector.jar

To deploy Archiva to Tomcat 5.5

  • create a directory in tomcat called archiva, at the same level as bin, conf, logs and the others.
  • copy the war file from archiva/archiva-webapp/target into the new directory
  • create a conf/Catalina/localhost/archiva.xml file with the following data:

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/archiva"
docBase="${catalina.home}/archiva/archiva-webapp-1.0-SNAPSHOT.war">

<Resource name="jdbc/users" auth="Container" type="javax.sql.DataSource"
username="sa"
password=""
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
url="jdbc:derby:database/archiva;create=true"
/>
</Context>

  • Copy archiva/archiva-webapp/target/archiva-webapp-1.0-SNAPSHOT/WEB-INF/lib/derby-10.1.3.1.jar into the tomcat common/lib

To deal with a current bug, you'll also need to add the following to your ${catalina.home}/conf/web.xml in the relevant section (search for jspx):

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspf</url-pattern>
</servlet-mapping>

When you first start Archiva, you will see an Exception that schema SA does not exist - however it doesn't appear to cause a problem. If you use a username other than 'sa', such as 'archiva', then you seem to get the same error but Tomcat fails to start the context and you have to shutdown and restart again.

Setting up your Archiva instance

  • Goto http://localhost:8080/archiva/
  • On the first page - setup your administration user. The password requires a numerical character.
  • On the second page - setup your first repository. It can be both an m1 and an m2 repository.
  • On the third page - setup your indexing. Mostly this means choosing a directory to put the index in. It'll re-index every hour.

A useful repository to setup when exploring is your local Maven repository.

  • Identifier: LOCAL
  • Name: Maven2 Local Repository
  • Location: $HOME/.m2/repository

Resetting Archiva

  • With Tomcat shutdown, remove the database/ and derby.log files that have appeared within your bin/ directory (if you started from there).
  • rm webapps/archiva/ && rm work/Catalina/localhost/archiva/
  • rm $HOME/.m2/archiva.xml
  • No labels