Use a local CQ5 instance as a maven repository source for development, instead of using Day maven repository.


This method isn't officially supported.


  1. Install the (It may fail to load on CQ 5.2.1, but ignore the message then install.)

  2. Configure your project pom.xml to use your local CQ5 instance as a maven repository

                <name>CQ 5.x localinstance</name>
                <name>CQ 5.x localinstance</name>


  3. Additionally, you can use as parent dependency the following:

            <version>5.6.0</version> (if for example your instance is a 5.6.0)

    The groupId/artifactId is configurable with Sling configuration, and the version is not important. (But make sense to use according to target, such as 5.2.1/5.3/5.4).

  4. In your .m2/settings.xml, add the following lines to define the login/password:


  5. Additionally, you can add your jar/pom in the "/var/maven/repository" (using same structure as maven store it usually)


    • You can't really browse through the maven repository with your browser with that servlet, it returns a valid response at the moment.
    • Additional libraries like maven-sling-plugin and maven-packutil-plugin are also already present so accessing day repo is not required for them anymore.
    • The "/var/maven/tpl/archiva-parent.pom" includes apache people repository and ibliblio mirror automatically so that other dependencies can be found there, you can customize it if necessary.
    • You can also get a generated pom file that includes all the existing dependencies so you can easily copy/paste those you need for your maven module if you don't want to use the above parent dependency. For example using the URL: http://localhost:4502/maven/dependencies.
    • You can use a maven archive as proxy so that if your cq5 instance is not running, it can still serve the files.

Quick help for the maven-packutil-plugin (which is not currently an official plug-in, but useful)



Simple sample pom.xml with some source code for testing purpose

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy