Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Depending on internal dependencies #7

amaltson opened this Issue · 16 comments

3 participants


I'm trying to depend on some internal JARs inside our company, and I've added the internal repository to my Mvnfile, which looks something like this:

repository 'http://internal-repository/url'
jar 'groupId:artifactId', '2.3.5'

bundle install works fine, but when I bundle exec <ruby file>, I get the following:

$ bundle exec <ruby file>
artifact downloaded: internal_dependency:pom:2.3.5
downloading http://internal-repository/url
artifact downloaded: internal_dependency:pom:2.3.5
NativeException: org.sonatype.aether.collection.DependencyCollectionException: Failed to collect dependencies for [internal_dependency:jar:2.3.5 (compile)]
  resolve at /home/arthur/.rvm/gems/jruby-1.6.7/gems/jbundler-0.0.1/lib/jbundler/aether.rb:84
   (root) at /home/arthur/.rvm/gems/jruby-1.6.7/gems/jbundler-0.0.1/lib/jbundler.rb:19
  require at org/jruby/
  require at /home/arthur/.rvm/gems/jruby-1.6.7/gems/jbundler-0.0.1/lib/jbundler.rb:68
     each at org/jruby/
  require at /home/arthur/.rvm/gems/jruby-1.6.7@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:66
     each at org/jruby/
  require at /home/arthur/.rvm/gems/jruby-1.6.7@global/gems/bundler-1.1.3/lib/bundler/runtime.rb:55
  require at /home/arthur/.rvm/gems/jruby-1.6.7@global/gems/bundler-1.1.3/lib/bundler.rb:119
   (root) at call-cews.rb:1

But I can depend on that dependency in Maven fine. I'm also able to install it using maven_gem.

$ gem install mvn:groupId:artifactId --version '=2.3.5'
Successfully installed mvn:groupId:artifactId-2.3.5-java
1 gem installed

Do you know why aether is failing to resolve the dependency? Looking at the source code it looked like putting in the repository line should work.


Just out of curiosity: have you tried adding your custom Nexus server URLs to your ~/.m2/settings.xml?

Something like this:


From here, it seems your syntax is wrong:

Try something like this:

repository :internal, 'http://internal-repository/url'

I'm not sure what was the code intention of this:

But this is the effect (try on irb):

line = "repository 'http://internal-repository/url'"
name, url = line.sub(/.*(repository|source)\s+/, '').gsub(/['":]/,'').split(/,/)

After that url is nil and name is "http//internal-repository/url"

Notice that gsub will remove the colon :)


@rosenfeld sounds like that would be the culprit, it's probably the gsub.... I'll try it tomorrow morning and see if I can get it working. I'll also give the :internal a try. Thanks!


No problem, good luck :)


I pushed a fix - and added that case to specs :)

thanx for reporting and finding the problematic code

@mkristian mkristian closed this

if it works for you I happy to push a bug fixed gem. the next release is in making but I need a day or two more


Maybe creating a DSL wouldn't be that hard:

There are lots of malformed Mvnfile possibilities that would be hard to track with your current approach and regular expressions. I guess it would be easier to support a DSL and let Ruby help you with the parser :)


@mkristian sorry, newbie question since I'm fairly new to this stuff.. how can I build a jbundler gem from source and then use it in my app that's using bundler? I'd love to test out the code changes.


@mkristian thanks again! I appreciate all the help. I'm running into issues when running rmvn prepare-package. It's passing the minitest tests but failing on the cucumber tests. Here's a Gist:


@mkristian thanks, got that working (also sent a pull request to skip the tests). However, I'm still getting this issue. The URL for the internal dependency is correct, I can see the POM file that Aether is downloading. However, that stacktrace isn't telling me where Aether is failing to resolve dependencies. I tried setting $JRUBY_OPTS to "-d" so I could see the stacktrace but didn't get any additional information. Thanks again for your help.

P.S. I set my Mvnfile repository line to:

repository '<our internal dependency>'

And JBundler is setting the correct repository. I think I'll open up some Java code I have that's using Aether and see if I can get some more insight.


@mkristian thanks, I'll give it a go tomorrow.


@mkristian it works! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.