You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Kari J. Niemi (Jira)" <ji...@apache.org> on 2021/11/25 12:07:00 UTC

[jira] [Created] (MNG-7348) maven.artifact.threads not respected in maven parallel builds.

Kari J. Niemi created MNG-7348:
----------------------------------

             Summary: maven.artifact.threads not respected in maven parallel builds.
                 Key: MNG-7348
                 URL: https://issues.apache.org/jira/browse/MNG-7348
             Project: Maven
          Issue Type: Bug
    Affects Versions: 3.6.3
            Reporter: Kari J. Niemi


maven.artifact.threads=1 is not respected in maven parallel builds. Maven seems to do the downloads inside the BuilderThreads when using the 1 as the value - so with multiple build threads ("-T 1C" for example), downloads will be done in as many threads as there are BuildThreads. I confirmed this by polling the stack traces of the maven process: I saw that the Resolver/Wagon/aether was in the stack trace of multiple BuilderThreads at the same time, and there were no "resolver-x" threads at all.

The documentation for maven.artifact.thread says "Number of threads to use for uploading/downloading.": [https://maven.apache.org/resolver/configuration.html]

I suppose the issue is around here: [https://github.com/apache/maven/blob/maven-3.6.3/maven-compat/src/main/java/org/apache/maven/artifact/resolver/DefaultArtifactResolver.java#L106-L115]

I'm really not a java expert, and  actually hope to be wrong about it - but to me it seems that the "maven.artifact.threads=1"-case is getting executed in the same thread, and therefore there will be as many downloading threads as there are BuildThreads?

( Background: this was the latest and maybe last miserable try to work around the bugs in parallel artifact downloads... which lead to builds failing and corrupted stuff in local maven repository )

 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)