Open mandrean opened 5 years ago
Can you provide the maven_install
snippet please?
@jin Here you go:
https://github.com/mandrean/rules-jvm-relocated-deps/blob/master/WORKSPACE#L19
and
Note that if you comment out:
org.apache.commons:commons-io:1.3.2
/@maven//:org_apache_commons_commons_io
and use:
commons-io:commons-io:1.3.2
/@maven//:commons_io_commons_io
instead, it all works!
So to me it seems that something isn't resolving relocated artifacts.
I'm seeing the same thing with org.hibernate:hibernate-validator:6.0.18.Final
which is relocated to org.hibernate.validator:hibernate-validator:6.0.18.Final
.
It looks like the problem is coursier fetch
doesn't return any information about the dependency rename e.g.
> coursier fetch --json-output-file dep-tree.json org.apache.commons:commons-io:1.3.2
/Users/cheister/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar
> cat dep-tree.json | python -m json.tool
{
"conflict_resolution": {},
"dependencies": [
{
"coord": "commons-io:commons-io:1.3.2",
"dependencies": [],
"directDependencies": [],
"file": "/Users/cheister/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/commons-io/commons-io/1.3.2/commons-io-1.3.2.jar"
}
],
"version": "0.1.0"
}
Since rules_jvm_external only creates jvm_import rules for dependencies returned in the fetch json output it does not add a jvm_import rule for org.apache.commons:commons-io
.
I wonder if coursier would accept a feature request to add a renames
field to the json they return?
Alternatively, if you only want resolution to work and don't need to refer to the artifact directly ( @maven//:org_apache_commons_commons_io
) it looks you can work around it with override_targets in maven_install
override_targets = {
"org.apache.commons:commons-io": ":commons_io_commons_io",
},
While trying to build a project I run into this error:
Even if I manually add
org.apache.commons:commons-io:1.3.2
to themaven_install
it still doesn't build.While inspecting https://mvnrepository.com/artifact/org.apache.commons/commons-io & https://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.pom, I notice:
and
So, to me it seems like
rules_jvm_external
and/or Coursier can't resolve relocated dependencies?