Forum: JRuby maven_gemify.rb can't find ruby-maven?

Posted by Robin Salkeld (robinsalkeld)
on 2012-08-03 22:51
Hello all,

I'm not sure if this is actually a bug or my misunderstanding of the
feature. I'm trying to use the maven_gemify.rb code ("borrowing" some of
the in-process integration with Maven to do some cool stuff, actually ;)
and I had thought that the code intended to automatically use the
ruby-maven gem if it was installed. However, I just get the "can not
find maven3 installation. install ruby-maven with..." error.

Looking at the code it looks like you still have to add the bin
directory of the ruby-maven gem to your PATH for it to be detected. Is
that intentional? If so I'm not sure why the code looks for the gem in
the first place since it also has a "mvn" binary and works perfectly
well as a regular Maven installation.

If nothing else the error message is deceptive since just installing the
gem won't resolve the issue by itself.

Cheers,
Robin
Posted by kristian (Guest)
on 2012-08-03 23:27
(Received via mailing list)
hi,

the next incarnation of maven_gemify.rb is
https://github.com/mkristian/jbundler - not exactly a replacement . .
.

but anyways jbundler uses the jars from ruby-maven to do ts stuff and
does not fall back on a maven install since the internal jars supplied
by maven3.0.x are not all binary compatible to each other.

maybe jbundler is a better starting point for you !?

- Kristian
Posted by Robin Salkeld (robinsalkeld)
on 2012-08-11 00:16
kristian wrote in post #1071230:
> hi,
>
> the next incarnation of maven_gemify.rb is
> https://github.com/mkristian/jbundler - not exactly a replacement . .
> .
>
> but anyways jbundler uses the jars from ruby-maven to do ts stuff and
> does not fall back on a maven install since the internal jars supplied
> by maven3.0.x are not all binary compatible to each other.
>
> maybe jbundler is a better starting point for you !?
>
> - Kristian

Interesting, although not as useful for my case as I'm trying to 
leverage the code in maven_gemify.rb that launches Maven in-proc, rather 
than shelling out. Thanks for the tip though!

Robin
Posted by kristian (Guest)
on 2012-08-11 08:33
(Received via mailing list)
On Sat, Aug 11, 2012 at 3:46 AM, Robin Salkeld <lists@ruby-forum.com> 
wrote:
> launches Maven in-proc

OK - one more trial :)

maybe ruby-maven gem is helpful ?

require 'ruby-maven'
rmvn = Maven::RubyMaven.new
rmvn.exec_in('/my-project', 'install')

this works both with jruby as well MRI. MRI launches 'java' and jruby
it will launch it directly inside the same JVM (in the similar manner
as maven_gemify)

regards,
Kristian
Posted by kristian (Guest)
on 2012-08-11 10:15
(Received via mailing list)
you also need before executing maven.

  mvn.options['-f'] = 'pom.xml'

a flaw in the API :(

- Kristian
Posted by kristian (Guest)
on 2012-08-13 05:38
(Received via mailing list)
after writing the last email I realized that I did things were not as
I remembered them to be and altogether the gem was not useful for
others. so I straighten things a bit and also made sure when running
on jruby maven will execute on the same JVM. overall the code is
cleaner and more straightforward then what I did in maven_gemify.rb.

https://github.com/mkristian/ruby-maven

regards,
Kristian
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.