Using dependencies.yml in modules

1,230 views
Skip to first unread message

Alexander Reelsen

unread,
Feb 20, 2011, 6:02:52 PM2/20/11
to play-fr...@googlegroups.com
Hi there,

I've got a small question regarding dependency management with modules.
Basic setup

Application dependencies.yml:
require:
- play
- play -> depmodule 1.0

Module:
self: play -> depmodule $version

require:
- play
- rome 0.9:
transitive: false

When calling "play dependencies" in the module, rome is downloaded and
put into the lib/ directory.

When starting the application everything is fine then. However, when the
module does not have the needed libraries in the lib/ directory, it will
break.

My first thought was, this is a bug, but I guess it actually is a
feature. So the question is:

Are module dependencies in an application resolved transitive or has the
module maintainer to do this work?
If so, why is it useful to add the module in the application preferences
anyway?

Thanks for any help...


--Alexander

Guillaume Bort

unread,
Feb 25, 2011, 1:43:23 PM2/25/11
to play-fr...@googlegroups.com
The module dependencies should be resolved transitively. Can you test again?

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>
>

--
Guillaume Bort, http://guillaume.bort.fr

For anything work-related, use g...@zenexity.fr; for everything else,
write guillau...@gmail.com

Donovan Muller

unread,
Apr 14, 2011, 8:53:14 AM4/14/11
to play-fr...@googlegroups.com
 Hi,

I just want to understand dependency management in modules a little better.
Given this dependencies.yml for the app using the module:

# Application dependencies

require:
    - play
    - test 1.0

repositories:
    - Test:
        type: local
        artifact: "${play.path}/[module]-[revision]"
        descriptor: "${play.path}/[module]-[revision]/conf/dependencies.yml"
        contains:
            - test

and this dependencies.yml for the module:

self: test -> test 1.0

require:
    - com.google.guava -> guava r07

After running 'play dependencies' the guava jars will be added to the app lib directory.
What if your module requires dependent jars in the modules lib directory?
How would you specify that these jars should not be copied to the apps lib directory but to the modules directory instead?
Or am I getting this totally confused and this is that not in scope for Play dependency management?
I.e. as per Alexander's mail below, those jars need to be handled manually by the module developer...

Guillaume Bort

unread,
Apr 14, 2011, 8:58:39 AM4/14/11
to play-fr...@googlegroups.com
> What if your module requires dependent jars in the modules lib directory?
> How would you specify that these jars should not be copied to the apps lib
> directory but to the modules directory instead?

It doesn't matter as all lib directory are merged at runtime.

Donovan Muller

unread,
Apr 14, 2011, 9:13:00 AM4/14/11
to play-fr...@googlegroups.com
Ok, thank.

Quick question. Trying to exclude dependencies but getting this error:

~ Oops, malformed dependencies.yml descriptor:
~
~       while parsing a block collection
~        in "<reader>", line 4, column 5:
~               - org.neo4j -> neo4j 1.3:
~               ^
~       expected <block end>, but found Key
~        in "<reader>", line 5, column 5:
~               exclude:
~               ^
~
~
:: resolution report :: resolve 660ms :: artifacts dl 178ms

dependencies.yml:

require:
    - org.neo4j -> neo4j 1.3:
    exclude:
       - neo4j-udc -> 1.3

I used the example in the docs, what am I doing wrong?

robfig

unread,
Apr 14, 2011, 11:33:00 AM4/14/11
to play-fr...@googlegroups.com
I think the error message is telling you to remove the colon after neo4j 1.3.

e.g.

require:
    - org.neo4j -> neo4j 1.3
    exclude:
       - neo4j-udc -> 1.3


Donovan Muller

unread,
Apr 14, 2011, 1:43:12 PM4/14/11
to play-fr...@googlegroups.com
Thanks for the link, turns out the indentation is important (noob at YAML)

This does not generate an error but does not have the desired affect:

dependencies.yml:

self: neo4j -> neo4j 1.0

require:
    - org.neo4j -> neo4j 1.3:
       exclude:
          - neo4j-udc -> *
          - neo4j-jmx -> *
          - osgi_R4_core -> *
          - osgi_R4_compendium -> *

Output:

~ Installing resolved dependencies,
~
~ modules/greenscript-1.2b
~ modules/neo4j-1.0 -> /home/donovan/dev/workspace/bizhive-workspace/neo4j-1.0
~ lib/neo4j-1.3.jar
~ lib/neo4j-kernel-1.3.jar
~ lib/neo4j-lucene-index-1.3.jar
~ lib/neo4j-graph-algo-1.3.jar
~ lib/neo4j-udc-1.3.jar
~ lib/neo4j-jmx-1.3.jar
~ lib/geronimo-jta_1.1_spec-1.1.1.jar
~ lib/org.apache.servicemix.bundles.lucene-3.0.1_2.jar
~ lib/osgi_R4_core-1.0.jar
~ lib/osgi_R4_compendium-1.0.jar


After running 'play dependencies' the excluded jars are still downloaded...
Is this a bug?

--

Guillaume Bort

unread,
Apr 15, 2011, 6:02:53 AM4/15/11
to play-fr...@googlegroups.com
Use

require:
- play


- org.neo4j -> neo4j 1.3:
exclude:

- org.neo4j -> neo4j-jmx
- org.neo4j -> neo4j-udc
- org.osgi

The correct syntax is organization -> name version

--
Guillaume Bort, http://guillaume.bort.fr

Ambar Anant

unread,
Jul 14, 2015, 10:20:32 AM7/14/15
to play-fr...@googlegroups.com, a...@emplify.de
Hi,

I know this is a really old post and hardly anybody is using 1.2.4 anymore.
I need some help with dependencies.yml, no matter what I am not getting the right combination for properties transitive and exclude:

My dependencies.yml:
# Application dependencies
# Don't follow transitive dependencies for this project
transitiveDependencies: false
require: &external
     - play -> play
     - play -> secure
     - play -> maven
     - play -> cobertura-1.2
     - org.seleniumhq.selenium -> selenium-java 2.44.0
     - com.google.guava -> guava 15.0
     - com.jcraft -> jsch 0.1.49
     - org.jsoup -> jsoup 1.6.1
     - com.oracle -> ojdbc6 11.2.0.2.0
     - net.sf.opencsv -> opencsv 2.3
     - org.mockito -> mockito-all 1.9.5
     - org.quartz-scheduler -> quartz 2.0.1:
             "exclude":
                - org.apache.openejb -> javaee-api-5.0-2.jar
repositories:
     - nexus:
        type:   iBiblio
        artifact:   "${play.path}/framework/lib/[artifact]-[revision].jar"
        root:   "http://nexus:8081/nexus/content/groups/public/"
        contains: *external

This gives an error:

~

~ Oops, malformed dependencies.yml descriptor:
~
~       Unknown depedency format -> {org.quartz-scheduler -> quartz 2.0.1={exclu
de=[org.apache.openejb -> javaee-api-5.0-2.jar]}}
~
Exception in thread "main" java.lang.RuntimeException: Malformed dependencies.ym
l descriptor
        at play.deps.SettingsParser.parse(SettingsParser.java:90)
        at play.deps.DependenciesManager.configure(DependenciesManager.java:338)

        at play.deps.DependenciesManager.resolve(DependenciesManager.java:298)
        at play.deps.DependenciesManager.main(DependenciesManager.java:39)

If I try:

# Application dependencies
# Don't follow transitive dependencies for this project
transitiveDependencies: false
require: &external
     - play -> play
     - play -> secure
     - play -> maven
     - play -> cobertura-1.2
     - org.seleniumhq.selenium -> selenium-java 2.44.0
     - com.google.guava -> guava 15.0
     - com.jcraft -> jsch 0.1.49
     - org.jsoup -> jsoup 1.6.1
     - com.oracle -> ojdbc6 11.2.0.2.0
     - net.sf.opencsv -> opencsv 2.3
     - org.mockito -> mockito-all 1.9.5
     - org.quartz-scheduler -> quartz 2.0.1:
             "transitive":
                false
repositories:
     - nexus:
        type:   iBiblio
        artifact:   "${play.path}/framework/lib/[artifact]-[revision].jar"
        root:   "http://nexus:8081/nexus/content/groups/public/"
        contains: *external
I get:

# Application dependencies
# Don't follow transitive dependencies for this project
transitiveDependencies: false
require: &external
     - play -> play
     - play -> secure
     - play -> maven
     - play -> cobertura-1.2
     - org.seleniumhq.selenium -> selenium-java 2.44.0
     - com.google.guava -> guava 15.0
     - com.jcraft -> jsch 0.1.49
     - org.jsoup -> jsoup 1.6.1
     - com.oracle -> ojdbc6 11.2.0.2.0
     - net.sf.opencsv -> opencsv 2.3
     - org.mockito -> mockito-all 1.9.5
     - org.quartz-scheduler -> quartz 2.0.1:
             "transitive":
                false
repositories:
     - nexus:
        type:   iBiblio
        artifact:   "${play.path}/framework/lib/[artifact]-[revision].jar"
        root:   "http://nexus-am-prod.jpmchase.net:8081/nexus/content/groups/public/"
        contains: *external


greenLED

unread,
Jul 16, 2015, 1:49:03 AM7/16/15
to play-fr...@googlegroups.com
Tou might get suprised with this, but I still see lot of 1.2.4 projects :) but no one with those huge dependencies. Sorry, I have never seen a sintax like yours before.
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/2fe78cb2-8b1e-4384-a463-652a4e37d4aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages