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 » Connecting to the Adobe Maven Repository

Connecting to the Adobe Maven Repository

Last modified by Craig S. Dickson on 2012/04/02 18:06

What is the Adobe Maven Repository?

The Adobe Maven Repository is a publicly accessible Maven Repository (just like Maven Central) that contains the artifacts necessary to build custom Adobe CQ projects.

If you intend to use Apache Maven as the build tool for your CQ Project (recommended), you will need to configure your development environment to access to the Adobe Maven Repository.

Access Options

Proxy the Adobe Repository through another Repository

The recommended way to connect to the Adobe Maven Repository is by proxying it through your own or your team's in house repository. If you do not already have your own repository, then Sonatype Nexus is a free open source repository that can be downloaded and installed easily (Nexus is the repository manager used by Adobe, Maven Central and CQ Blueprints among many other public repositories).

Once you have access to your own or team's Repository, configure it to proxy the Adobe Maven Repository which is located at this URL: http://repo.adobe.com/nexus/content/groups/public/

Define the Adobe Repository in settings.xml

If you do not have access to your own or a team Maven Repository, then you can configure your own local development environment to access the Adobe Maven Repository.

In your own settings.xml file (usually located at /.m2/settings.xml) you can define additional repositories that Maven will access during the build process to find the necessary dependencies and plugins. To define the Adobe Maven Repository, add the following to your settings.xml:

       <profile>
           <id>cq</id>
           <activation>
               <activeByDefault>true</activeByDefault>
           </activation>
           <repositories>
               <repository>
                   <id>adobe</id>
                   <name>Adobe Repository</name>
                   <url>http://repo.adobe.com/nexus/content/groups/public/</url>
                   <releases>
                       <enabled>true</enabled>
                   </releases>
                   <snapshots>
                       <enabled>false</enabled>
                   </snapshots>
               </repository>
           </repositories>
           <pluginRepositories>
               <pluginRepository>
                   <id>adobe-plugins</id>
                   <name>Adobe Plugin Repository</name>
                   <url>http://repo.adobe.com/nexus/content/groups/public/</url>
                   <releases>
                       <enabled>true</enabled>
                   </releases>
                   <snapshots>
                       <enabled>false</enabled>
                   </snapshots>
               </pluginRepository>
           </pluginRepositories>
       </profile>

Using Maven Profiles to Improve Build Performance

In the above XML snippet, the cq# Profile is configured to be active by default, which means it will be available in every Maven build in your local environment. If you are only developing Adobe CQ projects, this is probably the correct configuration.

However, if you work on other Maven projects in your local environment that do not require access to the Adobe CQ artifacts, you will notice a build performance improvement if you selectively turn the cq Profile on only for your Adobe CQ projects. To do this, remove the <activation>...</activation> tag from the XML snippet above which will disable the cq Profile by default. Then for each or your Adobe CQ projects you will enable the Profile, by either using the -P command line switch (eg. mvn -P cq install), or by activating it from within your IDE (in Eclipse, look for the Maven tab under the Project Properties dialog for each project).

Tags:
Created by Craig S. Dickson on 2012/04/02 17:39
cqblueprints provided by headwire.com, Inc