播放框架2.1删除核心依赖关系 [英] Play Framework 2.1 Remove a core dependency

查看:165
本文介绍了播放框架2.1删除核心依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从现在开始,我正在尝试使用Joda-time 1.6.2播放项目。我知道玩具框架已经与Joda-2.1相结合,它应该符合joda-time网站1.6.2的要求。

since a few day now i'm trying to use Joda-time 1.6.2 on a play project. I know the play framework already come with the Joda-time 2.1 and it should be compatible with 1.6.2 according to joda-time site.

我正在尝试写一个应用程序,要求用户一个LocalDateTime并使用morphia保存该类与MongoDB上的属性。

I'm trying to write an application that ask the user for a LocalDateTime and save the class with the attributes on a MongoDB using morphia.

我面临一个问题,我必须使用一个类目前正在使用joda-time 1.6.2,我无法更改它依赖性,也不会将其更新为2.1。既然我没有使用joda-time 2.1,是否可能有一些如何从Play Framework 2.1中删除这种依赖关系?所以我可以使用1.6.2?或者至少告诉我,我专门只想在我的项目中使用1.6.2版本?

I'm facing a problem, i have to use a class that are currently using joda-time 1.6.2 and i cannot change it dependency neither update it to 2.1. Since i have no use for the joda-Time 2.1, is it possible some how remove this dependency from Play Framework 2.1? so i can use 1.6.2? Or at least tell play i specifically only want to use the 1.6.2 version on my project?

我已经尝试了:


  • 从缓存依赖关系中删除jodatime文件夹(当然这不会因为它总是再次下载)。

  • 插入joda-time 1.6.2关于项目依赖(手动和管理两种方式)。

  • 搜索核心依赖关系的位置,以便我可以删除它(到目前为止没有运气)。

忘了提到我面临的问题是当数据到达morphia被保存时,我创建了一个全新的,形成良好的4级joda-time字段并继续得到这个错误:

Forgot to mention that the problem i'm facing is when the data arrive to morphia to be saved, i create a completely new and well formed class with 4 joda-time fields and keep getting this error:

[MappingException: Error mapping field:TimeOfDay.TimeStart] 

这发生在 MorphiaObject.datastore.save(pAccess); / p>

This happens in MorphiaObject.datastore.save(pAccess);

推荐答案

我一直在研究依赖管理:
Play Framework核心依赖关系管理/排除

i've been looking into dependency management too in this: Play Framework core dependency management/exclusion

,并有一个指向正确的方向。

and had a pointer in the right direction there.

基本上你想修补你的Build.scala,并重新定义您的appDependencies与显式deps并使用.exclude()。你可能需要声明自己作为一个依赖(如上面的链接),然后明确排除冲突的时间。

basically you want to tinker in your Build.scala, and redefine your appDependencies with explicit deps and use .exclude(). you'll probably need to declare play itself as a dependency ( like in the link above ), then explicitly exclude the conflicing joda time.

你还可以看到带来什么在依赖命令的播放控制台中的每个依赖关系中。

you can also see what is bringing in each dependency in the play console with the 'dependencies' command.

这篇关于播放框架2.1删除核心依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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