Using Maven with Play Source + other thoughts

348 views
Skip to first unread message

orefalo

unread,
Nov 16, 2010, 9:58:14 AM11/16/10
to play-framework
Ok, I started getting my hands dirty with the Play code. So here comes
my list of techie questions:

First a simple one: what about using H2 (http://www.h2database.com/
html/main.html) rather than hypersonic ? H2 is a more mature embedded
db and is written by the original author behind hypersonic. If people
decide to deploy with an embedded db, give them at least a good one.


Second, I see that you have a hierarchy of RuntimeExceptions across
the framework, My understanding is that you picked this type to ease
the use of the framework, right ?
If this is correct, the issue then comes from the javadoc. It should
be referenced somewhere that a given method may raise a certain type
of exception.


Last but not least, Maven. There is one cool thing about openejb
(among other things) - I just need to add 4 lines of xml in my pom.xml
- and the whole openejb container is at my disposal for building and
testing applications. Shouldn't the same apply to Play?
Maven is not only convenient to get the bundles and dependents. It
also makes it easy to switch library versions. it's as simple as
updating a version number.
So what would it take to build Play src with maven ? high level.. a
rework of the ant build.xml, the creation of a pom file and a public
maven repository (like artifactory: http://www.jfrog.org/products.php)
What is your thought ?

Olivier

PS: I volunteer for #1 and #3 - but only if my work gets committed at
some point

Play Freek

unread,
Nov 16, 2010, 12:21:03 PM11/16/10
to play-framework
I personally want to have Maven support by default. Unfortunately Play
didn't have the support OOTB.

- Freek

GrailsDeveloper

unread,
Nov 16, 2010, 1:16:05 PM11/16/10
to play-framework
h2 is a nice idea. I used it in a project and I think it's very nice.
In our company we use very often derby too. The main reason is, that
it is more compatible with DB2, so your test-environment is better.

Better javadoc will always be good ;-)

I can't see any advantages on building with Maven. Ant is part of
eclipse so I don't need an extra plugin, checkout with git or bzr is
quite simple and then you have all you need. If you use Maven you must
make sure that git/bzr works behind a firewall and that Maven works
behind the firewall, so it look more inconvenient to me.

Niels

Erwan Loisant

unread,
Nov 16, 2010, 1:54:23 PM11/16/10
to play-fr...@googlegroups.com
Hi,

On Tue, Nov 16, 2010 at 15:58, orefalo <ore...@yahoo.com> wrote:
> Second, I see that you have a hierarchy of RuntimeExceptions across
> the framework, My understanding is that you picked this type to ease
> the use of the framework, right ?
> If this is correct, the issue then comes from the javadoc. It should
> be referenced somewhere that a given method may raise a certain type
> of exception.

Basically we don't think checked exceptions are a good idea, for the
same reason Scala doesn't have checked exceptions and wrap them into
RuntimeExceptions. You have the case where you have code that you
*know* never throws but the compiler wants you to handle the exception
(like when you pass utf-8 but you need to handle the
UnsupportedEncodingException). There is also the case where developers
don't know what to do with the exception and just leave a try with an
empty catch. The exception is lost and debugging is hard.

So we prefer RuntimeException, and the developer only catches it if
needed. When it happens, it bubbles up to the controller.
* In dev mode: the exception is visible in the browser
* In prod mode: a 500 error is thrown, and the exception is logged

But yes, there are cases it could be good to document in the javadoc.


--
Erwan Loisant

orefalo

unread,
Nov 16, 2010, 1:59:01 PM11/16/10
to play-framework
Neils,

There are two sides to Maven

1. What I am talking about: enhancing the play framework src (the fw
source itself) so that the packages can be deployed to a maven
repository. The whole open source industry is doing so.

2. and I believe that's what you are talking about, getting the
projects to use maven for compilation.
This can be achieve with this plugin https://github.com/wangyizhuo/play-maven
, but if you read the instruction, you will notice that you need to
manually deploy play 1.1 in a maven repository -> hence #1

As far as liking of not liking maven, I personally enjoy dependency
management and auto jar downloading, two features not provided by ant
which is only a build system.

Olivier


On Nov 16, 1:16 pm, GrailsDeveloper <opensourc...@googlemail.com>
wrote:

GrailsDeveloper

unread,
Nov 16, 2010, 2:46:35 PM11/16/10
to play-framework
No I'm talking about compiling the framework, not any projects on it.
I don't see the advantage, only see that it can become more
complicated if I need to download many jars with maven just to compile
the source.
But anyway for me it's not an important point, let Guillaume decide
this.
I just want to give you some aspects which could be a problem.
Niels

On 16 Nov., 19:59, orefalo <oref...@yahoo.com> wrote:
> Neils,
>
> There are two sides to Maven
>
> 1. What I am talking about: enhancing the play framework src (the fw
> source itself) so that the packages can be deployed to a maven
> repository. The whole open source industry is doing so.
>
> 2. and I believe that's what you are talking about, getting the
> projects to use maven for compilation.
>   This can be achieve with this pluginhttps://github.com/wangyizhuo/play-maven

orefalo

unread,
Nov 16, 2010, 3:10:23 PM11/16/10
to play-framework
Got it, for info maven comes standard with OSX

On Nov 16, 2:46 pm, GrailsDeveloper <opensourc...@googlemail.com>
wrote:

Per Wiklander

unread,
Nov 16, 2010, 8:21:32 PM11/16/10
to play-framework
My Play! web project is only one out of five maven modules in a larger
"enterprise" project. With the other parts I can just do a "mvn
install" in the root project to build and test all sub modules. The
Play! web projects is the ugly duckling in my setup... but so
beautiful in all other regards. I understand the want to keep Play!
simple for smaller projects, but it would be great to be able to use
it together with maven.

I don't care if Play! itself is built with maven or ant, I just want
Play! in a maven repos somewhere (central would be nice) and a maven
plugin to build and test my Play! project.

orefalo

unread,
Nov 16, 2010, 11:14:23 PM11/16/10
to play-framework
I share the pain,

add this to your pom.xml
<repository>
<id>www.crionics.com</id>
<name>www.crionics.com-releases</name>
<url>http://www.crionics.com:10000/artifactory/libs-release-
local</url>
</repository>


then follow the directions at https://github.com/wangyizhuo/play-maven

I haven't tried myself... working on it.

Olivier

Pascal Voitot Dev

unread,
Nov 17, 2010, 6:05:09 AM11/17/10
to play-fr...@googlegroups.com
Anyone tried to use Ivy instead of Maven?
I use maven everyday and I know how much it can be useful and sometimes ugly and driving me crazy :)

Just for my personal understanding, I have few questions:
what do you need exactly as you don't really care if play is build with maven or not?
- Would you like your Play projects to be a Maven project ?
- Would you like to be able to create a play project from a maven archetype?
- Would you like to get play core libs from a repo?
- What kind of plugin do you expect ? a plugin that launches "play run" for example from Maven? what goals would you call?

I like play as it is simple but I know people from industry loves maven now (after year of reluctance) so I'm just trying to see pros and cons, to know if it could useful and worth enough to get a glance!

Pascal

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


orefalo

unread,
Nov 17, 2010, 10:41:09 AM11/17/10
to play-framework

Don't know much about Ivy, but Maven seem to have more momentum at
this point

> what do you need exactly as you don't really care if play is build with
> maven or not?
I don't care if Play is built with maven or not.
However, along with maven typically comes continuous integrations. So
having play built with maven means that we will get access to the
latest daily snapshots easily. as long as I can get automatic
deployment from a maven repository, I am happy.

> - Would you like your Play projects to be a Maven project ?
Yes, a must have. I share my play projects across cpu, it's a pain to
rework the classpath every time.
Also, It would make it easy to test with other versions of the
libraries > say hibernate 3.6

> - Would you like to be able to create a play project from a maven archetype?
I am good with pay new but it would make sense to build a full maven
integration..

> - Would you like to get play core libs from a repo?
a must have is you read my previous answers.


Olivier


On Nov 17, 6:05 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> Anyone tried to use Ivy instead of Maven?
> I use maven everyday and I know how much it can be useful and sometimes ugly
> and driving me crazy :)
>
> Just for my personal understanding, I have few questions:
> what do you need exactly as you don't really care if play is build with
> maven or not?
> - Would you like your Play projects to be a Maven project ?
> - Would you like to be able to create a play project from a maven archetype?
> - Would you like to get play core libs from a repo?
> - What kind of plugin do you expect ? a plugin that launches "play run" for
> example from Maven? what goals would you call?
>
> I like play as it is simple but I know people from industry loves maven now
> (after year of reluctance) so I'm just trying to see pros and cons, to know
> if it could useful and worth enough to get a glance!
>
> Pascal
>
>
>
>
>
>
>
> On Wed, Nov 17, 2010 at 5:14 AM, orefalo <oref...@yahoo.com> wrote:
> > I share the pain,
>
> > add this to your pom.xml
> > <repository>
> >        <id>www.crionics.com</id>
> >        <name>www.crionics.com-releases</name>
> >        <url>http://www.crionics.com:10000/artifactory/libs-release-
> > local</url>
> >    </repository>
>
> > then follow the directions athttps://github.com/wangyizhuo/play-maven
>
> > I haven't tried myself... working on it.
>
> > Olivier
>
> > On Nov 16, 8:21 pm, Per Wiklander <p...@wiklander.biz> wrote:
> > > My Play! web project is only one out of five maven modules in a larger
> > > "enterprise" project. With the other parts I can just do a "mvn
> > > install" in the root project to build and test all sub modules. The
> > > Play! web projects is the ugly duckling in my setup... but so
> > > beautiful in all other regards. I understand the want to keep Play!
> > > simple for smaller projects, but it would be great to be able to use
> > > it together with maven.
>
> > > I don't care if Play! itself is built with maven or ant, I just want
> > > Play! in a maven repos somewhere (central would be nice) and a maven
> > > plugin to build and test my Play! project.
>
> > --
> > 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<play-framework%2Bunsubscribe@go oglegroups.com>
> > .

Pascal Voitot Dev

unread,
Nov 17, 2010, 11:03:20 AM11/17/10
to play-fr...@googlegroups.com
On Wed, Nov 17, 2010 at 4:41 PM, orefalo <ore...@yahoo.com> wrote:

Don't know much about Ivy, but Maven seem to have more momentum at
this point


It is a kind maven for ant :)
so you can use maven deps from ant with Ivy... I know some people that switched from maven to ivy just to use maven repos without the problems of maven (such as crazy transitive deps or buggy maven plugins that are rarely mature and brings more problems that solutions)


 
> what do you need exactly as you don't really care if play is build with
> maven or not?
I don't care if Play is built with maven or not.
However, along with maven typically comes continuous integrations. So
having play built with maven means that we will get access to the
latest daily snapshots easily. as long as I can get automatic
deployment from a maven repository, I am happy.


afaik continuous integration doesn't require maven to manage snapshots: you can script your continuous integration without maven to checkout any trunk code and even compile anything you require...
anyway, I see your point when all your projects are integrated with maven!
at least, it could be nice to have a maven plugin launching Play at test phase and launch tests written with Junit or selenium...
 
> - Would you like your Play projects to be a Maven project ?
Yes, a must have. I share my play projects across cpu, it's a pain to
rework the classpath every time.
Also, It would make it easy to test with other versions of the
libraries > say hibernate 3.6

> - Would you like to be able to create a play project from a maven archetype?
I am good with pay new but it would make sense to build a full maven
integration..

> - Would you like to get play core libs from a repo?
a must have is you read my previous answers.


I wonder if we could "mavenize" play without modifying the original version which is simple and perfect for many people (mavenization is sthg I've done several times for other stuff not built on maven by default and I even succeeded to make the transformation near automatic sometimes)
Maven brings lots of constraints and requires people to have at least a basic knowledge of maven... I also wouldn't like to make Play! a maven horror as I can see sometimes. Moreover, I don't think everyone requires maven...

let's think about this to see what could be done...

Pascal

To unsubscribe from this group, send email to play-framewor...@googlegroups.com.

orefalo

unread,
Nov 17, 2010, 11:19:08 AM11/17/10
to play-framework
Maven's is not complex, it's just hard to find a good tutorial.
But once you get it.. it's really convenient. -> i shouldn't be an
issue for anyone who learned Play! ;-)

Olivier

On Nov 17, 11:03 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Jean-Philippe Briend

unread,
Nov 17, 2010, 11:21:38 AM11/17/10
to play-framework
Speaking about launching unit, functional and Selenium tests via
Maven, I'm working on it.

I made the changes in the play-maven module committed last week.
I already have implemented an ant target launched by maven during
package target to make a Play! war just using 'mvn package'.

Our next step is to add an ant target to launch 'play auto-test'
during a 'mvn test'.

When this will be completed, the play-maven plugin will allow a Play!
application to be integrated in any CI system.

I agree : play.jar and specific librairies should ne available on a
Maven repo.
For the moment, I have put them on my company's Nexus repo (publicly
available and my repo is the one configured in the play-maven plugin)
but maybe something more official could help.

Jean-Philippe.

On Nov 17, 5:03 pm, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:

Guillaume Bort

unread,
Nov 17, 2010, 12:22:17 PM11/17/10
to play-fr...@googlegroups.com
Hi,

Sorry for the late response.

I've nothing against H2 but HSQL works perfectly and I don't think
there will be any added value to change it.
Anyway if you wan't to use H2 in production you already can.

About Maven, I understand the need to have solution to integrate a
Play application into an existing Maven software factory, but about
building Play itself with Maven I don't see any value. The whole build
run in 2seconds on my computer and I'm totally happy with that. I
don't want to switch to a more complicated setup. Especially since we
have some python integration to do and it will be probably a pain to
do that with Maven.

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

Pascal Voitot Dev

unread,
Nov 17, 2010, 12:50:55 PM11/17/10
to play-fr...@googlegroups.com
On Wed, Nov 17, 2010 at 6:22 PM, Guillaume Bort <guillau...@gmail.com> wrote:
Hi,

Sorry for the late response.

I've nothing against H2 but HSQL works perfectly and I don't think
there will be any added value to change it.
Anyway if you wan't to use H2 in production you already can.

About Maven, I understand the need to have solution to integrate a
Play application into an existing Maven software factory, but about
building Play itself with Maven I don't see any value. The whole build
run in 2seconds on my computer and I'm totally happy with that. I
don't want to switch to a more complicated setup. Especially since we
have some python integration to do and it will be probably a pain to
do that with Maven.


I agree... play must stay as simple as possible...
I think integrating play with maven can be done independently of maven for people who need it.
putting libs in maven repo also...

Pascal
 

GrailsDeveloper

unread,
Nov 17, 2010, 1:12:32 PM11/17/10
to play-framework
Hi

On 17 Nov., 18:22, Guillaume Bort <guillaume.b...@gmail.com> wrote:
> Hi,
>
> Sorry for the late response.
>
> I've nothing against H2 but HSQL works perfectly and I don't think
> there will be any added value to change it.

Well it has an added value. H2 can be compatible to most existing
databases see http://www.h2database.com/html/features.html. So if you
develop for oracle or db2(Unix not Host) you can test it with h2. With
hsql you get sometimes problems, that it didn't work, even if it work
with oracle. So it's not a show stopper because you can change it, but
it would be more convenient and make play more a full application
stack (specially because you can use it in production).

Niels

orefalo

unread,
Nov 17, 2010, 3:38:37 PM11/17/10
to play-framework
I am fine with having integration with Maven, like a "play mavenify"
which will create a pom.xml pointing at a repository located on
playframework.org
I am just hopping we will get daily snapshot builds as well.

As far as H2, I am just like Neil - I think it would be a much more
stable db - if someone wants to use a embedded db, rather drive them
to something great.



On Nov 17, 1:12 pm, GrailsDeveloper <opensourc...@googlemail.com>
wrote:
> Hi
>
> On 17 Nov., 18:22, Guillaume Bort <guillaume.b...@gmail.com> wrote:
>
> > Hi,
>
> > Sorry for the late response.
>
> > I've nothing against H2 but HSQL works perfectly and I don't think
> > there will be any added value to change it.
>
> Well it has an added value. H2 can be compatible to most existing
> databases seehttp://www.h2database.com/html/features.html. So if you

wyz

unread,
Nov 17, 2010, 9:58:19 PM11/17/10
to play-framework
I have suggested the same thing earlier,
http://groups.google.com/group/play-framework/browse_thread/thread/702a023309f2beee/.

Realizing Maven will not be integrated with Play, I created maven
module to meet my need, to manage dependency without conflicting with
play's its own libraries.

After the module is released, I get feedback and help from other
users, and clearly my need is not the only use case for this module.
One use case is to use maven module to do compile / package, which the
module is incapable of until Jean-Philippe's commits (and likely
borken by me).

I think it is time to decide what maven module should achieve, and
what is out of its scope. So we can work towards the same goal.

Thanks
Wang Yizhuo

Guillaume Bort

unread,
Nov 18, 2010, 4:41:47 AM11/18/10
to play-fr...@googlegroups.com
Perhaps we will H2 later, but only for a major release.

About Maven I don't have enough experience. 'play mavenify' would be
great if it's totally optional.

Reply all
Reply to author
Forward
0 new messages