Git Product home page Git Product logo

Comments (8)

jarreds avatar jarreds commented on June 27, 2024 1

Noting that I'm able to work around this by using exclusions + http_file + resources in the java_binary. It would be nice if the the rules in this repo could handle it automagically though. Not sure if that's possible.

# WORKSPACE

http_file(
    name = "com_almworks_sqlite4java_libsqlite4java_linux_amd64",
    downloaded_file_path = "libsqlite4java-linux-amd64-1.0.392.so",
    urls = ["https://repo1.maven.org/maven2/com/almworks/sqlite4java/libsqlite4java-linux-amd64/1.0.392/libsqlite4java-linux-amd64-1.0.392.so"],
)

http_file(
    name = "com_almworks_sqlite4java_libsqlite4java_osx",
    downloaded_file_path = "libsqlite4java-osx-1.0.392.dylib",
    urls = ["https://repo1.maven.org/maven2/com/almworks/sqlite4java/libsqlite4java-osx/1.0.392/libsqlite4java-osx-1.0.392.dylib"],
)

http_file(
    name = "org_eclipse_jetty_orbit_javax_servlet",
    downloaded_file_path = "javax.servlet-3.0.0.v201112011016.jar",
    urls = ["https://repo1.maven.org/maven2/org/eclipse/jetty/orbit/javax.servlet/3.0.0.v201112011016/javax.servlet-3.0.0.v201112011016.jar"],
)

maven_install(
    artifacts = [
        maven.artifact(
            group = "com.amazonaws",
            artifact = "DynamoDBLocal",
            version = "1.11.477",
            exclusions = [
                "com.almworks.sqlite4java:libsqlite4java-linux-amd64",
                "com.almworks.sqlite4java:libsqlite4java-linux-i386",
                "com.almworks.sqlite4java:libsqlite4java-osx",
                "com.almworks.sqlite4java:sqlite4java-win32-x64",
                "com.almworks.sqlite4java:sqlite4java-win32-x86",
                "org.eclipse.jetty.orbit:javax.servlet",
            ],
        ),
    ],
)
# BUILD

java_import(
    name = "org_eclipse_jetty_orbit_javax_servlet",
    jars = [
        "@org_eclipse_jetty_orbit_javax_servlet//file",
    ],
)

java_binary(
    name = "dynamodb-local",
    args = [
        "-sharedDb",
        "-inMemory",
    ],
    data = [
        "@com_almworks_sqlite4java_libsqlite4java_linux_amd64//file",
        "@com_almworks_sqlite4java_libsqlite4java_osx//file",
    ],
    jvm_flags = [
        "-Djava.library.path=$$JAVA_RUNFILES/com_almworks_sqlite4java_libsqlite4java_osx/file/:$$JAVA_RUNFILES/com_almworks_sqlite4java_libsqlite4java_linux_amd64/file/",
    ],
    main_class = "com.amazonaws.services.dynamodbv2.local.main.ServerRunner",
    visibility = ["//visibility:public"],
    runtime_deps = [
        "org_eclipse_jetty_orbit_javax_servlet",
        "@maven//:com_almworks_sqlite4java_sqlite4java",
        "@maven//:com_amazonaws_DynamoDBLocal",
    ],
)

from rules_jvm_external.

jin avatar jin commented on June 27, 2024

Marking this as a feature request and thanks for providing the clear workaround.

FWIW, on 2.0.1 I can include the "com.amazonaws:DynamoDBLocal:1.11.477" artifact in maven_install and not see a crash. The binaries aren't downloaded so you don't need to write the exclusions in the spec.

from rules_jvm_external.

joprice avatar joprice commented on June 27, 2024

@jin I tried the same and get errors like

in deps attribute of jvm_import rule @scala_2_11//:com_amazonaws_DynamoDBLocal: rule '@scala_2_11//:com_almworks_sqlite4java_libsqlite4java_linux_i386_so' does not exist"

when building. I had to use a similar workaround as above.

from rules_jvm_external.

daicoden avatar daicoden commented on June 27, 2024

log4j exports some test helpers with a packaging as test-jar. Packaging doesn't seem to affect which artifact is actually retrieved. (I think same root issue)

from rules_jvm_external.

dsilvasc avatar dsilvasc commented on June 27, 2024

Maybe the same problem for com.oracle.substratevm:svm:19.2.0.1:

external/maven/BUILD:509:11: in deps attribute of jvm_import rule @maven//:org_graalvm_truffle_truffle_nfi: rule '@maven//:org_graalvm_truffle_truffle_nfi_native_darwin_amd64_tar_gz' does not exist
external/maven/BUILD:509:11: in deps attribute of jvm_import rule @maven//:org_graalvm_truffle_truffle_nfi: rule '@maven//:org_graalvm_truffle_truffle_nfi_native_linux_amd64_tar_gz' does not exist
external/maven/BUILD:509:11: in deps attribute of jvm_import rule @maven//:org_graalvm_truffle_truffle_nfi: rule '@maven//:org_graalvm_truffle_truffle_nfi_native_linux_aarch64_tar_gz' does not exist

from rules_jvm_external.

purkhusid avatar purkhusid commented on June 27, 2024

Hitting the exact same issue with the same dependency. So far this has been the only issue I've had with rules_jvm_external.

from rules_jvm_external.

checorone avatar checorone commented on June 27, 2024

Same for quarkus
@maven//:io_quarkus_quarkus_grpc_codegen: rule '@maven//:com_google_protobuf_protoc_exe_windows_x86_32' does not exist.
It expects JAR, but file have .exe extension...

from rules_jvm_external.

dzbarsky avatar dzbarsky commented on June 27, 2024

https://github.com/bazelbuild/rules_jvm_external/pull/959/files is not fully automagical but a bit nicer experience

from rules_jvm_external.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.