Building Archiva.
Follow the instructions on Archiva Site - Source Repository to grab the latest sources.
To build it:
mvn clean package
The deployables can be found in archiva-web/archiva-webapp/target. It's not possible at the moment to deploy the application unexploded because the web.xml file is missing resource reference definitions for data sources and mail session (bug?). Though it should be possible to unpackage the war, modify the web.xml, repackage and then deploy.
PostgreSQL database configuration.
To create a database user, login into the PostgreSQL server as a superuser and run the following code:
CREATE USER archiva with encrypted password 'archiva';
Then create the databases:
create database archiva with owner archiva encryption 'UTF8'; create database archivausers with owner archiva encryption 'UTF8';
Geronimo configuration
A system property appserver.bas needs to be setup in order for Archiva to run. This refers to a filesystem location where archiva will store logs and repositories' data. It should NOT be the location where the war file was extracted.
Although it can be defined in Geronimo deployment plan (as illustrated in the attached plan file), there seem to be a bug and this method only works during the deployment and first start.
The simpliest way is to add
-Dappserver.base=${ARCHIVA_ROOT}
to java options when starting the server. Another way is to define the same GBean from the attached plan file in the global Geronimo config file.
Consult Geronimo Documentation and create two datasources in Geronimo: ArchivaDS and ArchivaUsersDS. The names are arbitrary but has to be reflected in the deployment plan: first, in dependencies and second in resource reference sections.
Deployment
Modify web.xml to add resource references:
<resource-ref> <res-ref-name>jdbc/users</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-ref> <res-ref-name>jdbc/archiva</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> <resource-ref> <res-ref-name>mail/Session</res-ref-name> <res-type>javax.mail.Session</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref>
Then drop the attached deployment plan file into WEB-INF of the exploded Archiva application.
Deploy the application using the following command:
java -jar ${GERONIMO_HOME}/bin/deployer.jar deploy --inPlace /path/to/extracted/archiva/war
This command has to be run as the same user that runs the server itself.
After that Archiva should be installed though the administrative UI was very slow for me. I'll update this page if this issue is resolved without modifying the Archiva code.