Web 启动grails应用程序时遇到获取依赖项的错误

Web 启动grails应用程序时遇到获取依赖项的错误,web,grails,dependencies,Web,Grails,Dependencies,我是GrailsWeb框架的新手。我在终端上运行我的第一个grails应用程序时遇到了这个错误。下面是我得到的错误 > | Downloading: > org/apache/commons/commons-parent/17/commons-parent-17.pom | Error > Resolve error obtaining dependencies: Failed to read artifact > descriptor for org.hamcrest

我是GrailsWeb框架的新手。我在终端上运行我的第一个grails应用程序时遇到了这个错误。下面是我得到的错误

> | Downloading:
> org/apache/commons/commons-parent/17/commons-parent-17.pom | Error
> Resolve error obtaining dependencies: Failed to read artifact
> descriptor  for org.hamcrest:hamcrest-core:jar:1.3 (Use --stacktrace
> to see the full trace)
> 
> | Error Required Grails build dependencies were not found. This is
> normally due to internet connectivity issues (such as a misconfigured
> proxy) or missing repos itories in grails-app/conf/BuildConfig.groovy.
> Please verify your configuration to continue.

我正在使用internet连接运行此应用程序,但此错误仍然发生。如何修复此错误?

您确定使用的是正确的grails下载工具吗?您试图连接到internet,但grails却无法连接?是否可以检查您的代理设置?或者您真正想在命令行中做什么?

您的BuildConfig.groovy中有哪些mavenRepo。我发现我必须补充一些,这是我的:

  repositories {
    inherits true // Whether to inherit repository definitions from plugins

    grailsPlugins()
    grailsHome()
    mavenLocal()
    grailsCentral()
    mavenCentral()
    // uncomment these (or add new ones) to enable remote dependency resolution from public Maven repositories
    mavenRepo "http://repository.codehaus.org"
    mavenRepo "http://download.java.net/maven/2/"
    mavenRepo "http://repository.jboss.com/maven2/"
    mavenRepo 'http://repo.spring.io/milestone'
}

你试过跑步吗

grails刷新依赖项


在你试着运行你的应用程序之前?

你有什么版本的Grails,那么你有什么版本的JDK?在Windows 8中使用JDK Java SE 7u45和Grails 2.3.1,我有很多问题;我不得不降级到JDK,你的控制台日志显示,你不能连接到internet下载依赖项。 但事实并非如此。Maven已经停止了http存储库,这是根本原因。 你必须使用https。如果由于某种原因无法连接到https,以下是解决方法:

mavenRepo "http://insecure.repo1.maven.org/maven2/"

在BuildConfig.groovy中放置上述行将解决您的问题并开始下载依赖项。

我只是在命令行中尝试了我的第一个应用程序。我从站点下载了grails-2.3.1。您在下面提到您正在使用命令行。你是在工作还是在家里?你是在防火墙后面,并且在conf文件中配置了你的代理吗?你有和我一样的mavenRepo吗?是的,但是这些行被注释为mavenRepo“mavenRepo”“mavenRepo”“mavenRepo”“Grails 2.3.1,是的,我也认为这是版本中的问题,但是2.2.4运行良好