adoroszlai opened a new pull request, #1194:
URL: https://github.com/apache/ratis/pull/1194

   ## 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://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#shadedArtifactAttached))
   
   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
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to