简体   繁体   中英

How to install play! framework modules?

I'm trying to install this pagination module for my Play, application. but can't get it to work, I've extracted the zip file inside /play/modules/paginate-head/ and I an example here on SO. to change my dependencies:yml file into:

# Application dependencies

require:
    - play
    - pagination -> paginate-head

repositories:
    - My modules:
        type:       local
        artifact:   ${application.path}/../[module]
        contains:
            - paginate-head

But I still don't think the module is being loaded. I'm assuming it's documentation should appear on http://localhost:9000/@documentation/home or are there other ways to see if a module was loaded? It's not telling me anything in the console neither.

Any ideas how to get this installed?

You don't need to extract a zip file, just running the command

play install paginate-head

should work fine. But unzipping will also work. You also don't need that "repositories" section in your dependencies.yml file. Play. knows where to find modules.

The real issue is that your require should look like this:

require:
    - play
    - play -> paginate head

Notice play to the left of the '->' which signifies that it's a module. Also no dash between 'paginate' and 'head'. That's because 'paginate' is the module name and 'head' is the version and these should be separated by a space.

Also, for modules that are hosted in the main Play, modules repo. you don't even have to install them. You can just add the require above and start Play, and it will install it automatically. Though it will install under the applications modules directory, not the play modules directory.

Hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM