Wednesday, January 22, 2014

How to include CQ package from other projects as dependency in your project

Use Case: We often come across situation where we want to include package or jar files from other CQ project across organization to your project.

Set Up: This assumes that you already have your project set up using Maven, Nexus. You need Nexus or any other repository management system to store artifact of jar or CQ package zip artifact you need to use in your project.

Assumption: You are using "content-package-maven-plugin" to create CQ package. More information about this artifact can be found here 
http://dev.day.com/docs/en/cq/current/core/how_to/how_to_use_the_vlttool/vlt-mavenplugin.html

Solution:

For jar file it is simply adding it to your embed statement and for zip file you could use subPackages configuration. Once you will run maven install with this configuration, Other project package will also get installed with your package. Same works for uninstall of package as well. Geometrixx all package uses similar approach.

your final pom will look like this,


  
NOTE:  When you are using other CQ projects as dependency in to your project, make sure that other project is not overriding configurations in your project. You might have to adjust other project package filter accordingly.                  

6 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. When I use subPackages along with embeddeds my bundles don't get installed. It's like CQ sees the content packages and ignores the bundles. I'm on AEM 5.6.1. Any thoughts? Thanks.

    ReplyDelete
    Replies
    1. Hello,

      It should install bundles present in that package. As long as bundles are in install folder.

      Yogesh

      Delete
    2. Oh I think I know what's up. I have content and bundles going to the same place. For example, /apps/myapp and /apps/myapp/install. When CQ installs the content package it first deletes the /apps/myapp node. So I need to change the filter mode I can resolve it. Thanks!

      Delete
    3. And thanks for the quick response, Yogesh.

      Delete
  3. The effectiveness of IEEE Project Domains depends very much on the situation in which they are applied. In order to further improve IEEE Final Year Project Domains practices we need to explicitly describe and utilise our knowledge about software domains of software engineering Final Year Project Domains for CSE technologies. This paper suggests a modelling formalism for supporting systematic reuse of software engineering technologies during planning of software projects and improvement programmes in Project Centers in Chennai for CSE.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    ReplyDelete