How can I refer to third-party modules without referring to the absolute path?

Here is my situation. I have a playback application that uses the guice module . To work with the guice module:

  • I installed it using play install guice. This sets it in $PLAY_HOME/modules, which is okay for me. I do not want to edit module files in any way.
  • Then I declared a module in mine dependencies.ymlas follows:- play -> guice 1.2
  • In my application, I launched play dependencies, and this will completely clear the module and create a file modules/guice-1.2that references the guice module.

The problem lies in the fact that the contents of this file looks like this: /some-absolute-path/play-1.2.x/modules/guice-1.2.

This works great for local development. But when I want to switch to a production server, with a different Play installation! (i.e. with another absolute path to it), it will obviously fail.

So what's the best way to handle this?

Now, I resorted to the ad unit in the file application.confas follows: module.guice=${play.path}/modules/guice-1.2. Unfortunately, magic ${play.path}does not work on these generated files.

By the way, I'm using version 1.2.3 Play!

+5
source share
3 answers

you should try with $ {application.path} in the dependencies.yml file, as in this example

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

see this question: How can I specify a local jar file as a dependency in Play! Framework 1.x

+2

( ) Play, , .

, , Heroku.

0

, .

  • .
  • , .
  • , .

The only workaround I find: do not install the module on Play! applications, just enable banks that use this module manually. play-guice.jarshould be included as suggested by @opensas, aopallianceand com.google.injectas regular dependencies in dependencies.yml.

The funny thing is that resync dependencies also delete files .svn, so reserve it before calling this command.

0
source

All Articles