rules_maven icon indicating copy to clipboard operation
rules_maven copied to clipboard

Error when using compileOnly option

Open michaelzenz opened this issue 6 years ago • 0 comments

I am trying to use different configurations in the maven_repository, here is my WORKSPACE:


load("@org_pubref_rules_maven//maven:rules.bzl", "maven_repositories", "maven_repository")
maven_repositories()

maven_repository(
  name = "dji_sdk_provided",
  deps = [
    "com.dji:dji-sdk-provided:4.9",
  ],
  configurations=["compileOnly"],
)

load("@dji_sdk_provided//:rules.bzl", "dji_sdk_provided_compileOnly")
dji_sdk_provided_compileOnly()

But then it prints the error:


ERROR: error loading package '': Encountered error while reading extension file 'rules.bzl': no such package '@dji_sdk_provided//': Traceback (most recent call last):
	File "/home/michaelz/.cache/bazel/_bazel_michaelz/b6333d216839ce5219763b0b7128bf5b/external/org_pubref_rules_maven/maven/internal/maven_repository.bzl", line 544
		_parse_gradle_dependencies(rtx, transitive_artifacts, rtx.attr...., )
	File "/home/michaelz/.cache/bazel/_bazel_michaelz/b6333d216839ce5219763b0b7128bf5b/external/org_pubref_rules_maven/maven/internal/maven_repository.bzl", line 213, in _parse_gradle_dependencies
		configs[section]
key None not found in dictionary

And when I uncomment the line(in maven_repository.bzl, line 541):

print("result: %s" % result.stdout)

It prints:


result: 
> Task :dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

annotationProcessor - Annotation processors and their dependencies for source set 'main'.
No dependencies

apiElements - API elements for main. (n)
No dependencies

archives - Configuration for archive artifacts.
No dependencies

compile - Dependencies for source set 'main' (deprecated, use 'implementation' instead).
\--- com.dji:dji-sdk-provided:4.9

compileClasspath - Compile classpath for source set 'main'.
\--- com.dji:dji-sdk-provided:4.9

compileOnly - Compile only dependencies for source set 'main'.
No dependencies

default - Configuration for default artifacts.
\--- com.dji:dji-sdk-provided:4.9

implementation - Implementation only dependencies for source set 'main'. (n)
No dependencies

runtime - Runtime dependencies for source set 'main' (deprecated, use 'runtimeOnly' instead).
\--- com.dji:dji-sdk-provided:4.9

runtimeClasspath - Runtime classpath of source set 'main'.
\--- com.dji:dji-sdk-provided:4.9

runtimeElements - Elements of runtime for main. (n)
No dependencies

runtimeOnly - Runtime only dependencies for source set 'main'. (n)
No dependencies

testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'.
No dependencies

testCompile - Dependencies for source set 'test' (deprecated, use 'testImplementation' instead).
\--- com.dji:dji-sdk-provided:4.9

testCompileClasspath - Compile classpath for source set 'test'.
\--- com.dji:dji-sdk-provided:4.9

testCompileOnly - Compile only dependencies for source set 'test'.
No dependencies

testImplementation - Implementation only dependencies for source set 'test'. (n)
No dependencies

testRuntime - Runtime dependencies for source set 'test' (deprecated, use 'testRuntimeOnly' instead).
\--- com.dji:dji-sdk-provided:4.9

testRuntimeClasspath - Runtime classpath of source set 'test'.
\--- com.dji:dji-sdk-provided:4.9

testRuntimeOnly - Runtime only dependencies for source set 'test'. (n)
No dependencies

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed

Am I doing it correctly? Why would the compileOnly option has no dependency?

michaelzenz avatar Mar 06 '19 17:03 michaelzenz