[2.0] Using Play from git

974 views
Skip to first unread message

Ben McCann

unread,
Dec 19, 2011, 1:03:47 AM12/19/11
to play-fr...@googlegroups.com
I cloned the git repository and built Play from source.  I'm trying to fix a couple bugs in the framework, but Play keeps using the beta version instead of the version I compiled from source.  If I run "play classpath" it shows me what .jar is being used.  If I then list that jar it shows a version from October:

$ ls -l /usr/local/users/bmccann/Play20/framework/../repository/cache/play/play_2.9.1/jars/play_2.9.1-2.0-beta.jar
-rw-rw-r-- 1 bmccann bmccann 3000689 2011-11-13 08:00 /usr/local/users/bmccann/Play20/framework/../repository/cache/play/play_2.9.1/jars/play_2.9.1-2.0-beta.jar

Any ideas on how to compile play and then run it such that it uses that version?

Thanks,
Ben

Will Sargent

unread,
Dec 19, 2011, 2:08:25 AM12/19/11
to play-fr...@googlegroups.com
It's a bit confusing, but make sure you have PLAY_HOME pointed to the version you built from source, then type "play" on the project you want.  You shouldn't be using Play20/framework at all -- the zipped up package should be in /tmp somewhere.

Will.


--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/SQKYSU92_28J.
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.

Ben McCann

unread,
Dec 19, 2011, 2:48:55 AM12/19/11
to play-fr...@googlegroups.com
Thanks for the suggestion.  Unfortunately it didn't change anything.  'Play20' is the directory I checked out from git.  Is that the directory which PLAY_HOME should point to?

I was trying to follow the instructions on the Installation wiki, but found them to be a bit confusing.  There's several commands listed there: update, compile, build-repository, and publish-local.  It's not clear which need to be run only once and which need to be run each time you change the code.  It's also not clear what order you're supposed to run them all in because the text does not seem to line up with the example.

Thanks for the help,
ben

Pascal Voitot Dev

unread,
Dec 19, 2011, 3:05:03 AM12/19/11
to play-fr...@googlegroups.com
I think some doc would be welcome :D

I succeeded to do something but i'm not sure this is the best way yet!

- I git-clone Play20
- I go in Play20/framework
- I run ./build (it opens SBT)
- I run publish-local (it compiles, packages and publishes in Play20/repository/local the 2.0-RC1-SNAPSHOT)

- Then in my project/plugins.sbt, I change/add:

libraryDependencies += "play" %% "play" % "2.0-RC1-SNAPSHOT"

addSbtPlugin("play" % "sbt-plugin" % "2.0-RC1-SNAPSHOT")

At the beginning, it couldn't find my 2.0-RC1-SNAPSHOT Jars because publish-local doesn't publish in my computer IVY repository but in Play20/repository.
So, I also added this as first resolver in plugins.sbt:

Resolver.file("Local Play Repository", file("/MY_PATH/Play20/repository/local"))( Resolver.ivyStylePatterns),

But now, for a reason I don't know yet, something has published a link to those Jars in my local Ivy and I don't need this resolver anymore...

Finally, I don't think PLAY_HOME is useful anyway... the only thing you have to put is the play script in your PATH.

Pascal

Ben McCann

unread,
Dec 19, 2011, 6:02:18 AM12/19/11
to play-fr...@googlegroups.com
Awesome.  That worked.  It'd be nice not to have to edit the project setup, but works for now.  Thanks for the help!

Pascal Voitot Dev

unread,
Dec 19, 2011, 6:04:45 AM12/19/11
to play-fr...@googlegroups.com
Was the resolver required or not?

Pascal

peter hausel

unread,
Dec 19, 2011, 8:14:51 AM12/19/11
to play-fr...@googlegroups.com
git clone https://github.com/playframework/Play20 myplayhomefolder
- add myplayhomefolder/play into your path
- cd myplayhomefolder/framework
- ./build publish-local
- the only thing you'd need in plugins.sbt afterwards is addSbtPlugin("play" % "sbt-plugin" % "2.0-RC1-SNAPSHOT")

HTH
Peter

Pascal Voitot Dev

unread,
Dec 19, 2011, 8:19:16 AM12/19/11
to play-fr...@googlegroups.com
I don't know why at first, it required me to add the resolver... I did something wrong certainly but don't know what!
anyway now I don't need it anymore

Pascal

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/IOMKPA6RNWwJ.

Ben McCann

unread,
Jan 5, 2012, 11:44:58 PM1/5/12
to play-framework
Earlier in this thread it was said that I'd need the following line to
run from git:
libraryDependencies += "play" %% "play" % "2.0-RC1-SNAPSHOT"

Is that still true? If I git pull to the latest changeset and
recompile the Play Framework my project now fails with the following
error due to the addition of that line:
play.api.UnexpectedException: Unexpected exception
[IllegalArgumentException: / is not permitted as a path segment for
this filesystem]


On Dec 19 2011, 5:19 am, Pascal Voitot Dev
<pascal.voitot....@gmail.com> wrote:
> I don't know why at first, it required me to add the resolver... I did
> something wrong certainly but don't know what!
> anyway now I don't need it anymore
>
> Pascal
>
> On Mon, Dec 19, 2011 at 2:14 PM, peter hausel <peter.hau...@gmail.com>wrote:
>
>
>
>
>
>
>
> > git clonehttps://github.com/playframework/Play20myplayhomefolder

Leon Radley

unread,
Jan 9, 2012, 2:33:32 AM1/9/12
to play-fr...@googlegroups.com
Everything is in the github wiki

Clone play2 to a directory
or do a git pull

go into framework dir

run ./build
this downloads sbt and fires it up
run these commands from the sbt console

update
compile
publish-local
build-repository

then you can exit the console with ctrl + c

I don't know if all of these commands are necessary, but it works! 

the libraryDependency is necessary otherwise the project which is a sbt project doesn't know about play.

// Leon


Pascal Voitot Dev

unread,
Jan 9, 2012, 2:39:47 AM1/9/12
to play-fr...@googlegroups.com
publish-local should run previous commands ;)
Pascal

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/Wz6ncyjG4gIJ.

Leon

unread,
Jan 9, 2012, 2:42:40 AM1/9/12
to play-fr...@googlegroups.com
What does build-repository do?

Pascal Voitot Dev

unread,
Jan 9, 2012, 2:51:50 AM1/9/12
to play-fr...@googlegroups.com
Apparently it's the task building the "repository" directory you have in your Play20 directory containing a very local ivy repository.
It must used by the "dist" command which generates a stand-alone server.

publish-local just copies all generated artifacts in your local Ivy repository (generally ~/.ivy2)

Pascal

jh

unread,
Jan 21, 2012, 1:46:13 PM1/21/12
to play-framework
There is no build-repository command in the latest github version and
I'm now getting the same error with the original poster.

On Jan 9, 9:51 am, Pascal Voitot Dev <pascal.voitot....@gmail.com>
wrote:
> Apparently it's the task building the "repository" directory you have in
> your Play20 directory containing a very local ivy repository.
> It must used by the "dist" command which generates a stand-alone server.
>
> publish-local just copies all generated artifacts in your local Ivy
> repository (generally ~/.ivy2)
>
> Pascal
>
> On Mon, Jan 9, 2012 at 8:42 AM, Leon <l...@radley.se> wrote:
> > What does build-repository do?
>
> > On Mon, Jan 9, 2012 at 8:39 AM, Pascal Voitot Dev <
> > pascal.voitot....@gmail.com> wrote:
>
> >> publish-local should run previous commands ;)
> >> Pascal
>

laguiz

unread,
Jan 22, 2012, 2:16:20 PM1/22/12
to play-framework
I did this (on windows <- yes I know.. I'm on windows and that's
bad :p) :

>cd c:
>mkdir play
>git clone git://github.com/playframework/Play20.git
>cd Play20/framework
>build publish-local
>cd ../samples/java/zentasks
>c:/play/Play20/play.bat

From here 'run' and 'eclipsify' work perfectly.

Hope this helps

laguiz

unread,
Jan 22, 2012, 2:32:21 PM1/22/12
to play-framework
Sorry first line is wrong... (this time I repeated the operation) :

>cd ../..
>mkdir play
>cd play
>git clone git://github.com/playframework/Play20.git
>cd Play20/framework
>build publish-local
>cd ../samples/java/zentasks
>c:/play/Play20/play.bat

In fact in the sample of zentasks we can see :
addSbtPlugin("play" % "sbt-plugin" % "2.0-RC1-SNAPSHOT")

We can also add play.bat in classpath in case you want to make this
version of play your default version.

GrailsDeveloper

unread,
Jan 23, 2012, 1:53:50 PM1/23/12
to play-framework
Hi are there any hints how to do this behind a proxy? Or how to set a
local maven-proxy?
At the moment I added -Dhttp.proxyHost=myproxy -Dhttp.proxyPort=3128
to the build.bat but this doesn't looks very smart.

Niels

Seb

unread,
Jan 23, 2012, 4:06:58 PM1/23/12
to play-fr...@googlegroups.com
I'd like to fetch the latest updates and continue from there, I'm doing the following:

cd $PLAY_HOME
git fetch
git checkout <insert_latest_successful_commit_here>    # currently 9ecb9010885d34b62e75d30389e62862aa117f10
cd framework
./build
> update
> compile
> publish-local

Are all of these steps required?

Thanks :)

foolshat

unread,
Jan 24, 2012, 3:33:43 AM1/24/12
to play-framework
With latest trunk and on windows I found I had to repeat the clean,
compile, publish-local and build-repository cycle a few time as the
local ivy play folder was not being updated

C:\Documents and Settings\Administrator\.ivy2\local\play

On linux this works without problem.

I can then run the sample apps, but on Windows my project which has
Play as a sub Project -this may be the problem- fails to compile with

error] {file:/C:/work/TeamCity/buildAgent/work/80d2213368062f8f/}
CallCenter/compile:sources: java.lang.NoClassDefFoundError: Could not
initialize class play.templates.ScalaTemplateCompiler$T
AsFunctionCompiler$PresentationCompiler$
error] Total time: 1 s, completed 23-Jan-2012 18:52:59

Works fine on Ubunutu. any ideas ?

Ville Hellman

unread,
Apr 7, 2012, 4:24:07 PM4/7/12
to play-fr...@googlegroups.com
If you have cloned the Play 2.0 git repository, issued the:

$ ./build
> build-repository

commands and and are using it in your PATH and created a project, worked with
it for a while and want to check for updates in the framework issuing git
pull/fetch, do you need to also reissue the:

$ ./build > build-repository

commands? https://github.com/playframework/Play20/wiki/BuildingFromSource says
nothing about this. (Nor am I far enough in my project to see for myself.)

Best regards,
Ville

Kevin Bosman

unread,
Apr 9, 2012, 7:15:27 AM4/9/12
to play-fr...@googlegroups.com
> do you need to also reissue the:
>
> $ ./build
> > build-repository
>
> commands?

Yes.

Reply all
Reply to author
Forward
0 new messages