THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
- Connect to the database and create a user archiva and two schemas (or databases). In this example they are called archiva and archiva_users. Make sure the archiva user has appropriate rights to create tables on those schemas.
- Copy the JDBC driver (the jar file) for your databaseto <JBOSS_HOME>/server/default/lib. <JBOSS_HOME> is the directory where your JBoss is installed. (I assume throughout this text you are running the default instance because otherwise you would probably not bother to read this tutorial.)
- Create a file called archiva-ds.xml in <JBOSS_HOME>/server/default/deploy:
This example uses postgresql. If you use a different database you must alter the connection string and the driver class. For more infomation on setting up datasources take a look at the JBoss Wiki.No Format <?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>/jdbc/archiva</jndi-name> <connection-url>jdbc:postgresql://database.mycompany.com/archiva</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>archiva</user-name> <password>archiva</password> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> </local-tx-datasource> <local-tx-datasource> <jndi-name>/jdbc/archiva_users</jndi-name> <connection-url>jdbc:postgresql://database.mycompany.com/archiva_users</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>archiva</user-name> <password>archiva</password> <min-pool-size>5</min-pool-size> <max-pool-size>20</max-pool-size> <idle-timeout-minutes>0</idle-timeout-minutes> <track-statements/> </local-tx-datasource> </datasources>
- To enable email you must verify that the mail settings in <JBOSS_HOME>/server/default/deploy-mail-service.xml are correct. Again the JBoss Wiki may be helpful.
- Create a directory <JBOSS_HOME>/server/default/deploy/archiva.war
- Download the Archiva war distribution and unzip the contents of that file to the archive created above.
- By default archiva uses its own logging mechanism. It is preferable to redirect logging output to the application server. To do so delete the following files:
- <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/lib/commons-logging-1.0.4.jar
- <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/lib/log4j-1.2.8.jar
- <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/classes/log4j.xml
- To tell Archiva about the datasources you created in step 3 you need to create an application server specific deployment descriptor. Simply create a file <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/jboss-web.xml with the following content:
No Format <?xml version="1.0" encoding="UTF-8"?> <jboss-web> <resource-ref> <res-ref-name>jdbc/users</res-ref-name> <jndi-name>java:/jdbc/archiva_users</jndi-name> </resource-ref> <resource-ref> <res-ref-name>jdbc/archiva</res-ref-name> <jndi-name>java:/jdbc/archiva</jndi-name> </resource-ref> <resource-ref> <res-ref-name>mail/Session</res-ref-name> <jndi-name>java:/Mail</jndi-name> </resource-ref> </jboss-web>
- Make sure ~/.m2 (the subdirectory .m2 in the home directory of the user that is running JBoss) is writable.
- Restart the application server (or touch <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/web.xml to redeploy.)
- Goto http://your.application.server:8080/archiva/.
Archiva 1.1 on JBoss 4.2.2 GA
The apache-archica-1.1.war cannot be deployed in the JBoss 4.2.2-GA distribution out of the box, due to some root exceptions that causes deployment failure. The workaround is simple, just remove the following files the from WEB-INF/lib:
- commons-logging-api-1.1.jar (causes the Spring ContextClassLoader to throw an ExceptionInInstantiation)
- log4j-1.2.14.jar (causes a logger ClassCastException)
- stax-api-1.0.1.jar (causes a ClassCastException. This jar conflicts with JBossWS)