Play 2.4中的插件,依赖项,模块和子项目之间有什么区别? [英] What is the difference between plugins, dependencies, modules and sub-projects in play 2.4?

查看:97
本文介绍了Play 2.4中的插件,依赖项,模块和子项目之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手,只是学习.我在依赖项,模块,插件和子项目之间有些困惑.它们彼此之间有何不同?

I am new to the playframework and just learning.I am a little confused between dependencies, modules, plugins and sub-projects. How do they differ from each other?

这就是我所了解的,我可能是错的.

Here's what i have understood, i may be wrong.

依赖关系-是运行Play应用程序所需的所有库. 子项目-是另一个父应用程序内的播放应用程序. 不确定插件"和模块".

dependencies - are all the libraries needed for a play application to run. sub-project - is a play application inside another parent application. Not sure about 'plugin' and 'modules'.

有人可以解释他们的不同之处吗?

Can someone please explain how they differ?

注意:我正在使用Play 2.4和play-java,不确定这些定义是否随play-scala改变.

Note: I am working with Play 2.4 and play-java, not sure if the definitions change with play-scala.

推荐答案

您的最初解释非常正确.

Your initial explanation is pretty much correct.

依赖性确实是库,更严格地说,它们是jar文件(包含Java类的zip文件的奇特名称),它们通过存储库分发(最大的回购称为

Dependencies are indeed libraries, more strictly, they are jar files (a fancy name for a zip file that contains java classes) that are distributed through a repository (the biggest repo is called Maven central) and downloaded by SBT.

子项目视为直接嵌入到内部版本中的库.如果运行publishLocal,则您的子项目将被打包到jar中,并部署到本地存储库中.如果已将构建配置为发布到特定的公共(或私有)存储库,则在运行publish时,jar及其元数据将被推送到此处,其他项目可在其依赖项中对其进行声明.实际上,SBT构建中的每个项目都属于此类别.实际上,您的游戏项目是一个可能会被其他东西依赖的库.

Sub projects are best seen as libraries that are embedded directly into your build. If you run publishLocal, your subproject will be packaged up into a jar and deployed to your local repository. If you have configured your build to publish to a particular public (or private) repository, when you run publish, the jar and its metadata will be pushed there, where other projects can declare it in their dependencies. In fact, every project in an SBT build fits into this category. Your play project is in fact a library that could be depended on by something else.

插件和模块是灰色的术语,在不同的上下文中表示不同的事物.

Plugins and modules are grey terms that mean different things in different contexts.

其中一个是sbt插件,它们在您的project/plugins.sbt中声明,它们为您的构建增加了新的行为,例如能够编译更少的文件. Play的开发模式由sbt插件实现.

For one, there are sbt plugins, these are declared in your project/plugins.sbt, and these add new behaviour to your build, such as the ability to compile less files. Play's dev mode is part implemented by an sbt plugin.

但是随后有Play运行时的插件.我们目前正在逐步淘汰该术语,以支持模块一词,但它仍然有一定用处.

But then there's plugins to the Play runtime. We're currently phasing out this terminology, in favour of the word module, but it still does have some use.

我们已经发布了一些有关此处的模块的文档:

We have some documentation already published on what a module is here:

https://www.playframework.com/documentation/2.4.x/Modules

因此,一个模块和一个依赖项可能是同一个东西,也可能不是,一个依赖项可以提供许多模块,一个模块可以由许多传递性依赖项提供.

So a module and a dependency may be one in the same thing, or they may not, a dependency may provide many modules, a single module could be provided by many transitive dependencies.

这篇关于Play 2.4中的插件,依赖项,模块和子项目之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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