为什么Play Framework在新的项目模板中使用旧的Ebean版本? [英] Why Play Framework uses old Ebean version in the new project templates?
问题描述
I was bashing my head to the wall (almost literally) trying to figure out why I was having this NullPointException problem for the past 17 days (now you believe, don't you ?).
因此,在阅读和阅读Play的文档时,我注意到了一些东西(我不知道自己以前怎么没注意到!).
So, reading and reading through Play's Documentation I have noticed something ( that I don't know how I haven't noticed before! ).
配置Ebean Ebean ORM附带了播放功能.要启用它,请将Play Ebean插件添加到project/plugins.sbt中的SBT插件:
Configuring Ebean Play comes with the Ebean ORM. To enable it, add the Play Ebean plugin to your SBT plugins in project/plugins.sbt:
addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "3.0.0")
此外,在 Play的论坛上阅读了一些帖子,我有注意到版本2.5.6
已发布,并且我正在使用版本2.5.4
,无论如何我都将其升级并且可以工作,它解决了我的NullPointerException
问题.
Also, reading some posts at Play's forum, I have noticed that version 2.5.6
was released, and I was using version 2.5.4
, in any case I upgrade it both and it worked, it solved my NullPointerException
problem.
但是,我已经通过Play的模板创建了一个新项目:
However, I have created a new project via Play's template:
activator new
Fetching the latest list of templates...
Browse the list of templates: http://lightbend.com/activator/templates
Choose from these featured templates or enter a template name:
1) minimal-akka-java-seed
2) minimal-akka-scala-seed
3) minimal-java
4) minimal-scala
5) play-java
6) play-scala
(hit tab to see a list of all templates)
> 5
Enter a name for your application (just press enter for 'play-java')
> a-new-project
OK, application "a-new-project" is being created using the "play-java" template.
To run "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator run
To run the test for "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator test
To run the Activator UI for "a-new-project" from the command line, "cd a-new-project" then:
/tmp/000/a-new-project/activator ui
然后检查project/plugins.sbt
文件:
// Play Ebean support, to enable, uncomment this line, and enable in your build.sbt using
// enablePlugins(PlayEbean).
// addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")
哪个引起了我的问题:如果要通过play的项目模板启动一个新项目,为什么要从最旧的插件版本开始?最好从这些插件的最新版本开始?
Which leads to my question: if you're starting a new project, via play's project template, why would you start with the oldest version of a plugin ? It would be better to start with the latest version of these plugins ?
您可以在我的存储库中此处.. /p>
You can see my changes on my repository here.
推荐答案
没什么大不了的.只是模板过时了. play-java
模板在此处定义:
Not a big deal. It is just that the template got outdated. The play-java
template is defined here:
https://github.com/playframework/playframework/tree/master/templates/play-java
而且,您可以看到模板在此处添加play-ebean插件:
And, you can see that the template is adding play-ebean plugin here:
不幸的是,如您在此处看到的,EBEAN_VERSION
变量未更新:
Unfortunately, the EBEAN_VERSION
variable was not updated, as you can see here:
https://github.com/playframework/playframework/blob/master/templates/build.sbt#L62
如果需要,您可以提交(非常小而特定的)拉取请求以解决此问题.
If you want, you can submit a (very small and specific) pull request to fix this.
此请求请求将更新模板插件: https://github.com/playframework/playframework/pull /6515
This pull request updates templates plugins: https://github.com/playframework/playframework/pull/6515
这篇关于为什么Play Framework在新的项目模板中使用旧的Ebean版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!