Play !:使用不同版本的jar而不是本地存储库 [英] Play!: Use different version of jar than local repository
问题描述
播放!框架附带了大量的jar库。我正在使用版本1.7的apache commons-codec for my Play!应用。但是玩!已经附带1.4版和其他一些旧版本。我已将我的commons-codec-1.7.jar放在lib文件夹中,并且'eclipsified'因此jar文件位于类路径中。但是当我在Eclipse中展开Project Explorer时,我发现应用程序引用了1.7和1.4版本。我的问题是
Play! framework comes with tons of jar libraries. I am using version 1.7 of apache commons-codec for my Play! application. But Play! is already shipped with version 1.4 and some other older versions. I have placed my commons-codec-1.7.jar in the lib folder, and 'eclipsified' so the jar file is in the class path. But when I expand the Project Explorer in Eclipse I see that both version 1.7 and 1.4 are referenced by the application. My questions are
- 如何从引用中删除版本1.4?
- 为什么应用程序选择版本1.4,即使版本1.3和1.2存在于[PLAY_HOME] / repository / local
- 这是一个协作项目。我想确保一旦我在git中推送代码并且我的同事们将它拉出来,他们就不需要做同样的'hack',只是'clean'和'compile'。怎么办呢?
BTW,我正在使用Play! 2.0.4
BTW, I am using Play! 2.0.4
推荐答案
将 commons-codec
添加到 Build.scala
你会没事的。依赖关系是正确的,因为指定的依赖关系将覆盖默认的依赖关系。
Add commons-codec
to your Build.scala
and you'll be fine. The dependencies will be correct since the specified dependency will override the ones that are default.
val appDependencies = Seq(
"commons-codec" % "commons-codec" % "1.7"
)
- 您不必删除版本1.4。版本1.7现在将生效。
- 这是由它们在类路径中显示的顺序引起的。
-
play编译
会做到这一点。并且你必须再次使项目重新开始。
- You don't have to remove version 1.4. Version 1.7 will be in effect now.
- That is caused by the order they are presented in the classpath.
play compile
will do it. And you'll have to eclipsify the project again.
不要忘记删除 commons-codec来自
。如上所述,它将被自动下载并放入类路径中。 lib
文件夹的
Don't forget to remove the commons-codec
from the lib
folder. As said it will be downloaded and put in the classpath automatically.
这篇关于Play !:使用不同版本的jar而不是本地存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!