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

Error when using compileOnly option #23

Open
michaelzenz opened this issue Mar 6, 2019 · 0 comments
Open

Error when using compileOnly option #23

michaelzenz opened this issue Mar 6, 2019 · 0 comments

Comments

@michaelzenz
Copy link

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...., <2 more arguments>)
	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?

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

1 participant