0

i am new to maven so this could be something basic but i cant seem to get to the bottom of it.

I am running m2eclipse. I have a simple project that is trying to use the classes in the maven package for servlet-api (group id : javax.servlet artifact : servlet-api version 2.5 scope : compile ).

My repository where i assumed it would be pulled from, in my settings.xml (http://repo1.maven.org/maven2 ). I followed this url to verify that there was a jar and such at that address and there was (http://search.maven.org/#browse|-182598336)

however when i run mvn compiler:compile i get the (cannot find symbol symbol : class HttpServletRequest )

also i looked in my repository and the jar's and poms that should be installed there are not. Other classes are but those are not.

i have looked in the debug info i got from the -X and it didnt seem to indicate anything was wrong.

I can post effective pom or whatever anyone would find helpful.

thanks in advance.

nemisis enforcer
  • 349
  • 3
  • 18
  • Two possibilities. You are behind a proxy/firewall. If so, configure suitably. Other, previous download attempt failed. If so, delete the folder `.../javax/servlet/servlet-api/2.5` and retry. – Raghuram Jan 31 '12 at 05:49
  • Try changing the scope of the servlet from `compile` to `provided`. – ndeverge Jan 31 '12 at 07:51
  • @Raghuram, i went to what is my ip . com and was able to determine that i am not behind a firewall or a proxy. I also deleted that folder and now it doesn't seem to DL anything for that dependance at all. – nemisis enforcer Jan 31 '12 at 13:25
  • @nico_ekito , i tried that with both a 2.5 version and a 3.0-alpha-1 versions from the site and got the same results. – nemisis enforcer Jan 31 '12 at 13:26
  • thank you both for your suggestions! unfortunately those did not solve my issue. – nemisis enforcer Jan 31 '12 at 13:27

1 Answers1

0

So I was able to solve the issue. It was a bit strange, but it seems to act differently if you select the pom and click to maven -> add Dependance. That will download and install the dependency.

If you add then directly to the pom (as i was doing before) there is an additional step that seems a bit strange and that is to select the project (again i am using m2eclipse) not the pom, and then click maven -> update dependencies ...

Seems odd because I am not running in offline mode, I would think that when i run mvn compiler:compile from the command line that it should notice that it needs to resolve the dependency and then go get it from the repository...

maybe there is a setting that i have to have to force this to happen?

In any event i hope this saves someone some time :)

nemisis enforcer
  • 349
  • 3
  • 18