Play Framework 1.2:如何添加自定义模块依赖项 [英] Play Framework 1.2: How to add custom module dependencies

查看:22
本文介绍了Play Framework 1.2:如何添加自定义模块依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在迁移到 Play 1.2 时有点迷茫.我们有一套定制的我们应用程序中的模块.在 Play 1.1.1 中,我们使用了这种结构:

I'm a bit lost in a migration to Play 1.2. We have a set of custom modules in our application. In Play 1.1.1 we used this structure:

/root/
  /module1
  /module2
  ...
  /moduleN
  /main app

并且 application.conf 将模块引用为相对路径 (../模块1)

And application.conf referenced the modules as a relative path (../ module1)

如何在 Play 1.2 中做同样的事情?我明白我应该使用dependencies.yml 文件,但在官方文档.

How can I do the same in Play 1.2? I see I should use the dependencies.yml file, but can't find any information on this topic in the official documentation.

提前致谢

谷歌组里混杂的信息很多,但是这个帖子解决了问题.

There is a lot of mixed information in the Google Group, but this post solved the issues.

我将其复制到此处以供将来在 SO 中搜索此问题的人提供参考:

I copy it here to provide future reference for people searching this issue in SO:

好的,使用master的最新版本,这里是需要的dependencies.yml内嵌评论:

Ok, using the latest from master, here the needed dependencies.yml with comments inline:

# Application dependencies

# Notes:
#   play is an alias for play -> play $currentVersion
#   play -> crud is an alias for play -> crud $currentVersion
#   play -> secure is an alias for play -> secure $currentVersion
#   Modules from the main repository use 'play' as organisation
#

require:
    - play
    - play -> crud
    - play -> secure
    - play -> recaptcha 1.02
    - play -> greenscript 1.2b
    - crionics -> cms 1.0
    - ugot -> widgets 1.0
    - org.markdownj -> markdownj 0.3.0-1.0.2b4

repositories:

    - Scala Tools:
        type:       iBiblio
        root:       http://scala-tools.org/repo-releases/
        contains:
            - org.markdownj

    - My modules:
        type:       local
        artifact:   /somewhere/on/your/disk/[organisation]/[module]-[revision]

        # This folder must contain
        # /somewhere/on/your/disk/crionics/cms-1.0
        # /somewhere/on/your/disk/ugot/widgets-1.0

        contains:
            - ugot
            - crionics 

注意:请注意,如果您对本地存储库设置有任何错误,则在运行 play deps 时可能会删除您的项目(完全!).是的,它发生在我身上:(

NOTE: be aware that if you do something wrong with the local repository settings you risk deleting your project (completely!) when running play deps . Yes, it happened to me :(

推荐答案

要将信息提供给不是 play google group 订阅者的其他人,要查找此类信息,请继续 play google group https://groups.google.com/group/play-framework 并搜索模块 + 本地",您应该找点线索...

To give the information to other people who are not subscribers of the play google group, to find such information, go on play google group https://groups.google.com/group/play-framework and search "module + local", you should find some clue...

这篇关于Play Framework 1.2:如何添加自定义模块依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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