You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/10/15 16:10:00 UTC

[jira] [Commented] (MRESOLVER-413) BF collector causes failure when -Dmaven.artifact.threads=1 used

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

ASF GitHub Bot commented on MRESOLVER-413:
------------------------------------------

cstamas opened a new pull request, #341:
URL: https://github.com/apache/maven-resolver/pull/341

   The property is for downloading/uploading, and was introduced way before BF that itself contains a thread pool. Using value 1 for maven.artifact.threads caused build failure.
   
   Update doco accordingly.
   
   ---
   
   https://issues.apache.org/jira/browse/MRESOLVER-413




> BF collector causes failure when -Dmaven.artifact.threads=1 used
> ----------------------------------------------------------------
>
>                 Key: MRESOLVER-413
>                 URL: https://issues.apache.org/jira/browse/MRESOLVER-413
>             Project: Maven Resolver
>          Issue Type: Bug
>          Components: Resolver
>            Reporter: Tamas Cservenak
>            Priority: Major
>             Fix For: 2.0.0
>
>
> When Maven invoked with {{-Dmaven.artifact.threads=1}} the BF collector fails in IT MavenITmng2305MultipleProxiesTest:
> {noformat}
> [ERROR] Invalid poolSize: 1. Must be greater than 1.
> java.lang.IllegalArgumentException: Invalid poolSize: 1. Must be greater than 1.
>     at org.eclipse.aether.util.concurrency.ExecutorUtils.threadPool (ExecutorUtils.java:46)
>     at org.eclipse.aether.internal.impl.collect.bf.BfDependencyCollector$ParallelDescriptorResolver.<init> (BfDependencyCollector.java:488)
>     at org.eclipse.aether.internal.impl.collect.bf.BfDependencyCollector.doCollectDependencies (BfDependencyCollector.java:156)
>     at org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate.collectDependencies (DependencyCollectorDelegate.java:222)
>     at org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector.collectDependencies (DefaultDependencyCollector.java:87)
>     at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies (DefaultRepositorySystem.java:305)
>     at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:157)
> {noformat}
> This is wrong, as according to https://maven.apache.org/resolver/configuration.html means "Number of threads to use for collecting POMs and version ranges in BF collector." and the configuration should accept 1 as well.
> Or reconsider to NOT observe this configuration for BF thread pool, as the configuration may be set via two (new and old) keys: {{aether.dependencyCollector.bf.threads}} or {{maven.artifact.threads}}. Latter is probably wrong choice.
> Note: the IT MavenITmng2305MultipleProxiesTest sets {{-Dmaven.artifact.threads=1}} along with comment: "disable concurrent downloading as not all wagons (e.g. wagon-lightweight-http) are thread-safe", so here, the intent was not "set BF to single threaded", actually, the IT predates BF.
> Proposal: do not use {{maven.artifact.threads}} as "fallback" for configuration, and fix doco that "int must be > 1"



--
This message was sent by Atlassian Jira
(v8.20.10#820010)