I am trying for so many days to resolve this exception , followed many blogs and couldn't find solution. when I run a bundle.gradle by giving jettyRun as command
I am getting an exception
**FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve javax.servlet:servlet-api:2.5.
Required by:
:1-SimpleServlet:unspecified
> Could not GET 'http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom'.
> Connection to http://repo1.maven.org refused
> Could not resolve org.apache.commons:commons-io:1.3.2.
Required by:
:1-SimpleServlet:unspecified
> Could not GET 'http://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.pom'.
> Connection to http://repo1.maven.org refused**
If gradle --version works, but all of your builds fail with the same error, it is possible there is a problem with one of your Gradle build configuration scripts. You can verify the problem is with Gradle scripts by running gradle help which executes configuration scripts, but no Gradle tasks.
Generally, you can refresh dependencies in your cache with the command line option --refresh-dependencies. You can also delete the cached files under ~/. gradle/caches . With the next build Gradle would attempt to download them again.
The real error is this:
Connection to http://repo1.maven.org refused
Gradle needs to download the dependencies listed in the error message to be able to compile the project.
You're probably behind a firewall or your Internet connection isn't working. You need to make sure Gradle can access http://repo1.maven.org
.
Note: Maven Central (http://repo1.maven.org) can be accessed with a browser. If you see the message "Browsing for this directory has been disabled" that means your browser could connect to the server (the error is a special message my Maven Central, not a standard HTTP error message).
If you see this but Maven or Gradle fail, then you need to check your browser's/OS's proxy settings and configure your tool accordingly.
Related:
Using --refresh-dependencies switch with gradle, helped me to resolve this issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With