Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added JBoss 5.1 setup

...

  1. 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>
    
  2. <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/classes/application.properties add the following line:
    No Format
    appserver.base=
    
    This will make it unnecessary to set the system property appserver.base.
  3. Make sure ~/.m2 (the subdirectory .m2 in the home directory of the user that is running JBoss) is writable.
  4. Restart the application server (or touch <JBOSS_HOME>/server/default/deploy/archiva.war/WEB-INF/web.xml to redeploy.)
  5. Goto http://your.application.server:8080/archiva/.

Archiva 1.2.2 On JBoss-AS 5.1 (and Java 6)

  1. Download the 1.2.2 war file
  2. Expand it in the JBoss deploy directory. There's no need to rename it
  3. Create a jboss-web.xml file in the WEB-INF directory with the following content:
    No Format
    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss-web PUBLIC
        "-//JBoss//DTD Web Application 5.0//EN"
        "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
    <jboss-web>
    
        <class-loading java2ClassLoadingCompliance='false'>
            <loader-repository>
                org.apache.archiva:loader=archiva
                <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
            </loader-repository>
        </class-loading>
    
        <context-root>archiva</context-root>
    
        <resource-ref>
            <res-ref-name>jdbc/users</res-ref-name>
            <jndi-name>java:/users</jndi-name>
        </resource-ref>
        <resource-ref>
            <res-ref-name>jdbc/archiva</res-ref-name>
            <jndi-name>java:/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>
    
    Note that we use an external postgres database as described above, hence the resource-refs. Also, the JNDI name of the jdbc/users datasource resource-ref is more generic than the one described for JBoss 4.2 as we share this instance with Continuum.
  4. Remove the following jars from the WEB-INF/lib directory:

    geronimo-spec-jta-1.0.1B-rc2.jar

    provided by all JEE 1.2+ containers

    jsr-250-api-1.0.jar

    provided by all JEE 5+ containers

    jstl-1.1.2.jar

    provided by all JEE 1.4+ containers

    spring-*.jar

    see below

    stax-1.2.0.jar

    provided by all JEE 5+ containers

    stax-api-1.0.1.jar

    provided by all JEE 5+ containers

  5. Download the Spring Framework 3.0 distribution (currently RC1, and not yet available in the central repo). The Spring upgrade is necessary because the annotation scanner used in Spring 2.5.x is broken by JBoss 5.x's new VFS file system. See https://jira.springsource.org/browse/SPR-6146.
  6. Install the following Spring 3.0 jars:
    • org.springframework.asm-3.0.0.RC1.jar
    • org.springframework.beans-3.0.0.RC1.jar
    • org.springframework.context-3.0.0.RC1.jar
    • org.springframework.context.support-3.0.0.RC1.jar
    • org.springframework.core-3.0.0.RC1.jar
    • org.springframework.expression-3.0.0.RC1.jar
    • org.springframework.web-3.0.0.RC1.jar
  7. I also modified the WEB-INF/classes/log4j.xml, changing "${appserver.base}/logs" to "${jboss.server.log.dir}". This puts all the archiva logs in the jboss server logs directory.
    slf4j has a bit of a whinge when starting up, but logging seems to work OK.