branaway / japid42

A full feaured Java-based template engine for Play2
57 stars 11 forks source link

project requires publish-local #4

Closed ymasory closed 11 years ago

ymasory commented 12 years ago

Currently a publish-local is required to run the sample app. Additionally one must add a new resolver if the compilation is done with play instead of sbt since the Play configuration of sbt removes the normal deployment location.

Another approach is to use the RootProject ability in sbt that allows one project (the sample project) to rely directly on another project (the main japid42 project) even though its on GitHub and not deployed to a Mavn/Ivy repo.

After the fix for Issue #2 is merged I'd be happy to implement this myself and provide a template for Play 2 projects that want to use Japid. This will make it much easier for new users, who will only have to do this to use Japid:

$ git clone https://github.com/branaway/play2-japid-prototype
$ cd play2-japid-prototype
$ play run

It's taken me an hour to get the current sample running on my laptop. No reason anyone else should have to take that time :)

ymasory commented 12 years ago

I've ported to project layout to use typical sbt layout instead of being a play project.

$ git clone -b sbt-idiom https://github.com/ymasory/japid42.git
$ cd japid42
$ ./sbt
> compile

This way the project can be directly deployed (locally, to Sonatype, or wherever), and then pulled in automatically by a Play application by declaring it as a compile time dependency. It makes using Japid dead simple. I would be happy to continue this work if you would like Japid42 to be used like this, in addition to creating a template like mentioned above.

branaway commented 12 years ago

I like what you have described here. Please continue your work and I'd be happy to merge it back!

branaway commented 12 years ago

I was trying your code and got dependency error:

compile Getting Scala 2.9.1 ... :: retrieving :: org.scala-sbt#boot-scala confs: [default] 4 artifacts copied, 0 already retrieved (19939kB/876ms) [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile [warn] :::::::::::::::::::::::::::::::::::::::::::::: sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214) at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122) at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121) at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:114) error sbt.ResolveException: unresolved dependency: org.slf4j#slf4j-api;1.6.1: configuration not found in org.slf4j#slf4j-api;1.6.1: 'compile'. It was required from org.hibernate#hibernate-validator;4.2.0.Final compile [error] Total time: 374 s, completed 2012-10-18 16:19:13

branaway commented 11 years ago

it has been a while since I started using github as the repository for japid42.

Add something like the following to the build.scala:

val main = PlayProject(appName, appVersion, appDependencies).settings( resolvers += Resolver.url(“My GitHub Play Repository”, url(“http://branaway.github.com/releases/”))(Resolver.ivyStylePatterns) )