Dependency management in master

1,065 views
Skip to first unread message

Guillaume Bort

unread,
Jan 18, 2011, 11:56:33 AM1/18/11
to play-fr...@googlegroups.com
Hi all,

Just to say that I've finally merged my work on Play dependency
management into the master branch.

If you are interested to give it a try, the temporary documentation is here:

https://gist.github.com/784734

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

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

Leandro

unread,
Jan 18, 2011, 12:06:43 PM1/18/11
to play-fr...@googlegroups.com
Thank you Bort...

> --
> 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.
>
>

Ludocwi

unread,
Jan 18, 2011, 12:18:29 PM1/18/11
to play-framework
It looks really good ! can't wait to test it !
Thank you !

On 18 jan, 18:06, Leandro <leandropinc...@gmail.com> wrote:
> Thank you Bort...
>
> On Tue, Jan 18, 2011 at 2:56 PM, Guillaume Bort
>
> <guillaume.b...@gmail.com> wrote:
> > Hi all,
>
> > Just to say that I've finally merged my work on Play dependency
> > management into the master branch.
>
> > If you are interested to give it a try, the temporary documentation is here:
>
> >https://gist.github.com/784734
>
> > --
> > Guillaume Bort,http://guillaume.bort.fr
>
> > For anything work-related, use g...@zenexity.fr; for everything else,
> > write guillaume.b...@gmail.com

Pascal Voitot Dev

unread,
Jan 18, 2011, 12:18:15 PM1/18/11
to play-fr...@googlegroups.com
Great great!!! I just hope we will not have side effects such as cycling transitive deps in Maven ;)

Does it manage dependencies in a module also? (for ex: a module requires another module to work)

Pascal

Guillaume Bort

unread,
Jan 18, 2011, 12:26:40 PM1/18/11
to play-fr...@googlegroups.com
> Does it manage dependencies in a module also? (for ex: a module requires another module to work)

Yes of course. Each module can have its own conf/dependencies.yml
descriptor that will be resolved transitively.

Pascal Voitot Dev

unread,
Jan 18, 2011, 12:29:17 PM1/18/11
to play-fr...@googlegroups.com
On Tue, Jan 18, 2011 at 6:26 PM, Guillaume Bort <guillau...@gmail.com> wrote:
> Does it manage dependencies in a module also? (for ex: a module requires another module to work)

Yes of course. Each module can have its own conf/dependencies.yml
descriptor that will be resolved transitively.


great news :)
play is becoming reallly really powerful ;)

Ike

unread,
Jan 18, 2011, 12:45:04 PM1/18/11
to play-fr...@googlegroups.com
Thanks Guillaume. Great ideas and implementation as usual!

Any recommendations for existing projects? Do you recommend adding the dependencies.yml file manually and switch to using the command?

David González

unread,
Jan 18, 2011, 1:08:45 PM1/18/11
to play-fr...@googlegroups.com
Yes of course. Each module can have its own conf/dependencies.yml
> descriptor that will be resolved transitively.

Great! Is this for 1.2 or 1.1.1?

On Tue, Jan 18, 2011 at 1:45 PM, Ike <ike...@gmail.com> wrote:
Thanks Guillaume. Great ideas and implementation as usual!

Any recommendations for existing projects? Do you recommend adding the dependencies.yml file manually and switch to using the command?

--
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.



--
Best wishes,
David

grandfatha

unread,
Jan 18, 2011, 1:25:59 PM1/18/11
to play-framework
Absolutely amazing job !


One wish: Could the 'play eclipsify' command be altered to include
javadoc/sources downloaded alongside with the dependencies? This way
you can debug way easier without having to manually attach all
javadocs/sources in eclipse whenever you re-run "play eclipsify"
again.

Guillaume Bort

unread,
Jan 18, 2011, 1:30:15 PM1/18/11
to play-fr...@googlegroups.com
> Any recommendations for existing projects? Do you recommend adding the
> dependencies.yml file manually and switch to using the command?

Yes you can create the dependencies.yml file yourself and run the command.

> --
> 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

unread,
Jan 18, 2011, 1:30:29 PM1/18/11
to play-fr...@googlegroups.com
> Great! Is this for 1.2 or 1.1.1?

1.2

--

Guillaume Bort

unread,
Jan 18, 2011, 1:31:52 PM1/18/11
to play-fr...@googlegroups.com
Well currently only jar are downloaded, but I guess it would be a nice
evolution once the whole system is ready.

> --
> 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.
>
>

--

Yann

unread,
Jan 19, 2011, 2:44:04 AM1/19/11
to play-framework
Great job!

I have a question about test dependencies: how are they managed?
For example, we use PowerMock/EasyMock widely on our Play! apps, and
we need to manually remove these JARs when packaging the releases.

On 18 jan, 17:56, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Hi all,
>
> Just to say that I've finally merged my work on Play dependency
> management into the master branch.
>
> If you are interested to give it a try, the temporary documentation is here:
>
> https://gist.github.com/784734
>
> --
> Guillaume Bort,http://guillaume.bort.fr
>
> For anything work-related, use g...@zenexity.fr; for everything else,
> write guillaume.b...@gmail.com

Guillaume Bort

unread,
Jan 19, 2011, 5:39:09 AM1/19/11
to play-fr...@googlegroups.com
> I have a question about test dependencies: how are they managed?
> For example, we use PowerMock/EasyMock widely on our Play! apps, and
> we need to manually remove these JARs when packaging the releases

It is possible to declare dependencies that will be resolved only for
a specific framework id. For example:

require:
- play
- play -> crud
- org.powermock -> powermock-module-junit4 1.4.7:
id: test

Now if you run 'play deps --%test --sync', Play will retrieve
powermock and its dependencies and install them.

If you run 'play deps --%release --sync', powermock libraries will be
deleted from the lib/ directory.

> --
> 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

grandfatha

unread,
Jan 19, 2011, 9:08:17 AM1/19/11
to play-framework


On Jan 18, 7:31 pm, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Well currently only jar are downloaded, but I guess it would be a nice
> evolution once the whole system is ready.
>

In a sample project I am using the Ivy module which also retrieves
dependencies into the lib folder. Interestingly it outputs the jar,
sources and javadocs artifacts into the lib folder as well. The
eclipsify command recognizes them and adds them to the .classpath file
in the following way:

<classpathentry kind="lib" path="...path.../lib/guava-r06.jar"
sourcepath="...path.../lib/guava-r06-sources.jar"/>

Does the new DependenciesManager output the three artifacts also or
only the compiled jar? If yes, then we would get source attachments
for free. If no, one would have to inspect the Ivy
ArtifactDownloadReport during the eclipse.py command somehow and maybe
make a "sourcepath"-reference to the sources-jar from Ivy cache dir.

Guillaume Bort

unread,
Jan 20, 2011, 5:25:09 AM1/20/11
to play-fr...@googlegroups.com
I see.

Olivier Refalo

unread,
Jan 20, 2011, 7:26:41 AM1/20/11
to play-fr...@googlegroups.com

ok, I am trying to convert my app and I am lost. -> this happens to be a perfect example.
here are my modules:

#module.crionics-cms=${play.path}/crionics-cms
#module.crud=${play.path}/modules/crud
#module.secure=${play.path}/modules/secure
#module.recaptcha=${play.path}/modules/recaptcha-1.02
#module.greenscript=${play.path}/modules/greenscript-1.2b
#module.ugot-widgets=${play.path}/ugot-widgets

on top of that, I am using markdownj in the lib folder, the repository is here http://code.google.com/p/markdownj/wiki/Maven

all the ugot and crionics are local segmentations of my application living in the play folder.

Now I tried to convert it and this is what I get (with errors of course)

require:
 - play 1.2
 - recaptcha 1.02
 - greenscript 1.2b
 - secure
 - crud
 - markdownj

How do I define the markdown repo ? How do I reference my local projects ?

Thanks!

Artem Medeu

unread,
Jan 20, 2011, 7:36:25 AM1/20/11
to play-fr...@googlegroups.com

Try this one:

 require:
     - play modules ....
     - your.namespace -> module version # e.g. org.orefalo -> ugot-widgets 1.0
     - org.markdownj -> markdownj 1.0.2b #or any other version

 repositories:
     - scalaTools:
         type: http
         artifact: http://scala-tools.org/repo-releases
         m2compatible: true #maybe not needed
         contains:
             - org.markdownj -> *

Artem Medeu

unread,
Jan 20, 2011, 7:42:00 AM1/20/11
to play-fr...@googlegroups.com
guillaumebort committed 4386006
Add 'root' option to iBiblio compatible repositories

Wow, it was fast :) With this commit next snipped should work also: 
repositories:
     - scalaTools:
         type: ibiblio
         root: http://scala-tools.org/repo-releases

Guillaume Bort

unread,
Jan 20, 2011, 7:50:00 AM1/20/11
to play-fr...@googlegroups.com
Ok, using the latest from master, here the needed dependencies.yml
with comments inline:

# Application dependencies


# Notes:
# play is an alias for play -> play $currentVersion
# play -> crud is an alias for play -> crud $currentVersion
# play -> secure is an alias for play -> secure $currentVersion
# Modules from the main repository use 'play' as organisation
#

require:
- play
- play -> crud

- play -> secure
- play -> recaptcha 1.02
- play -> greenscript 1.2b
- crionics -> cms 1.0
- ugot -> widgets 1.0
- org.markdownj -> markdownj 0.3.0-1.0.2b4

repositories:

- Scala Tools:
type: iBiblio
root: http://scala-tools.org/repo-releases/
contains:
- org.markdownj

- My modules:
type: local
artifact: /somewhere/on/your/disk/[organisation]/[module]-[revision]

# This folder must contain
# /somewhere/on/your/disk/crionics/cms-1.0
# /somewhere/on/your/disk/ugot/widgets-1.0

contains:
- ugot
- crionics

> --
> 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.
>

--

Magnus

unread,
Jan 20, 2011, 2:10:09 PM1/20/11
to play-framework
Hi Guillaume or someone!

Two questions concerning modules:

The gist (https://gist.github.com/784734 ) says:

"A Play application can have 3 kind of dependencies: [...]
A Play module (in fact an application fragment)
installed in your application’s modules/ directory."

Question 1: Do I have to place my module in a ./modules/ directory?

I think I'd like to place my modules in ../one-module/ and ../
another-module/,
so my project structure looks like so:
git-repo-dir
|--- the-application-itself
|--- one-module
`--- another-module

Question 2: Must a module be a module? Or can it be an application as
well?

(Background: I currently don't use modules because, as far as I've
understood,
it is not possible to place unit tests in a module. (E.g. ``play new-
module''
generates no "test" folder.) Since I intend to re-use the modules
in other applications, I think it's reasonable for me to keep the test
cases in the module. So the other applications can benefit
from them. Therefore I currently use applications not modules.)

Kind regards, KajMagnus


On Jan 18, 5:56 pm, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Hi all,
>
> Just to say that I've finally merged my work on Play dependency
> management into the master branch.
>
> If you are interested to give it a try, the temporary documentation is here:
>
> https://gist.github.com/784734
>
> --
> Guillaume Bort,http://guillaume.bort.fr
>
> For anything work-related, use g...@zenexity.fr; for everything else,
> write guillaume.b...@gmail.com

Guillaume Bort

unread,
Jan 20, 2011, 5:48:28 PM1/20/11
to play-fr...@googlegroups.com
> Question 1: Do I have to place my module in a ./modules/ directory?
>
> I think I'd like to place my modules in ../one-module/  and  ../
> another-module/,
> so my project structure looks like so:
> git-repo-dir
>  |--- the-application-itself
>  |--- one-module
>  `--- another-module

With the new dependency management system, Play will load
automatically all modules found in the modules/ directory. And this
list should be managed by running 'play dependencies'.

I suggest this layout for your project:

|--- the-application-itself
|--- optional
|---- moduleA-1.0
|---- moduleB-1.0
|---- moduleC-1.0

And in the-application-itself/conf/dependencies.yml:

require:
- play
- yourcompany -> moduleA 1.0
- yourcompnay -> mobuleB 1.0

repositories:

- Optional Modules
type: local
artifact: ${application.path}/../optional/[module]-[revision]
contains:
- yourcompnay

Now if you run 'play dependencies' Play will create 2 text files in
your the-application-itself/modules/ directory linking to the real
path of your modules.

You can even add a dependencies.yml file in each module to declare
dependencies of each modules. For instance enabling moduleB will also
install moduleC and download a bunch of required jars in lib/

> Question 2: Must a module be a module? Or can it be an application as well?

A module is an application. It is the same.

> --
> 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

Olivier Refalo

unread,
Jan 20, 2011, 9:53:35 PM1/20/11
to play-fr...@googlegroups.com
Thank you guys, got it working to my likings using the following config.

require:
    - play
    - play -> crud
    - play -> secure
    - play -> recaptcha 1.02
    - play -> greenscript 1.2b
    - crionics -> cms 1.0
    - ugot -> widgets 1.0
    - org.markdownj -> markdownj 0.3.0-1.0.2b4

repositories:
    - Scala Tools:
        type:       iBiblio

        root:       http://scala-tools.org/repo-releases/
        contains:
            - org.markdownj

    - My modules:
        type:       local
        artifact:   ${play.path}/[organisation]-[module]

Olivier Refalo

unread,
Jan 21, 2011, 12:02:00 AM1/21/11
to play-fr...@googlegroups.com
So I got dependencies working... But now I have a side effect.

Play eclipsify doesn't pickup my module paths....

Artem Medeu

unread,
Jan 21, 2011, 2:18:13 AM1/21/11
to play-fr...@googlegroups.com
Try "play eclipsify --deps" of "play ec --deps".

Artem Medeu

unread,
Jan 21, 2011, 2:31:03 AM1/21/11
to play-fr...@googlegroups.com
This works for me (twig is my custom module):
 
require:
    - play
    - com.google.guava -> guava r07
    - twig 1.0

repositories:
    - Optional Modules:
        type: local
        artifact: /opt/coding/play/modules/[module]-[revision]
        contains:
            - twig

Guillaume Bort

unread,
Jan 21, 2011, 4:34:41 AM1/21/11
to play-fr...@googlegroups.com
Does 'play modules' work?

On Fri, Jan 21, 2011 at 6:02 AM, Olivier Refalo <ore...@yahoo.com> wrote:
> So I got dependencies working... But now I have a side effect.
> Play eclipsify doesn't pickup my module paths....
>

Olivier Refalo

unread,
Jan 21, 2011, 4:05:40 PM1/21/11
to play-fr...@googlegroups.com
It does .. once i stopped used the --sync flag

need to play it more to understand how it works

Guillaume Bort

unread,
Jan 23, 2011, 9:39:28 AM1/23/11
to play-fr...@googlegroups.com
The '--sync' flag only works with the 'dependencies' command. But
there is a generic '--deps' option you can use with every other
commands that will actually act as 'dependencies --sync' before
running the real command.

So you can use:

play eclipsify --deps

and it will resolve and synchronize your project dependencies before
running eclipsify.

Same for:

play run --deps
play start --deps
play test --deps

On Fri, Jan 21, 2011 at 10:05 PM, Olivier Refalo <ore...@yahoo.com> wrote:
> It does .. once i stopped used the --sync flag
> need to play it more to understand how it works
>

Reply all
Reply to author
Forward
0 new messages