[
https://issues.apache.org/jira/browse/MNG-7433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17535054#comment-17535054
]
ASF GitHub Bot commented on MNG-7433:
-------------------------------------
gnodet commented on code in PR #730:
URL: https://github.com/apache/maven/pull/730#discussion_r870619812
##########
maven-core/src/main/java/org/apache/maven/internal/MessageHelper.java:
##########
@@ -0,0 +1,91 @@
+package org.apache.maven.internal;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Helper class to format warning messages to the console
+ */
+public class MessageHelper
+{
+
+ private static final int DEFAULT_MAX_SIZE = 65;
Review Comment:
Yes, that's in [MessageUtils from
maven-shared-utils](https://github.com/apache/maven-shared-utils/blob/9f40037bfb04d54dd997a9ab837390045c9a4348/src/main/java/org/apache/maven/shared/utils/logging/MessageUtils.java#L225-L236).
The reflow is already done dynamically, so that's not a problem.
However, we go through the logging system, so the caller will have to hard
code somehow the size needed for the `[WARN] ` prefix (or whatever can be
configured), as I don't think we can compute it easily.
I'll can give it a try at adding a parameter for the max length and have the
caller use it with the terminal width (and a maximum, as a one line message
might be hard to read... or not ? ).
> [REGRESSION] Multiple maven instances working on same source tree can lock
> each other
> -------------------------------------------------------------------------------------
>
> Key: MNG-7433
> URL: https://issues.apache.org/jira/browse/MNG-7433
> Project: Maven
> Issue Type: Bug
> Affects Versions: 3.8.5
> Reporter: Dan Tran
> Assignee: Guillaume Nodet
> Priority: Major
>
> I have a large multi modules java maven build where:
> * phase 1 - basic build + unit tests + jacoco - 40 min
> * phase 2 - sonar:sonar 20 min
> * phase 3 - final packaging and basic smoke-test - 20 min
> To take advantage of Maven multi-threaded build, during the reactor build,
> one of our maven module spins another instance of Maven to run sonar:sonar
> goal right after the basic build is done.
> This means our phase 2 and phase 3 run in parallel sharing the same source
> tree, same local maven repo (where sonar:sonar should have all needed
> dependencies at the share local maven repo to run its task)
> With maven-3.8.5, parallelization is no longer possible, phase 3 is blocked
> until phase 2 is done.
> I am able to trace it to https://github.com/apache/maven/pull/628 where the
> locking started the happen
> How does the lock mechanic work? there must be a local file where both Maven
> instances are watching each other. Is there an option to disable this lock?
--
This message was sent by Atlassian Jira
(v8.20.7#820007)