[NETCONF-884] Maven shade plugin replace netconf-testtol with scale-util inside release artifacts Created: 13/Jun/22  Updated: 25/Aug/22  Resolved: 12/Jul/22

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: 2.0.16
Fix Version/s: 4.0.0, 3.0.6

Type: Bug Priority: Medium
Reporter: Peter Suna Assignee: Peter Suna
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Maven shade plugin introduces a feature, enabled by default: [0]. Odlparent picks it up in a regular version bump: [1]. Thus between a "good" merge run console output [2] and a "bad" one [3], the addition is that the bad one shows creation of dependency-reduced-pom.xml file (four times, once for each shaded jar, the scale-util [4] one remains just because it is built last), and maven-install-plugin then prefers taking that (instead of netconf/tools/netconf-testtool/pom.xml [5]) to be the pom the user wants to install as netconf-testtool-2.0.15-SNAPSHOT.pom

[0] -> https://issues.apache.org/jira/browse/MSHADE-36
[1] -> https://git.opendaylight.org/gerrit/c/odlparent/+/100407
[2] -> https://s3-logs.opendaylight.org/logs/releng/vex-yul-odl-jenkins-1/netconf-maven-merge-2.0.x/92/console.log.gz
[3] -> https://s3-logs.opendaylight.org/logs/releng/vex-yul-odl-jenkins-1/netconf-maven-merge-2.0.x/94/console.log.gz
[4] -> https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/netconf/netconf-testtool/3.0.5/netconf-testtool-3.0.5.pom
[5] -> https://github.com/opendaylight/netconf/blob/v3.0.5/netconf/tools/netconf-testtool/pom.xml



 Comments   
Comment by Vratko Polak [ 13/Jun/22 ]

The following describes a fix (in sense it restores previous behavior with no dependency-reduced-pom.xml created), it just needs to be placed in a correct place.
https://itecnote.com/tecnote/java-maven-shade-plugin-adding-dependency-reduced-pom-xml-to-base-directory/

Comment by Robert Varga [ 13/Jun/22 ]

odlparent does exactly nothing w.r.t. shade plugin configuration – hence this needs to be fixed in netconf.

Comment by Vratko Polak [ 14/Jun/22 ]

I agree only netconf testtool seems to be affected by the artifact id consequence:
$ fgrep -rn shadedArtifactId | cut -d ':' -f -2
netconf/netconf/tools/netconf-testtool/pom.xml:218
netconf/netconf/tools/netconf-testtool/pom.xml:262
netconf/netconf/tools/netconf-testtool/pom.xml:305

But also other ODL projects should re-check their usage of maven-shade-plugin:
$ fgrep -rn '<goal>shade</goal>' | cut -d ':' -f -2
controller/akka/repackaged-akka-jar/pom.xml:105
controller/opendaylight/md-sal/sal-dummy-distributed-datastore/pom.xml:66
aaa/aaa-cli-jar/pom.xml:113
aaa/aaa-shiro/repackaged-shiro-jar/pom.xml:64
yangtools/tools/yang-validation-tool/pom.xml:65
netconf/netconf/shaded-exificient-jar/pom.xml:47
netconf/netconf/shaded-sshd-jar/pom.xml:64
netconf/netconf/tools/netconf-testtool/pom.xml:184
netconf/netconf/tools/netconf-testtool/pom.xml:214
netconf/netconf/tools/netconf-testtool/pom.xml:258
netconf/netconf/tools/netconf-testtool/pom.xml:301
bgpcep/bgp/testtool/pom.xml:173
bgpcep/bmp/bmp-mock/pom.xml:144
bgpcep/pcep/pcc-mock/pom.xml:131
bgpcep/pcep/testtool/pom.xml:104

Generated at Wed Feb 07 20:16:09 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.