How to setup and fill Apache Archiva repository with CQ5 artifacts


How can I setup and fill my Apache Archiva repository with CQ5 artifacts in order to use it as a maven repository source for development, instead of using Day maven repository ( is not officially supported) ?

Answer, Resolution

Apache Archiva is a repository management software that allows you to deploy your maven
bundles to the repository. It also allows you to cache bundles from external repositories so your
developers will stay on your network rather than going to external sources for artifacts. The goal of this article is to describe a process that deploys CQ available artifacts into Archiva.


Install Archiva :

Configure Archiva :

  • Open your browser to the Archiva installation (http://<IP of your Archiva server>:8080/archiva)
  • The first time you startup Archiva it will ask you to create a username/password for the
    admin account. Go ahead and do that.
  • Create a deployment user, for example "deployer". This user will need the Role 'Repository Manager'.
  • Note : Take care to operate a first login with this new user, a password change will be asked at this moment. Unless you do that first, the Maven deploy commands issued with this user will fail.

Setup the Maven settings.xml file :

  • In your .m2/settings.xml add the following lines to define your Archiva Repository and the login/password Maven will use to deploy the Artifacts

            <name>My Company Archiva Repository</name>
            <url>http://<IP of your Archiva server>:8080/archiva/repository/internal</url>
            <name>My Company Archiva Repository</name>
            <url>http://<IP of your Archiva server>:8080/archiva/repository/internal</url>



Get CQ available libraries from a running instance :

Generate the Maven deploy commands that matches the CQ available artifacts :

To do this, run the attached Jar file with the following parameters :

  1. Remote repo URL
  2. Remote repo Id
  3. Directory where you just dowloaded the CQ libraries

Example : java -jar generateMavenDeployCommands.jar http://localhost:8080/archiva/repository/internal internal C:\cq53Jars




3 files are generated in the directory of the Jar :


    Shellscript for MacOs + Linux that contains the mvn:deploy commands.
  2. deployMavenArtifact.bat

    Windows Bat script that contains the same deploy instructions, preceded by the call commands.

  3. dependenciesSnippet.xml

    Contains the list of all found artifacts in the form of a dependency list that you can partially integrate to your project pom file.

Applies to

CQ 5.3+