[ANN] Riding Ruby on Rails3 with Maven3

hello,

I have to share this with you. all you need is java1.6 and maven3
installed then you should get a deployable war file with rails3
application in couple of minutes. have a look at

all kind of feedback is welcome. but I have to admit it is not tested
on windows and on macOS is should work as it is close enough to linux.

with regards
Kristian


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This looks really cool, Kristian…we’ve tweeted it on @jruby and I
tweeted it on my account as well. I regret that I haven’t had more
time to push the Maven stuff, but I was thinking again just last night
how nice it would be for Maven folks to be able to just generate a
Rails app with one command. And of course you have that working very
well.

As I have resources, I know I’ll be doing what I can to help.

On Thu, Mar 18, 2010 at 8:32 AM, kristian [email protected] wrote:

with regards
Kristian


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

2010/3/25 Reto Schüttel [email protected]:

We started to package an internal rails 2.3.5 app with maven only (i like warble, but in a more java-ish environment it just stands out too much).

That’s great, I’m glad it’s working well for you!

The following steps appear to work very well:

  • unpack /freeze all gems/rails (be sure to add rack as a gem dependency)

Perhaps kristian’s maven-installing-gems stuff might be of use here?
Ideally you’d be able to specify through maven that you need certain
gems.

kristian: Perhaps when maven installs gems it should be bundling them
into vendor or something? Just thinking out loud here, trying to find
a way to unify these two worlds more gracefully.

  • auto-generate a web.xml (using warble) and use it as usual (src/webapp/WEB-INF/web.xml)
  • add jruby-full and jruby-rack to the maven dependencies
  • use the maven-war-plugin to copy around rails & co (be sure to use 2.0.2, not the buggy 2.0 as shown in all examples and documentations)
    Â => see [1]
  • will it build? sure it will! (hopefully!)

These four steps obviously should be automated, I agree.

[1] I know this is still broken, so use it with caution

This definitely seems to be on the right track. Would the right path
be to reproduce what warbler does in a maven plugin that just reuses
maven-war-plugin and other bits?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Charlie, Kristian

Am 18.03.2010 um 18:15 schrieb Charles Oliver N.:

This looks really cool, Kristian…we’ve tweeted it on @jruby and I
tweeted it on my account as well. I regret that I haven’t had more
time to push the Maven stuff, but I was thinking again just last night
how nice it would be for Maven folks to be able to just generate a
Rails app with one command. And of course you have that working very
well.

As I have resources, I know I’ll be doing what I can to help.

We started to package an internal rails 2.3.5 app with maven only (i
like warble, but in a more java-ish environment it just stands out too
much).

The following steps appear to work very well:

  • unpack /freeze all gems/rails (be sure to add rack as a gem
    dependency)
  • auto-generate a web.xml (using warble) and use it as usual
    (src/webapp/WEB-INF/web.xml)
  • add jruby-full and jruby-rack to the maven dependencies
  • use the maven-war-plugin to copy around rails & co (be sure to use
    2.0.2, not the buggy 2.0 as shown in all examples and documentations)
    => see [1]
  • will it build? sure it will! (hopefully!)

I hope this can be further automated in the future…

Cheers
Reto

[1] I know this is still broken, so use it with caution

org.apache.maven.plugins
maven-war-plugin
2.0.2



public


.
WEB-INF

app/
config/

lib/
locale/

vendor/**



doc/tmp_structure
WEB-INF




To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

2010/3/25 Reto Schüttel [email protected]:

We started to package an internal rails 2.3.5 app with maven only (i like warble, but in a more java-ish environment it just stands out too much).

I wrote a maven plugin for rails-2.3.x:
http://github.com/mkristian/rails-maven-plugin

it does unpack the gems and freezes rails but it also copies the rails
& co around. here I like your version much better with just using the
war plugin - did not really strike me that idea.

The following steps appear to work very well:

  • unpack /freeze all gems/rails (be sure to add rack as a gem dependency)
  • auto-generate a web.xml (using warble) and use it as usual (src/webapp/WEB-INF/web.xml)
  • add jruby-full and jruby-rack to the maven dependencies
  • use the maven-war-plugin to copy around rails & co (be sure to use 2.0.2, not the buggy 2.0 as shown in all examples and documentations)
    Â => see [1]
  • will it build? sure it will! (hopefully!)

I hope this can be further automated in the future…

yes, you will find a so called partial archetype which allows to
maveninze an existing rails application:

  • puts a src/webapp/WEB-INF/web.xml in place
  • puts a pom.xml with needed dependencies in place

to merge your approach and with my plugin is actually quite simple -
maybe I take an hour tonight since I really like this using of the war
plugin :wink:

thanx for your feedback
regards Kristian

       Â
                    locale/**


To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Sat, Mar 27, 2010 at 11:40 AM, Charles Oliver N.
[email protected] wrote:

gems.
probably yes. use the gem-maven-plugin to get all your gems into
target/rubygems/gems and then tell the maven-war-plugin to copy them
into WEB-INF/gems (I hope that is the place warbler does put the
gems). but then you should not use config/environment.rb to configure
your gems - to avoid duplication.

kristian: Perhaps when maven installs gems it should be bundling them
into vendor or something? Just thinking out loud here, trying to find
a way to unify these two worlds more gracefully.

hmm, currently target/rubygems is default can be changed with a
property inside the pom.xml - target gets deleted on mvn clean which
comes for free.

but if I look at rails3 then the situation is totally different
because of bundler. maybe with the ruby flavor of maven (maven
polyglot ruby) we can use the bundler’s Gemfile somehow to fill up the
maven dependencies. let see . . .

  • auto-generate a web.xml (using warble) and use it as usual (src/webapp/WEB-INF/web.xml)
  • add jruby-full and jruby-rack to the maven dependencies
  • use the maven-war-plugin to copy around rails & co (be sure to use 2.0.2, not the buggy 2.0 as shown in all examples and documentations)
    Â => see [1]
  • will it build? sure it will! (hopefully!)

These four steps obviously should be automated, I agree.

a partial archetype should do this part for rails3 + rails2.3.x

[1] I know this is still broken, so use it with caution

This definitely seems to be on the right track. Would the right path
be to reproduce what warbler does in a maven plugin that just reuses
maven-war-plugin and other bits?

the question is what warbler is doing with bundler in rails3.

regards Kristian

  • Charlie

To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


Kristian Meier + Saumya Sharma + Sanuka Meier
Vadakkethu House,
Edayanmula West PO - 689532,
Pathanamthitta District, Kerala, INDIA

tel: +91 468 2319577

protect your privacy while searching the net: www.ixquick.com

         _=_
       q(-_-)p
        '_) (_`
        /__/  \
     _(<_   / )_
  (__\_\_|_/__)

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email