getting "The import com.day.cq.wcm.api cannot be resolved" in eclipse workspace
Hi All,
1) I have set up the eclipse workspace for CQ and just started doing some code. I am using and import on my java file import com.day.cq.wcm.api.Page; on which I am getting an error "The import com.day.cq.wcm.api cannot be resolved". Is there any dependency I will have to define for this in the pom.xml file. I have already defined :
<dependency> <groupId>com.day.cq</groupId> <artifactId>cq-commons</artifactId> <version>5.6.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.day.cq.wcm</groupId> <artifactId>cq-wcm-commons</artifactId> <version>5.6.2</version> <scope>provided</scope> </dependency> <dependency> <groupId>com.day.cq.wcm</groupId> <artifactId>cq-wcm-api</artifactId> <version>5.6.2</version> <scope>provided</scope> </dependency>
but no luck yet.
2) There's another question I have. I have made a simple java file just to check the build process and here's the code :
package com.mercer.taglibs.tags; import java.io.IOException; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.SimpleTagSupport; public class HelloWorld extends SimpleTagSupport{ public void doTag() throws JspException, IOException { JspWriter out = getJspContext().getOut(); out.println("Hello Custom Tag with checkin version # 2.1.0!"); } }The three imports from javax.servlet.jsp are coming from a jar jsp-api-2.1.jar under bundle/lib, I have included that dependency in my pom.xml as
<dependency>
<groupId>com.mercer</groupId>
<artifactId>jsp-example</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jsp-api-2.1.jar</systemPath>
</dependency>
It's working fine but I am not sur if this a great way of doing it and I get a warning message when I build my project "'dependencies.dependency.systemPath' for com.mercer:jsp-example:jar should not point at files within the project directory, ${project.basedir}/lib/jsp-api-2.1.jar will be unresolvable by dependent projects @ line 80, column 16". Is there anything I am doing wrong ?
Thanks in advance,
Ankit Chandrawat