【问题标题】:grails ant script can't find spring jarsgrails ant脚本找不到spring jars
【发布时间】:2011-06-01 17:40:29
【问题描述】:

我正在使用 grails 提供的 ant 脚本来构建我的 grails 1.3.6 应用程序,因为我们的构建服务器不支持与 grails 构建系统的直接集成。 ant 构建在我的机器上运行良好,但是 ivy 解析任务在构建服务器上运行时存在问题。我们收到以下消息:

module not found: org.springframework#org.springframework.test;3.0.5.RELEASE
module not found: org.springframework#org.springframework.core;3.0.5.RELEASE
module not found: org.springframework#org.springframework.beans;3.0.5.RELEASE

这对所有各种弹簧罐都继续进行。这些 jars 通常作为 grails 发行版的一部分提供,但由于 ant 脚本使用 ivy 来抓取 grails-bootstrap,它也需要抓取这些 jars。尝试安装 grails 插件时构建失败。

ivy.xml 和 ivysettings.xml 文件与 grails 提供的完全相同。

【问题讨论】:

    标签: grails ant ivy


    【解决方案1】:

    我认为您在 ivy.xml 文件中错误地声明了您的依赖项。试试这个:

    <dependencies>
        <dependency org="org.springframework" name="spring-core" rev="3.0.5.RELEASE"/>
        <dependency org="org.springframework" name="spring-beans" rev="3.0.5.RELEASE"/>
        <dependency org="org.springframework" name="spring-test" rev="3.0.5.RELEASE"/>
    </dependencies>
    

    【讨论】:

      【解决方案2】:

      转到 conf/BuildConfig.groovy 并取消下面的注释部分,这将从提到的 URL 下载缺少的依赖项。

          mavenLocal()
          mavenCentral()
          mavenRepo "http://snapshots.repository.codehaus.org"
          mavenRepo "http://repository.codehaus.org"
          mavenRepo "http://download.java.net/maven/2/"
          mavenRepo "http://repository.jboss.com/maven2/"
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2017-05-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-04-30
        • 1970-01-01
        相关资源
        最近更新 更多