maven dependencies resolution problem

I have variable of type SlingHttpServletRequest
And I see error that method getParameterMap cannot be resolved but code compiles without any errors.

When I check declaration of SlingHttpServletRequest it is declared in this lib
.m2/repository/org/apache/sling/org.apache.sling.api/2.2.0/org.apache.sling.api-2.2.0-sources.jar!/org/apache/sling/api/SlingHttpServletRequest.java
and as it extends HttpServletRequest which is declared in
.m2/repository/org/apache/felix/javax.servlet/1.0.0/javax.servlet-1.0.0.jar!/javax/servlet/http/HttpServletRequest.class

In diffrent project I have similar dependecy declarations in pom.xml file but method getParameterMap is valid for Idea.
difrence is where Idea shows declaration of HttpServletRequest
.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4-sources.jar!/javax/servlet/http/HttpServletRequest.java

I try to align dependecies configuration in pom with no success.

2 comments
Comment actions Permalink

Hello.

So, it looks clear that the version of servlet-api needs to be adjusted. Somewhere in problematic project you have a dependency to javax.servlet-1.0.0. Have you found where it come from (e.g is it specified in POM)? Do you need it in your project?

Thanks,
Alexander.

0
Comment actions Permalink

javax.servlet-1.0.0 dependecy is not defined directly but came from org.apache.felix:org.osgi.compendium as sub dependecy.
Issue was in Idea project files it somehow stuck with this path of resolution. I remove all Idea files and reimport project from pom and now I don't see this problem.
Thanks,
Bartek

0

Please sign in to leave a comment.