Maven not installing dependcies

208 views Asked by At

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.

1

There are 1 answers

0
nemisis enforcer On

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 :)