Skip to content

RATIS-2222. Remove copy-rename-maven-plugin usage#1194

Merged
adoroszlai merged 1 commit into
apache:masterfrom
adoroszlai:RATIS-2222
Dec 22, 2024
Merged

RATIS-2222. Remove copy-rename-maven-plugin usage#1194
adoroszlai merged 1 commit into
apache:masterfrom
adoroszlai:RATIS-2222

Conversation

@adoroszlai
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Build uses copy-rename-maven-plugin to overwrite original jar with shaded one in ratis-examples (and experiments). maven-shade-plugin can do that, so we can remove usage of copy-rename-maven-plugin.

<shadedArtifactAttached>
Defines whether the shaded artifact should be attached as classifier to the original artifact. If false, the shaded jar will be the main artifact of the project
(source)

https://issues.apache.org/jira/browse/RATIS-2222

How was this patch tested?

Built locally:

$ ./mvnw -Prelease -DskipTests -Dmaven.javadoc.skip clean verify
...
[INFO] --- shade:3.6.0:shade (default) @ ratis-examples ---
...
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing ratis-examples/target/ratis-examples-3.2.0-SNAPSHOT.jar with ratis-examples/target/ratis-examples-3.2.0-SNAPSHOT-shaded.jar
...

Checked examples jar size:

$ ls -1sh ratis-examples/target/*SNAPSHOT.jar 
148K ratis-examples/target/original-ratis-examples-3.2.0-SNAPSHOT.jar
 21M ratis-examples/target/ratis-examples-3.2.0-SNAPSHOT.jar

$ tar tzvf ratis-assembly/target/ratis-assembly-3.2.0-SNAPSHOT-bin.tar.gz | grep ratis-examples             
-rw-r--r-- root/root  21222451 2023-11-19 15:23 apache-ratis-3.2.0-SNAPSHOT-bin/examples/lib/ratis-examples-3.2.0-SNAPSHOT.jar

Tested arithmetic example:

$ tar zxf ratis-assembly/target/ratis-assembly-3.2.0-SNAPSHOT-bin.tar.gz apache-ratis-3.2.0-SNAPSHOT-bin
$ cd apache-ratis-3.2.0-SNAPSHOT-bin

$ export PEERS="n0:127.0.0.1:6000,n1:127.0.0.1:6001,n2:127.0.0.1:6002"
$ export BIN=examples/bin

$ "${BIN}"/start-all.sh arithmetic server
Found examples/lib/ratis-examples-3.2.0-SNAPSHOT.jar
...
INFO  RaftServer$Division:379 - n0@group-6F7570313233: changes role from CANDIDATE to LEADER at term 1 for changeToLeader
...

$ "${BIN}"/client.sh arithmetic assign --name a --value 3 --peers "${PEERS}"
$ "${BIN}"/client.sh arithmetic assign --name b --value 4 --peers "${PEERS}"
$ "${BIN}"/client.sh arithmetic assign --name c --value "a+b" --peers "${PEERS}"
$ "${BIN}"/client.sh arithmetic get --name c --peers "${PEERS}"
...
c=7

@adoroszlai adoroszlai self-assigned this Dec 21, 2024
Copy link
Copy Markdown
Contributor

@szetszwo szetszwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 the change looks good.

@adoroszlai adoroszlai merged commit 551b8c9 into apache:master Dec 22, 2024
@adoroszlai adoroszlai deleted the RATIS-2222 branch December 22, 2024 16:11
@adoroszlai
Copy link
Copy Markdown
Contributor Author

Thanks @szetszwo for the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants