构建 play 2.0 项目时未解决的依赖关系 [英] Unresolved Dependencies when building play 2.0 project
问题描述
昨天从 type safe 下载了 play-2.0,尽可能按照说明进行操作,但是当我使用 sbt 进行构建时,我遇到了未解决的依赖错误:
Downloaded play-2.0 from type safe yesterday, following instructions as far as I can, but when I come to build with sbt I get unresolved dependency errors:
[警告] :: org.slf4j#slf4j-api;1.6.1: 配置未在org.slf4j#slf4j-api;1.6.1:'编译'.它被要求从org.hibernate#hibernate-validator;4.2.0.Final compile [警告] ::commons-codec#commons-codec;1.4:配置未在commons-codec#commons-codec;1.4: '编译'.它被要求从org.apache.httpcomponents#httpclient;4.1.2 编译 [警告]:::::::::::::::::::::::::::::::::::::::::::::: [错误]{file:/Users/george/work/play/gbraw/}gbraw/*:update:sbt.ResolveException: 未解决的依赖项:org.slf4j#slf4j-api;1.6.1:配置未在org.slf4j#slf4j-api;1.6.1:'编译'.它被要求从org.hibernate#hibernate-validator;4.2.0.Final compile [错误]未解析的依赖:commons-codec#commons-codec;1.4:配置在 commons-codec#commons-codec;1.4: 'compile' 中找不到.它是需要从 org.apache.httpcomponents#httpclient;4.1.2 编译
[warn] :: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile [warn] :: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile [warn] :::::::::::::::::::::::::::::::::::::::::::::: [error] {file:/Users/george/work/play/gbraw/}gbraw/*:update: sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile [error] unresolved dependency: commons-codec#commons-codec;1.4: configuration not found in commons-codec#commons-codec;1.4: 'compile'. It was required from org.apache.httpcomponents#httpclient;4.1.2 compile
我已经删除了我的 .sbt 目录(来自较早的 sbt 安装)但没有任何乐趣.我确定我周围有一些我不应该有的东西,但我很感激任何关于去哪里看的指导......
I have deleted my .sbt directory (from an earlier install of sbt) but no joy. I'm sure I have something lying around that I shouldn't have but I'd appreciate any guidance on where to look...
谢谢
推荐答案
所以.ivy2仓库有问题
so there is a problem with .ivy2 repository
至于commons-codec-1.4
有 ivy-1.4.xml 和 ivydata-1.4.properties 文件
在 ${ivy_home}/cache/commons-codec/commons-codec 目录
但是没有真正的commons-codec-1.4.jar在/jars子目录
删除这些 .xml 和 .properties 文件并再次使用 sbt 编译您的项目
依赖现在应该获取
as for commons-codec-1.4
there are ivy-1.4.xml and ivydata-1.4.properties files
in ${ivy_home}/cache/commons-codec/commons-codec dir
but NO real commons-codec-1.4.jar in /jars subdir
DELETE these .xml and .properties files and compile your project with sbt once again
dependency should fetch now
同样适用于 slf4j-api-1.6.1.jar
这篇关于构建 play 2.0 项目时未解决的依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!