Play Framework 1.2:如何添加自定义模块依赖

Play Framework 1.2: How to add custom module dependencies(Play Framework 1.2:如何添加自定义模块依赖)
本文介绍了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.

提前致谢

Google Group 中有很多混杂的信息,但是这篇文章解决了问题.

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:如何添加自定义模块依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How can create a producer using Spring Cloud Kafka Stream 3.1(如何使用Spring Cloud Kafka Stream 3.1创建制片人)
Insert a position in a linked list Java(在链接列表中插入位置Java)
Did I write this constructor properly?(我是否正确地编写了这个构造函数?)
Head value set to null but tail value still gets displayed(Head值设置为空,但仍显示Tail值)
printing nodes from a singly-linked list(打印单链接列表中的节点)
Control namespace prefixes in web services?(控制Web服务中的命名空间前缀?)