Grails失败了Travis CI的依赖

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Grails失败了Travis CI的依赖相关的知识,希望对你有一定的参考价值。

我有一个运行Travis CI测试的Grails 2.5.6项目,几天前我开始收到与未解决的依赖关系相关的错误。

在我这边,应用程序没有改变任何依赖关系,看起来在maven repo上有些不对劲。

这是我得到的日志:

| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: cglib:cglib-nodep:jar:2.2.2, org.codehaus.groovy.modules.http-builder:http-builder:jar:0.5.2, org.grails:grails-datastore-test-support:jar:1.0-grails-2.4, de.odysseus.staxon:staxon:jar:1.2, mysql:mysql-connector-java:jar:5.1.43, org.javassist:javassist:jar:3.17.1-GA, org.mozilla:rhino:jar:1.7R4, com.bertramlabs.plugins:asset-pipeline-core:jar:2.5.5, org.quartz-scheduler:quartz:jar:2.2.1, net.sf.ehcache:ehcache:jar:2.9.0, com.sun.mail:javax.mail:jar:1.5.1, javax.mail:javax.mail-api:jar:1.5.1, org.hibernate:hibernate-validator:jar:5.1.3.Final, org.hibernate:hibernate-ehcache:jar:4.3.10.Final, org.jboss.logging:jboss-logging:jar:3.1.0.GA, org.grails:grails-datastore-gorm-hibernate4:jar:3.1.5.RELEASE, org.liquibase:liquibase-core:jar:2.0.5, net.sf.ehcache:ehcache-core:jar:2.4.8, joda-time:joda-time:jar:2.4: 
   Could not transfer artifact cglib:cglib-nodep:jar:2.2.2 from/to mavenCentral (https://repo1.maven.org/maven2/): Forbidden (403) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: org.codehaus.groovy.modules.http-builder:http-builder:jar:0.5.2, de.odysseus.staxon:staxon:jar:1.2, mysql:mysql-connector-java:jar:5.1.43, org.javassist:javassist:jar:3.17.1-GA, org.mozilla:rhino:jar:1.7R4, com.bertramlabs.plugins:asset-pipeline-core:jar:2.5.5, org.quartz-scheduler:quartz:jar:2.2.1, net.sf.ehcache:ehcache:jar:2.9.0, com.sun.mail:javax.mail:jar:1.5.1, javax.mail:javax.mail-api:jar:1.5.1, org.hibernate:hibernate-validator:jar:5.1.3.Final, org.hibernate:hibernate-ehcache:jar:4.3.10.Final, org.jboss.logging:jboss-logging:jar:3.1.0.GA, org.grails:grails-datastore-gorm-hibernate4:jar:3.1.5.RELEASE, org.liquibase:liquibase-core:jar:2.0.5, net.sf.ehcache:ehcache-core:jar:2.4.8, joda-time:joda-time:jar:2.4: 
   Could not transfer artifact org.codehaus.groovy.modules.http-builder:http-builder:jar:0.5.2 from/to mavenCentral (https://repo1.maven.org/maven2/): Forbidden (403) (Use --stacktrace to see the full trace)
| Error Resolve error obtaining dependencies: The following artifacts could not be resolved: de.odysseus.staxon:staxon:jar:1.2, mysql:mysql-connector-java:jar:5.1.43, org.javassist:javassist:jar:3.17.1-GA, com.bertramlabs.plugins:asset-pipeline-core:jar:2.5.5, org.quartz-scheduler:quartz:jar:2.2.1, net.sf.ehcache:ehcache:jar:2.9.0, javax.mail:javax.mail-api:jar:1.5.1, net.sf.ehcache:ehcache-core:jar:2.4.8, joda-time:joda-time:jar:2.4: 
   Could not transfer artifact de.odysseus.staxon:staxon:jar:1.2 from/to mavenCentral (https://repo1.maven.org/maven2/): Forbidden (403) (Use --stacktrace to see the full trace)
| Error The following artifacts could not be resolved: org.apache.tomcat:tomcat-catalina-ant:jar:7.0.55, org.apache.tomcat.embed:tomcat-embed-jasper:jar:7.0.55, org.apache.tomcat.embed:tomcat-embed-logging-log4j:jar:7.0.55, org.apache.tomcat.embed:tomcat-embed-websocket:jar:7.0.55, org.eclipse.jdt.core.compiler:ecj:jar:3.7.2, org.apache.tomcat.embed:tomcat-embed-core:jar:7.0.55:
   Could not transfer artifact org.apache.tomcat:tomcat-catalina-ant:jar:7.0.55 from/to mavenCentral (https://repo1.maven.org/maven2/): Forbidden (403)
| Run 'grails dependency-report' for further information.

我没有任何关于发生了什么或如何解决它的线索。任何指针都是受欢迎的。

答案

这似乎是特拉维斯访问Maven Central的一个反复出现的问题。见https://github.com/travis-ci/travis-ci/issues/6593https://github.com/travis-ci/travis-ci/issues/10055

建议的解决方法是在sudo: true中使用.travis.yml

以上是关于Grails失败了Travis CI的依赖的主要内容,如果未能解决你的问题,请参考以下文章

Travis CI 构建失败,因为没有输出

使用 Travis-ci 在 pypi 上部署包失败,没有任何错误消息

Swift 测试在本地通过,但在 Travis-CI 上构建失败

在 Travis CI 中构建 Python 项目失败,消息不明确

webpack配置篇(三十五):持续集成和Travis CI

Travis CI 构建 [Cocoapod Swift] 失败,没有“这样的模块...”错误