Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

How to convert a CQ project to Maven

Avatar

Community Advisor

Hi

 

    I have a CQ project. I want it as a Maven project. I tried all the ways I could do, but it is giving me errors. Can anyone please guide me on how to convert a CQ project to Maven project through eclipse

 

Thanks

Veena

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

The links provided by Sham HC are probably the most useful, especially the first. We are relatively new to AEM/CQ. The recommendation from our consultancy partner is to use the CQ Maven Blueprints archetype (multi-module), that is covered in the first link. I will warn you though, the parent POM described by that article is not the one that is produced when using the archetype to generate the project. We also experienced a few issues with some of the dependencies (esp: taglib) and are currently working through them.

We maintain our own parent POM (which is heavily based on the one in the article - albeit many of the dependency versions are updated) which points to our internal corporate Maven repo which proxies to the CQ Blueprints repo and Adobe public (you need to set those up in eClipse - but I assume you already know how to do that). So when you run the maven command you just substitute in your own URL ...

mvn archetype:generate -DarchetypeCatalog=<<URL to your corporate repo/proxy goes here>> -Dfilter=multi-module

HTHs

Fraser.

View solution in original post

4 Replies

Avatar

Level 10

Typically Maven is used to build parts of a CQ project such as an OSGi bundle. I have never heard of converting an existing CQ project to Maven. We have lots of examples of using Maven to build OSGi bundles. 

Avatar

Correct answer by
Former Community Member

The links provided by Sham HC are probably the most useful, especially the first. We are relatively new to AEM/CQ. The recommendation from our consultancy partner is to use the CQ Maven Blueprints archetype (multi-module), that is covered in the first link. I will warn you though, the parent POM described by that article is not the one that is produced when using the archetype to generate the project. We also experienced a few issues with some of the dependencies (esp: taglib) and are currently working through them.

We maintain our own parent POM (which is heavily based on the one in the article - albeit many of the dependency versions are updated) which points to our internal corporate Maven repo which proxies to the CQ Blueprints repo and Adobe public (you need to set those up in eClipse - but I assume you already know how to do that). So when you run the maven command you just substitute in your own URL ...

mvn archetype:generate -DarchetypeCatalog=<<URL to your corporate repo/proxy goes here>> -Dfilter=multi-module

HTHs

Fraser.

Avatar

Community Advisor

Hi Sham,

    Sorry for my Ignorance. I also wanted to build the OSGI bundle, and i was totally unaware of Maven functionality.

 

Thanks

Veena

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----