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

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

    [ https://issues.apache.org/jira/browse/MNG-7348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17449431#comment-17449431 ] 

Michael Osipov commented on MNG-7348:
-------------------------------------

I think this is at least a documentation problem and the property name {{maven.artifact.threads}} is misleading. As far as I know only Resolver uses it so it should not be a Maven property to avoid such confusion.

> 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
>            Priority: Major
>
> 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)