You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
using maven_jar extension in windows and having ubuntu shell installed seems to be broken #7781
P3We're not considering working on this, but happy to review a PR. (No assignee)staleIssues or PRs that are stale (no activity for 30 days)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug
add any external maven dependency (like apache commons lang 3) via maven_jar rule to workspace
setup a java library having the maven jar as dep
build the project
see errors (see additional information)
What operating system are you running Bazel on?
Windows 10
What's the output of bazel info release?
release 0.23.2
Have you found anything relevant by searching the web?
No.
Any other information, logs, or outputs that you want to share?
there seems to be a lot of different errors
on my system, it complains about missing maven dependency plugin. I need to use mvn and download it manually and inside ubuntu shell (or point the to the same local repository).
after downloading the dependency plugin it downloads all maven artifacts but fails to open any jar because the created link seems to be broken
inside the external jar directory the creates a folder structure starting with drive letter and an unprintable character like (because ":" is forbidden in windows).
removing the ubuntu shell leads to some other issue because it seems to ignore BAZEL_SH variable (which points in my case to msys2 bash)
either usage BAZEL_SH variable is broken or BAZEL_SH isn't used anymore.
thanks for your reply, but the extension needs to have plain user/password which is unacceptable to me. the maven jar rule uses .m2 settings and security settings
On Mar 25, 2019, at 6:30 AM, Marka Ragnos ***@***.***> wrote:
thanks for your reply, but the extension needs to have plain user/password which is unacceptable to me.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
thanks, seems to be a temporary solution. i don't like the idea of resolving maven transitive dependencies. My question is: will someone from bazel dev group fix the issue with maven extension?
btw. the original maven_jar rule works so far until I need to access our internal repository because it seems not to support authentication.
hey @MarkaRagnos0815! If you don't like the idea of resolving transitive maven dependencies then the recommendation is to use the jvm_import_external family of repository rules, in particular, the maven specific variant. These will eventually become the only option, as the native maven_jar rule is being deprecated. Right now the jvm_import_external rules do not support authentication and so the native rule will not be deprecated until they do. The jvm_import_external rules use Bazel's http downloader to download the jars, and adding authentication support to the downloader is tracked in this bug. The solution will be a more generic authentication mechanism (i.e. not reading the .m2 settings file), but if you have any specific requirements or requests, please comment on that bug! Or if you have any questions about the jvm_maven_import_external rule
I just reread your report and noticed you're not using the native maven_jar rule, but rather the other starlark maven_jar rule. However, everything I said above applies to that rule as well. It will no longer be supported once jvm_maven_import_external reaches feature parity
yes i am using starlark maven_jar, native maven_jar rule works as expected unless you need authentication
ok, using jvm_import_external may help, but I need authentication without having a user/password pair somewhere plain (not sure how they will implement this)
I am not sure, but my issue seems to have an second issue which I am not sure about. it seems bazel is not using the BAZEL_SH env variable und using just "bash" as command. As long as I have an ubuntu shell in my windows it will use this shell and not the one provided in the BAZEL_SH var.
If the native maven_jar rule is working for you, then you could use it in conjunction with the maven_server rule to get the authentication.
Of course you would eventually need to migrate to the jvm_import_external rules, and I apologize for the churn, but we are actively trying to get these rules into a robust and user friendly state asap :)
Edit:
to be a bit more clear: maven_server( name = "server", url = "http://<ip>/nexus/content/repositories/shared", );
produces: Could not transfer artifact <> from/to <> (http://<ip>/nexus/content/repositories/shared): NullPointerException
server side produces error is 401
changing the url, like removing "shared", produces a not found error
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.
P3We're not considering working on this, but happy to review a PR. (No assignee)staleIssues or PRs that are stale (no activity for 30 days)team-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: bug
Activity
jin commentedon Mar 20, 2019
We have just released a new approach to resolve Maven deps that doesn't depend on any system dependencies. It also works on Windows, please try it out: https://github.com/bazelbuild/rules_jvm_external/
cc @dkelmer
dslomov commentedon Mar 21, 2019
We recommend to switch to https://github.com/bazelbuild/rules_jvm_external/
MarkaRagnos0815 commentedon Mar 25, 2019
thanks for your reply, but the extension needs to have plain user/password which is unacceptable to me. the maven jar rule uses .m2 settings and security settings
jin commentedon Mar 25, 2019
MarkaRagnos0815 commentedon Mar 25, 2019
thanks, seems to be a temporary solution. i don't like the idea of resolving maven transitive dependencies. My question is: will someone from bazel dev group fix the issue with maven extension?
btw. the original maven_jar rule works so far until I need to access our internal repository because it seems not to support authentication.
dkelmer commentedon Mar 26, 2019
hey @MarkaRagnos0815! If you don't like the idea of resolving transitive maven dependencies then the recommendation is to use the jvm_import_external family of repository rules, in particular, the maven specific variant. These will eventually become the only option, as the native maven_jar rule is being deprecated. Right now the
jvm_import_externalrules do not support authentication and so the native rule will not be deprecated until they do. Thejvm_import_externalrules use Bazel's http downloader to download the jars, and adding authentication support to the downloader is tracked in this bug. The solution will be a more generic authentication mechanism (i.e. not reading the .m2 settings file), but if you have any specific requirements or requests, please comment on that bug! Or if you have any questions about thejvm_maven_import_externalruledkelmer commentedon Mar 26, 2019
I just reread your report and noticed you're not using the native
maven_jarrule, but rather the other starlarkmaven_jarrule. However, everything I said above applies to that rule as well. It will no longer be supported oncejvm_maven_import_externalreaches feature parityMarkaRagnos0815 commentedon Mar 27, 2019
@dkelmer thanks for your answer:
dkelmer commentedon Mar 27, 2019
If the native maven_jar rule is working for you, then you could use it in conjunction with the maven_server rule to get the authentication.
Of course you would eventually need to migrate to the jvm_import_external rules, and I apologize for the churn, but we are actively trying to get these rules into a robust and user friendly state asap :)
MarkaRagnos0815 commentedon Mar 29, 2019
maven_server rule does not work with native maven_jar rule or at least in the way I am using maven. I have an settings.xml and settings_security.xml according to http://maven.apache.org/guides/mini/guide-encryption.html. It fails and maven server log shows a authentication error in log
Edit:
to be a bit more clear:
maven_server( name = "server", url = "http://<ip>/nexus/content/repositories/shared", );produces:
Could not transfer artifact <> from/to <> (http://<ip>/nexus/content/repositories/shared): NullPointerExceptionserver side produces error is 401
changing the url, like removing "shared", produces a not found error
sgowroji commentedon Feb 16, 2023
Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.