based based - 4 months ago 12x
Java Question

Maven doesn't find dependency

I added a dependency in maven for servlet as seen here, here and here

Maven doesn't find it :

dependency javax.servlet:javax.servlet-api:3.0.1 not found


I tried to add this, which doesn't work :


or this:



First of all you need to verify if you have Internet connectivity and then you can try to purge and resolve the dependencies in the local Maven repository as there could be some corrupted package, you can try the following command to accomplish this:

mvn dependency:purge-local-repository

Take a look to Purging local repository dependencies for more information.