Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The repository '@@[unknown repo 'maven' requested from @@]' could not be resolved: No repository visible as '@maven' from main repository and referenced by '//:salutations' #1104

Open
jigsnptel opened this issue Apr 17, 2024 · 1 comment

Comments

@jigsnptel
Copy link

workspace.bazel file

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

#USE Latest version of RULES_JVM_EXTERNAL
RULES_JVM_EXTERNAL_TAG = "5.1"
RULES_JVM_EXTERNAL_SHA ="8c3b207722e5f97f1c83311582a6c11df99226e65e2471086e296561e57cc954"

#Fetches Extension
http_archive(
name = "rules_jvm_external",
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
sha256 = RULES_JVM_EXTERNAL_SHA,
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG)
)

#rules_jvm_external depends on this library.
http_archive(
name = "bazel_skylib",
sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz",
],
)
load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")

rules_jvm_external_deps()

load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")

rules_jvm_external_setup()

load("@rules_jvm_external//:defs.bzl", "maven_install")

maven_install(
artifacts = [
"org.beryx:text-io:3.4.1",

],

repositories = [
    "https://maven.google.com",
    "https://repo1.maven.org/maven2",
    "https://jcenter.bintray.com/",
    "http://uk.maven.org/maven2",
],

)

BUILD.bazel file
load("@rules_java//java:defs.bzl", "java_binary", "java_library")
#load("@rules_jvm_external//:defs.bzl", "maven")

java_binary(
name = "ProjectRunner",
srcs = ["src/main/java/com/example/ProjectRunner.java"],
main_class = "main.java.com.example.ProjectRunner",
deps = [":greeter"],
)
java_binary(
name="salutations",
srcs = ["src/main/java/com/example/Salutations.java"],
main_class = "main.java.com.example.Salutations",
deps = [":greeter","@maven//:org_beryx_text_io"],
)

java_library(
name = "greeter",
srcs = ["src/main/java/com/example/Greeting.java"],
visibility = ["//src/main/java/com/example/cmdline:pkg"],

)
bazel version 7.1.1
pls help, i am on timeline

@shs96c
Copy link
Collaborator

shs96c commented Apr 17, 2024

Can you please test with the current HEAD of master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants