Closed ddossot closed 10 years ago
could you past the output when adding -Djruby.verbose to the commandline ?
is there any specific setup in your pom.xml regarding rvm ?
somehow the gem-maven-plugin picks up some setup of rvm like /home/ddossot/.rvm/gems/jruby-1.7.9/bin/jruby_executable_hooks which it really should not.
another thing is rmvn via rvm ;)
if you have Mavenfile or pom.rb could you add properties( 'tesla.dump.pom' => 'pom-test.xml', 'tesla.dump.readonly' => true )
and see what happens when you execute it with proper maven
$ mvn -f pom-test.xml
does this produce the same error ?
so basically there is rvm involved and rmvn and gem-maven-plugin and it would be great if you could help me to figure out which part can be excluded from the equation ;)
but I guess you configured rvm to use jruby-1.7.9 and the problem is related to rvm and those bin/jruby_executable_hooks. anyways that is just a guess from remote.
I'm closing this as an unfortunate PEBCAK and apologize for it.
I had attempted getting the gems with bundler instead of fully relying on gem-maven-plugin to do it. After removing the Gemfile.lock that bundler created, rmvn clean package
triggers gem-maven-plugin
correctly and all the gems are placed in target/rubygems
(even the test
scoped ones, I still need to find out a way to only bring the runtime/compile
scoped gems, but that's another story).
Thank you very much for your support.
@ddossot yes that is something which really needs a fix soon that all scoped gems into the 'same' repo. if you add the gems to a plugin, i.e. minitest-maven-plugin then those gems go already into a plugin-only repo (the gem-path will also have the regulare gems).
so I was thinking that scoped gems with provided and test will go into target/rubygems-test target/rubygems-provided respectively and compile+runtime into target/rubygems that way it is easy to pack only the compile+runtime gems into the jar and leave the other out.
please let me know if that would help in your situation !!
That would help tremendously.
To give you an idea, for projects where I use pure Maven, I put all the test gems in a specific profile that I activate when I want to run specs. This profile also defines gemHome
/gemPath
to point to ${project.build.directory}/rspec-rubygems
, which is conceptually the same as the target/rubygems-test
directory you're proposing.
So a big +1 to have target/rubygems-test
supported OOTB :smile:
yes, I did something similar in projects of mine to separate the test gems. I just pushed a new snapshot to
https://oss.sonatype.org/content/repositories/snapshots/de/saumya/mojo/jruby-maven-plugins/
which will have that separation of gems via scope. in case you find time to check it out and see if it works for you that would be really helpful. it is time to release version 1.0.0 of the plugins (and time to to get to start 2.0.0 with removed garbage).
Success :)
[INFO] installing gems for compile scope . . . [INFO] Successfully installed grape-0.7.0 [INFO] Successfully installed rack-1.5.2 [INFO] Successfully installed rack-accept-0.4.5 [INFO] Successfully installed activesupport-4.1.0 [INFO] Successfully installed i18n-0.6.9 [INFO] Successfully installed json-1.8.1-java [INFO] Successfully installed tzinfo-1.1.0 [INFO] Successfully installed minitest-5.3.3 [INFO] Successfully installed thread_safe-0.3.3-java [INFO] Successfully installed multi_json-1.9.2 [INFO] Successfully installed multi_xml-0.5.5 [INFO] Successfully installed hashie-2.1.1 [INFO] Successfully installed virtus-1.0.2 [INFO] Successfully installed descendants_tracker-0.0.4 [INFO] Successfully installed equalizer-0.0.9 [INFO] Successfully installed coercible-1.0.0 [INFO] Successfully installed axiom-types-0.1.1 [INFO] Successfully installed ice_nine-0.11.0 [INFO] Successfully installed builder-3.2.2 [INFO] Successfully installed rack-mount-0.8.3 [INFO] Successfully installed deep_merge-1.0.1 [INFO] 21 gems installed [INFO] installing gems for runtime scope . . . [INFO] installing gems for provided scope . . . [INFO] installing gems for test scope . . . [INFO] Successfully installed a-0.1.1 [INFO] 1 gem installed
Thanks a lot :+1:
Using
rmvn
andgem-maven-plugin
, I get an NPE when packaging my application.The reason is that
new File(this.config.getGemHome(), "specifications")
returnsnull
becausetarget/rubygems/
doesn't exist.