【问题标题】:How can I specify a local jar file as a dependency in Play! Framework 1.x如何在 Play 中将本地 jar 文件指定为依赖项!框架 1.x
【发布时间】:2011-11-03 07:23:06
【问题描述】:

我在lib目录下复制了一个jar文件

我想在不删除这个 jar 的情况下运行“play deps --sync”..

我已经看过depency file documentation,但不知道该怎么做

有什么想法吗?

--编辑

我刚刚找到答案:http://groups.google.com/group/play-framework/browse_thread/thread/b54e4e25ae49161b

在问这里之前,我会再谷歌一下

【问题讨论】:

    标签: maven playframework dependencies playframework-1.x


    【解决方案1】:

    就像google群里的回答说的那样,我可以用下面的dependencies.yml文件来实现

    对于库 /jar/DateHelper-1.0.jar

    require:
        - play -> crud
        - provided -> DateHelper 1.0 
    repositories: 
        - provided: 
            type:       local 
            artifact:   "${application.path}/jar/[module]-[revision].jar" 
            contains: 
                - provided -> * 
    

    (您需要创建jar 目录并将您的jar 文件放入其中)

    所以,根据 ${xxxx} 看来,dependecies.yml 文件像模板一样被处理......就像路由文件一样

    【讨论】:

    • 我在 google 列表中被告知依赖文件只处理简单的表达式,例如 ${application.path},而不是像模板一样的每个 groovy 表达式
    • 您不能为此使用 lib 目录。我更新了您的答案以符合小组讨论中的建议。
    • 有更完整的文档在:playframework.org/documentation/1.2.3/…
    • 这可行,但您需要运行,播放依赖项 PROJECTNAME,然后在将其添加到 dependencies.yml 后进行 eclipsify。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-08
    • 2012-11-17
    • 2018-11-01
    • 2014-01-09
    • 1970-01-01
    相关资源
    最近更新 更多