Skip to content

Conversation

@rosenfeld
Copy link
Contributor

Could you please release a new version without this verbose output?

mkristian added a commit that referenced this pull request May 22, 2012
@mkristian mkristian merged commit 8effc41 into jruby:master May 22, 2012
@mkristian
Copy link
Member

I am about to get a new release ready with indirectly adding packing of executable jars, packing of warfiles for rails. I hope you can wait a day or two for that release.

@rosenfeld
Copy link
Contributor Author

I can wait an eternity as I'm not using JRuby in the moment ;)

I was just trying to help others wanting to use it now :) See this:

rubygems/bundler#1683 (comment)

But I'm not sure if packing of war should belong to jbundler. Shouldn't it remain a concern of warbler?

@mkristian
Copy link
Member

war packaging and jetty execution and pack an executable jar is part
of ruby-maven and jbundler has is as dependency. so it comes for
"free".

I hope I get things released today.

@rosenfeld
Copy link
Contributor Author

Why are they dependencies of ruby-maven?

@rosenfeld
Copy link
Contributor Author

I think things should be more isolated from each other. ruby-maven does too many things for a single gem. So will do jbundler after the changes you're planning...

@mkristian
Copy link
Member

OK. let's start. there will be a maven-tools gem which is used by the
jruby-maven-plugins,as well jbundler and ruby-maven.

jruby-maven-plugins allows to manage gem artifacts with maven and also
any rails project or gem project.

ruby-maven is needed by jbundler so the right version of maven is
installed and used. for example current jbundler does not work with
maven-3.0.4 and the next version will not work with maven-3.0.3 since
the aether jar files changed including their API.

ruby-maven gives the same CLI as maven and on top of that is can use a
Gemfile as maven DSL, or gemspec as maven DSL, i.e. you can just go in
a rails application there and execute "rmvn package" which packs a war
file using Gemfile and now Jarfile (from jbundler). all ruby-maven
does is to generate a .pom.xml out of the Gemfile and/or Jarfile
and/or Mavenfile and execute maven with that. the .pom.xml uses the
jruby-maven-plugins to accomplish all the needed tasks.

whether the transformation of Gemfile to pom.xml inside a rails
application is doing TOO much or not, I do not know. but it is nice to
just go to rails directory and execute "rmvn jetty:run" and it will
start jetty in development mode.

I exclusively use it for my projects but there I do use
gwt-maven-plugin on top of it, so I get the GWT development shell and
using jruby to run the rails server. the rails api server is the json
backend for a GWT application. and here the pom.xml generated by
ruby-maven is used by eclipse as project descriptor which allows me to
start an eclipse project for the GWT code out of the box.

but once you compiled the GWT code into javascript you just can use
bundler/jbundler to start your rails server with "rails s" or even
pack it with warbler if desired.

Gemfile for gems
Jarfile for jars
Mavenfile for maven plugin configurations

so far things work quite seamless. bundler is happy with the gem
version resolution of maven. maven is happy with Gemfile.lock. depends
which one is used first. similar thing with jbundler but a little
different.

jbundler could pack its own set of jars basically being ruby-maven
without the 'rmvn' CLI + a handful of jbundler files. but I feel to
reuse the jars from ruby-maven is the better way to go.

but from your reaction I will not mention jetty, warfile in relation
to jbundler and keep it with ruby-maven ;-)

@rosenfeld
Copy link
Contributor Author

ruby-maven is needed by jbundler so the right version of maven is
installed and used. for example current jbundler does not work with
maven-3.0.4 and the next version will not work with maven-3.0.3 since
the aether jar files changed including their API.

So I guess your gem won't try to use the system Maven, right? I'm saying
this because my current Maven is 3.0.4 and your current gem version
worked for me in this project:

https://github.com/rosenfeld/sample-jbundler

ruby-maven gives the same CLI as maven and on top of that is can use a
Gemfile as maven DSL, or gemspec as maven DSL, i.e. you can just go in
a rails application there and execute "rmvn package" which packs a war
file using Gemfile and now Jarfile (from jbundler). all ruby-maven
does is to generate a .pom.xml out of the Gemfile and/or Jarfile
and/or Mavenfile and execute maven with that. the .pom.xml uses the
jruby-maven-plugins to accomplish all the needed tasks.

But I still didn't get why ruby-maven also add support for "rmvn
package". How is that implemented?

whether the transformation of Gemfile to pom.xml inside a rails
application is doing TOO much or not, I do not know. but it is nice to
just go to rails directory and execute "rmvn jetty:run" and it will
start jetty in development mode.

Yeah, this is superb. Please don't get me wrong, I don't want to lose
this feature. I just feel that this should belong to a separate gem,
isolating the concerns.

I exclusively use it for my projects but there I do use
gwt-maven-plugin on top of it, so I get the GWT development shell and
using jruby to run the rails server. the rails api server is the json
backend for a GWT application. and here the pom.xml generated by
ruby-maven is used by eclipse as project descriptor which allows me to
start an eclipse project for the GWT code out of the box.

Okay, now I see why you bundled all that together. May I suggest that
you implement some API in the jbundler gem so that you could register
other gems to customize the pom.xml generation to their needs?

This way you could have a separate gem for running on Jetty, another for
embedded Tomcat, another for GWT and so on...

Both of them are completely separate concerns from the Maven integration
itself, in the sense that jbundler should only enable the specified jars
to be required on Bundler.setup.

I mean, all of those gems would be extremely useful, but I think they
would be better served as separate gems.

but once you compiled the GWT code into javascript you just can use
bundler/jbundler to start your rails server with "rails s" or even
pack it with warbler if desired.

Gemfile for gems
Jarfile for jars
Mavenfile for maven plugin configurations

so far things work quite seamless. bundler is happy with the gem
version resolution of maven. maven is happy with Gemfile.lock. depends
which one is used first. similar thing with jbundler but a little
different.

jbundler could pack its own set of jars basically being ruby-maven
without the 'rmvn' CLI + a handful of jbundler files. but I feel to
reuse the jars from ruby-maven is the better way to go.

What I'm proposing will still allow you to reuse them.

but from your reaction I will not mention jetty, warfile in relation
to jbundler and keep it with ruby-maven ;-)

You have been doing an awesome work, but I guess the community will be
more likely to help you with this project once it is split in separate
gems/concerns.

Thank you a lot for your tireless work on all this integration :)

They're most appreciated.

@mkristian
Copy link
Member

On Tue, May 22, 2012 at 7:35 PM, Rodrigo Rosenfeld Rosas
[email protected]
wrote:

ruby-maven is needed by jbundler so the right version of maven is
installed and used. for example current jbundler does not work with
maven-3.0.4 and the next version will not work with maven-3.0.3 since
the aether jar files changed including their API.

So I guess your gem won't try to use the system Maven, right?

that was/is error prone and it much saver to use the right maven
version via ruby-maven via (= 3.0.4 dependency)

I'm saying
this because my current Maven is 3.0.4 and your current gem version
worked for me in this project:

https://github.com/rosenfeld/sample-jbundler

ruby-maven gives the same CLI as maven and on top of that is can use a
Gemfile as maven DSL, or gemspec as maven DSL, i.e. you can just go in
a rails application there and execute "rmvn package" which packs a war
file using Gemfile and now Jarfile (from jbundler). all ruby-maven
does is to generate a .pom.xml out of the Gemfile and/or Jarfile
and/or Mavenfile and execute maven with that. the .pom.xml uses the
jruby-maven-plugins to accomplish all the needed tasks.

But I still didn't get why ruby-maven also add support for "rmvn
package". How is that implemented?

well actually ruby-maven just uses the pom-generator from maven-tools
to generate a pom.xml and then "mvn package" gets executed.

whether the transformation of Gemfile to pom.xml inside a rails
application is doing TOO much or not, I do not know. but it is nice to
just go to rails directory and execute "rmvn jetty:run" and it will
start jetty in development mode.

Yeah, this is superb. Please don't get me wrong, I don't want to lose
this feature. I just feel that this should belong to a separate gem,
isolating the concerns.

I exclusively use it for my projects but there I do use
gwt-maven-plugin on top of it, so I get the GWT development shell and
using jruby to run the rails server. the rails api server is the json
backend for a GWT application. and here the pom.xml generated by
ruby-maven is used by eclipse as project descriptor which allows me to
start an eclipse project for the GWT code out of the box.

Okay, now I see why you bundled all that together. May I suggest that
you implement some API in the jbundler gem so that you could register
other gems to customize the pom.xml generation to their needs?

jbundler only does handle Jarfile/Jarfile.lock/.jbundler/classpath.rb.
it uses the jars from ruby-maven and some modules from maven-tools
gem.

the maven-tools files are coming from the ruby-tools jar which is part
of the jruby-maven-plugins. for the first jbundler version I just
copied and pasted a few files from there and added the aether support.
so moving the ruby files from ruby-tools jar to a gem is what I am
doing right now. this maven-tools does know how to add pom
configuration for jetty and how to transform a Gemfile to pom or
gemspec to pom and now also how to transform Jarfile to pom.

I have to admit that I am hesitant to set up a gem with only two or
three ruby files in it. so boundaries are blurred with ruby-maven.
right now I am shifting things around, little steps at a time - let's
see if I can get things separated in the long run.

in the moment I would like to get the jruby-maven-plugins released to
version 1.0 and hopefully around the time when jruby-1.7.0 gets it
final release.

big thanx for all the mental input and that you indeed take your time
to try to understand what I am doing :)

@rosenfeld
Copy link
Contributor Author

No problem about that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants