Play !:使用不同版本的jar而不是本地存储库 [英] Play!: Use different version of jar than local repository

查看:112
本文介绍了Play !:使用不同版本的jar而不是本地存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

播放!框架附带了大量的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. 如何从引用中删除版本1.4?

  2. 为什么应用程序选择版本1.4,即使版本1.3和1.2存在于[PLAY_HOME] / repository / local

  3. 这是一个协作项目。我想确保一旦我在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. 您不必删除版本1.4。版本1.7现在将生效。

  2. 这是由它们在类路径中显示的顺序引起的。

  3. play编译会做到这一点。并且你必须再次使项目重新开始。

  1. You don't have to remove version 1.4. Version 1.7 will be in effect now.
  2. That is caused by the order they are presented in the classpath.
  3. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆