search cq related information on adobe, day, jackrabbit, sling and other sites
   We would like to hear from you. Suggestions to improve cqblueprints.com are very welcome. Please contact us.
Loading
Blueprints » Using Nexus as a Maven Repository for CQ Team Development

Using Nexus as a Maven Repository for CQ Team Development

Last modified by Craig S. Dickson on 2012/04/22 00:19
22-SEP-2011: This Blueprint has recently been updated in response to Adobe's change in policy regarding providing a public Maven repository for access to the Day CQ artifacts. Adobe has now made repo.adobe.com available for use and so this document has been adapted to make use of this new resource.
21-APR-2012: This Blueprint recently been updated in response to Adobe moving it's hosted repository from Archiva to Nexus and some of the configuration settings that Adobe has chosen in their new Nexus repository that have an impact on the instructions provided in this Blueprint.

Customers who (wisely) choose Maven as their build tool for CQ development projects should setup their own shared team Maven Repository and configure it to proxy the repo.adobe.com repository to provide access to the CQ related artifacts for your team. There are other Maven Repsository management servers available, however, since Nexus is now being used actively to manage the Maven Central repository it has become the defacto standard for Maven Repository management tools. As a result, we recommend the use of Nexus over any other Maven Repository management tools. Even Adobe migrated their repository in early 2012 from Archiva to Nexus.

Install Nexus

Nexus is very easy to install and there are detailed instructions on this page. We recommend following the instructions for installing the Nexus WAR file on Apache Tomcat as you are likely to, or already do, want to install other Java Web Apps as part of your development environment (e.g. Jenkins).

Configure Proxy Repository for repo.adobe.com

Once you have Nexus up and running, create a new proxy repository and give it a Repository ID like adobe-cq and a Repository Name Adobe CQ. In the Remote Storage Location setting, enter http://repo.adobe.com/nexus/content/groups/public/ 

newrepo.png

Due to configuration options set on Adobe's Nexus server, be sure to change the Auto blocking active setting in the above dialog to false otherwise your Nexus will mark the Adobe repository as being offline and will not proxy its contents for you as expected. This specific issue is discussed on the Nexus Users mailing list, archived here: http://maven.40175.n5.nabble.com/Proxying-another-Nexus-repository-that-is-locked-down-at-the-root-td5607678.html#none

Add Proxy Repository To Public Group Repository

Configure the public group repository to include the the newly proxied adobe-cq repository.

publicrepo.png

Possible Issues

  • In the above screen shot when configuring the public group repository, we have placed the Adobe CQ proxy above Maven Central. This means that the artifacts in the Adobe CQ proxy will be given priority over the ones in Maven Central. This is the correct configuration for CQ projects. However, if you or your team also work on non-CQ projects in addition to CQ projects, you will need to evaluate if this configuration works for you.

Configure Maven settings.xml File To Use Nexus

Once you have Nexus installed and have set up a proxy repository for the Adobe CQ repository, you need to change the Maven settings.xml file on each developer's machine to make use of the new Nexus repository (you should also make changes to any other places that Maven is used, like by Jenkins on your Continuous Integration server for example).

Below is an example of how to configure your team's Nexus repository as the mirror for all repositories that Maven can use.

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

   <mirrors>
       <mirror>
           <id>dev.example.com</id>
           <mirrorOf>*</mirrorOf>
           <url>http://dev.example.com/nexus/content/groups/public/</url>
       </mirror>
   </mirrors>

   <profiles>
       <profile>
           <id>nexus</id>
           <activation>
               <activeByDefault>true</activeByDefault>
           </activation>
           <repositories>
               <repository>
                   <id>central</id>
                   <url>http://central</url>
                   <releases>
                       <enabled>true</enabled>
                   </releases>
                   <snapshots>
                       <enabled>true</enabled>
                   </snapshots>
               </repository>
           </repositories>
           <pluginRepositories>
               <pluginRepository>
                   <id>central</id>
                   <url>http://central</url>
                   <releases>
                       <enabled>true</enabled>
                   </releases>
                   <snapshots>
                       <enabled>true</enabled>
                   </snapshots>
               </pluginRepository>
           </pluginRepositories>
       </profile>

   </profiles>

</settings>
Tags:
Created by Craig S. Dickson on 2011/09/04 16:26
cqblueprints provided by headwire.com, Inc