Configure generate_workspace with Maven's settings.xml

295 views
Skip to first unread message

Svend Johannsen

unread,
Oct 7, 2015, 5:29:15 PM10/7/15
to bazel-discuss
Hi,

I'm running this command to generate the workspace file based on a pom.xml:

bazel-bin/src/tools/generate_workspace/generate_workspace '--maven_project=' foo

But Bazel tries to connect to contral.maven.org, which is outside the firewall and not accessible.


[FATAL] Non-resolvable parent POM: Could not find any repositories that knew how to resolve com.oracle.....commons:service-pom:0.4.1-SNAPSHOT (checked http://central.maven.org/maven2/) @


Does anyone know if it's possible to configure Bazel with custom Maven settings?


Basically I'd just want Bazel to read my ~/.m2/settings.xml file -- if that's possible.


Thanks,

Svend

Svend Johannsen

unread,
Oct 7, 2015, 5:31:06 PM10/7/15
to bazel-discuss
By the way. My build is Bazel build is dde6c53f9c4fee3ee5de18f8bf750dd47dba8112 from Sep 30. If that matters.

Kristina Chodorow

unread,
Oct 8, 2015, 10:13:07 AM10/8/15
to Svend Johannsen, bazel-discuss
If you can temporarily edit your pom.xml, you could add a repositories section that points to your internal server (that's what we do in our tests, see https://github.com/bazelbuild/bazel/blob/master/src/test/shell/bazel/generate_workspace_test.sh#L99).  

Unfortunately, generate_workspace doesn't read your settings.xml file yet, so you're out of luck if you need authentication to connect to your intranet Maven server.  I've filed https://github.com/bazelbuild/bazel/issues/498 for that.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/f61faaab-51f8-4994-b37e-f0da7afc1aef%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Svend Johannsen

unread,
Oct 8, 2015, 4:59:58 PM10/8/15
to bazel-discuss, svend.j...@gmail.com
Thanks, that makes sense. Unfortunately it does seem like I need authentication. So that won't work.. Thanks for filing the bug.

Svend Johannsen

unread,
Nov 3, 2015, 1:59:28 PM11/3/15
to bazel-discuss, svend.j...@gmail.com
I got it to work using the internal artifactory, so I don't actually need this anymore. But you'll probably want to fix it anyways for others. Just thought I'd let you know.

Kristina Chodorow

unread,
Nov 3, 2015, 2:05:42 PM11/3/15
to Svend Johannsen, bazel-discuss
Okay, thanks for the update!

Reply all
Reply to author
Forward
0 new messages