播放框架:添加指向本地jar文件目录的依赖项 [英] Play Framework: Add a dependency that points to a directory of local jar files

查看:114
本文介绍了播放框架:添加指向本地jar文件目录的依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以为指向目录的依赖关系添加依赖关系?

Is it possible to add a dependency to the dependencies.yml that points to a directory?

例如,对于dependencies.yml使用伪yml,我想做这样的事情:

For example, using pseudo yml for the dependencies.yml, I want to do something like this:

require:
    - mycooldirectory

repositories:
    - mycooldirectory:
        type: local
        artifact: "${application.path}/jars/mycooldirectory/*.jar"
        contains: 
            - mycooldirectory -> *

在我的相信世界中,上述将包含mycooldirectory作为一个类路径文件夹,并使用在该目录中找到的任何罐子。

In my make-believe-world, the above would include the mycooldirectory as a classpath folder and use any jars found in that directory.

我正在填充内容,但我希望这样解释我想要做什么。我知道你可以把jar放在/ lib目录中,但是当执行播放依赖项--sync 时,依赖关系将被擦除。我也知道您可以通过执行这个。但是,我只是想知道你是否可以做类似的事情,但是引用一个完整的jars的目录?

I'm just making stuff up, but I hope that kind of explains what I want to do. I know you can put jars in the /lib directory but any jars unspecified by the dependencies.yml will get wiped when doing a play dependencies --sync. I also know you can specify single jars by doing this. However, I was just wondering whether you can do something similar but reference a whole directory full of jars?

编辑:我有一种解决方法是通过为mycooldirectory创建一个Play模块结构(即在该目录下有一个lib目录),并将所有的jar放在该lib目录中。然后在dependencies.yml中,执行以下操作:

I have a sort of workaround which works is by creating a Play module structure for mycooldirectory (i.e. have a lib directory under that directory) and put all the jars in that lib directory. And then in the dependencies.yml, do this:

require:
    - mycooldirectory -> mycooldirectory

repositories:
   - provided:    
       type:       local
       artifact:   "${application.path}/jars/[module]"
       contains:  
         - mycooldirectory

虽然我想知道是否有一个更干净的方法,

Though I was wondering whether there was a cleaner way of doing this without having to make a pretend module and just reference a new directory to have additional jars.

推荐答案

此解决方法与您的类似,但是它应该没有一个 / lib 目录。我没有测试过,但是它是在邮件列表上得到积极的反馈。

This workaround is similar to yours, but it should work without a /lib directory. I haven't tested it, but it was on the mailing list and got positive feedback there.

require:
  - play
  - play -> googleclosure 1.2
  - provided -> mylib 1.0

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

邮件列表主题: https://groups.google.com/forum/#!topic/play-framework/tU5OJa5JFhs/discussion

这篇关于播放框架:添加指向本地jar文件目录的依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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