sebastien-doyon commented on code in PR #1269:
URL: https://github.com/apache/maven/pull/1269#discussion_r1366969590
##########
maven-embedder/src/main/java/org/apache/maven/cli/transfer/ConsoleMavenTransferListener.java:
##########
@@ -64,20 +65,36 @@ public synchronized void transferProgressed(TransferEvent
event) throws Transfer
TransferResource resource = event.getResource();
transfers.put(resource, event.getTransferredBytes());
- StringBuilder buffer = new StringBuilder(128);
buffer.append("Progress (").append(transfers.size()).append("): ");
- synchronized (transfers) {
- Iterator<Map.Entry<TransferResource, Long>> entries =
- transfers.entrySet().iterator();
- while (entries.hasNext()) {
- Map.Entry<TransferResource, Long> entry = entries.next();
- long total = entry.getKey().getContentLength();
- Long complete = entry.getValue();
- buffer.append(getStatus(entry.getKey().getResourceName(),
complete, total));
- if (entries.hasNext()) {
- buffer.append(" | ");
+ Iterator<Map.Entry<TransferResource, Long>> entries =
+ transfers.entrySet().iterator();
+ while (entries.hasNext()) {
+ Map.Entry<TransferResource, Long> entry = entries.next();
+ long total = entry.getKey().getContentLength();
+ Long complete = entry.getValue();
+
+ String resourceName = entry.getKey().getResourceName();
+
+ if (printResourceNames) {
+ int idx = resourceName.lastIndexOf('/');
+
+ if (idx < 0) {
+ buffer.append(resourceName);
+ } else {
+ buffer.append(resourceName, idx + 1,
resourceName.length());
}
+ buffer.append(" (");
+ }
+
+ buffer.append(format.formatProgress(complete, total));
Review Comment:
Done in the last commit
--
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]