[ 
https://issues.apache.org/jira/browse/KUDU-3610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17894744#comment-17894744
 ] 

ASF subversion and git services commented on KUDU-3610:
-------------------------------------------------------

Commit 78455172ce0d5d2979b153a8dece3c81ba675d1c in kudu's branch 
refs/heads/branch-1.18.x from zchovan
[ https://gitbox.apache.org/repos/asf?p=kudu.git;h=78455172c ]

[java][build] KUDU-3610: kudu-client.jar dependencies

As reported in KUDU-3610 Impala build fails with the newly generated
kudu-client.jar pom.xml.

The issue is in the pom generation itself [1], that is being done by
the 'maven-publish' plugin (which is necessary for gradle 7+ due to
the old publish plugin being deprecated).

This means that the content of the jars are correct, however the
generated pom.xml lists some dependencies in incorrect (maven) scopes.

The fix this change proposes is by editing the generated pom xml
structure, so that the shaded dependencies are removed from the
generated pom. This was previously done by the shadow plugin, however
due to API changes this is no longer possible and has to be done in
maven-publish plugin.

Additional manual testing (building Impala) was carried out that
confirmed that the pom is now correct.

[1] 
https://discuss.gradle.org/t/maven-publish-plugin-generated-pom-making-dependency-scope-runtime/7494

Change-Id: I607d7c62c585b2aa1bee4ebf7907309e130092da
Reviewed-on: http://gerrit.cloudera.org:8080/21731
Reviewed-by: Alexey Serbin <ale...@apache.org>
Tested-by: Alexey Serbin <ale...@apache.org>
(cherry picked from commit 9befb1188ec2c8f75bf81f9cd5b17fec2db8c19b)
Reviewed-on: http://gerrit.cloudera.org:8080/21995
Reviewed-by: Abhishek Chennaka <achenn...@cloudera.com>


> KUDU-3551 introduced new unnecessary dependencies for kudu-client.jar
> ---------------------------------------------------------------------
>
>                 Key: KUDU-3610
>                 URL: https://issues.apache.org/jira/browse/KUDU-3610
>             Project: Kudu
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.18.0
>            Reporter: Joe McDonnell
>            Assignee: Zoltan Chovan
>            Priority: Major
>         Attachments: kudu-client-a9d42cdb84.pom, kudu-client-e742f86f6d.pom
>
>
> When working on fixing IMPALA-13309, I was upgrading Kudu from  
> [e742f86f6d|https://github.com/apache/kudu/commit/e742f86f6d] to 
> [a9d42cdb84|https://github.com/apache/kudu/commit/a9d42cdb8438858cf1bd18c203d1687ed5734346],
>  which is past the upgrade to Gradle 7.6.4 in 
> [e456bc7758|https://github.com/apache/kudu/commit/e456bc775805d4555d99ce12d04e3ca0b8950760]
>  (KUDU-3551). When using this new version, Impala's build fails with a 
> message like this:
>  
> {noformat}
> 15:24:49 [ERROR] Failed to execute goal on project impala-frontend: Could not 
> resolve dependencies for project 
> org.apache.impala:impala-frontend:jar:4.5.0-SNAPSHOT: Failed to collect 
> dependencies at org.apache.kudu:kudu-client:jar:a9d42cdb84 -> 
> org.apache.kudu:kudu-proto:jar:a9d42cdb84: Failed to read artifact descriptor 
> for org.apache.kudu:kudu-proto:jar:a9d42cdb84: Could not transfer artifact 
> org.apache.kudu:kudu-proto:pom:a9d42cdb84 from/to impala.cdp.repo (yadda 
> yadda yadda)
> {noformat}
>  
> Impala builds and publishes kudu-client.jar, but we currently don't publish 
> kudu-proto.jar. This was fine on the old Kudu version, because 
> kudu-client.jar is a shaded jar and does not have a runtime dependency on 
> kudu-proto.jar. After the upgrade to Gradle 7.6.4, kudu-client.jar gains a 
> runtime dependency on kudu-proto.jar and a few other dependencies (guava, 
> netty, etc). These extra runtime dependencies should not be needed, because 
> they are included in the shaded jar.
> I have attached the kudu-client.pom files from before and after for 
> comparison:
> Before: [^kudu-client-e742f86f6d.pom]
> After: [^kudu-client-a9d42cdb84.pom]
> To produce this file during development, run this from the java directory:
> {noformat}
> ./gradlew -Dmaven.repo.local=/path/to/a/local/directory 
> :kudu-client:publishToMavenLocal{noformat}
> Then, the new pom file will be under the 
> /path/to/a/local/directory/org/apache/kudu/kudu-client/1.18.0-SNAPSHOT/ 
> directory.
> It would be good for the dependencies to be as restricted as before. I think 
> we can get around some of these dependencies by using "compileOnly" rather 
> than "implementation".



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to