CQ5 - eclipse and maven setup
Hi All,
I have setup my CQ workspace in eclipse and using maven to build the project. I am trying to compile a test java file:
package com.mercer.taglibs.tags; import com.day.cq.wcm.api.Page; public class HelloPerson { private Page personPage; public static final String PN_PERSON_NAME = "personName"; public HelloPerson(Page personPage) { this.personPage = personPage; } public String getHelloMessage() { String personName = personPage.getProperties().get(PN_PERSON_NAME).toString(); return personName != null ? personName : "--empty--"; } }I have provided the dependency in parent
<dependency> <groupId>com.day.cq.wcm</groupId> <artifactId>cq-wcm-core</artifactId> <version>5.6.4</version> <scope>provided</scope> </dependency>
pom.xml like this:
and referencing it in the child pom.xml like this:
<dependency> <groupId>com.day.cq.wcm</groupId> <artifactId>cq-wcm-core</artifactId> </dependency>
the error I am getting is:
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project mercer-cq-package-bundle: Compilation failure: Compilation failure:
[ERROR] /C:/Users/ankit-chandrawat/workspace/MMC/mercer/trunk/bundle/src/main/java/com/mercer/taglibs/tags/HelloPerson.java:[3,26] package com.day.cq.wcm.api does not exist
[ERROR] /C:/Users/ankit-chandrawat/workspace/MMC/mercer/trunk/bundle/src/main/java/com/mercer/taglibs/tags/HelloPerson.java:[6,17] cannot find symbol
[ERROR] symbol: class Page
[ERROR] location: class com.mercer.taglibs.tags.HelloPerson
[ERROR] /C:/Users/ankit-chandrawat/workspace/MMC/mercer/trunk/bundle/src/main/java/com/mercer/taglibs/tags/HelloPerson.java:[9,28] cannot find symbol