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 2023/03/24 18:56:00 UTC

[jira] [Comment Edited] (MNG-7748) Several plug-ins fail during parallel build on Maven 3.9.x

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

Michael Osipov edited comment on MNG-7748 at 3/24/23 6:55 PM:
--------------------------------------------------------------

This behavior is correct. Maven 3.8.x does not perform any artifact locking during parallel builds and thus is prone to race conditions. Maven 3.9.x does, so do my Maven 3.8.x weith newer Resolver: https://maven.apache.org/resolver/maven-3.8.x.html. This message simply indicates that the thread waited longer for the lock than the timeout. Increase the timeout: https://maven.apache.org/resolver/configuration.html
Property: {{aether.syncContext.named.time}}

Also read: https://maven.apache.org/resolver/maven-resolver-named-locks/index.html

If you think this is still a bug, read https://maven.apache.org/resolver/maven-resolver-named-locks/analyzing-lock-issues.html


was (Author: michael-o):
This behavior is correct. Maven 3.8.x does not perform any artifact locking during parallel builds and thus is prone to race conditions. Maven 3.9.x does, so do my Maven 3.8.x weith newer Resolver: https://maven.apache.org/resolver/maven-3.8.x.html. This message simply indicates that the thread waited longer for the lock than the timeout. Increase the timeout: https://maven.apache.org/resolver/configuration.html
Property: {{aether.syncContext.named.time}}

> Several plug-ins fail during parallel build on Maven 3.9.x
> ----------------------------------------------------------
>
>                 Key: MNG-7748
>                 URL: https://issues.apache.org/jira/browse/MNG-7748
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.9.0, 3.9.1
>         Environment: The error happens on every platform we build on: Linux, OSX, and Windows.  We are using JDK 19.
>            Reporter: Dan Mclaughlin
>            Priority: Major
>             Fix For: waiting-for-feedback
>
>
> We have a multi-module build that we have been doing parallel builds on for years using the -T1C build parameter.   As soon as we moved to Maven 3.9.0 (and we've tried 3.9.1) we keep getting several plugins that fail at random with a "Could not acquire write lock for" error message.  If we simply move back to Maven 3.8.x then things work fine.  We can also set -T1 so the build only uses one thread and then things work.   
> {noformat}
> *11:02:23* [ERROR] Failed to execute goal org.owasp:dependency-check-maven:8.1.2:check (default) on project cris-common-utils: Execution default of goal org.owasp:dependency-check-maven:8.1.2:check failed: Could not acquire write lock for 'artifact:org.apache.logging.log4j:log4j-api:2.20.0' -> [Help 1]
> *11:02:23* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-bytecode-version) on project cris-jakarta-transform: Execution enforce-bytecode-version of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Could not acquire write lock for 'artifact:org.slf4j:slf4j-api:2.0.6' -> [Help 1]
> *11:02:23* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-bytecode-version) on project cris-authservice: Execution enforce-bytecode-version of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Could not acquire write lock for 'artifact:org.slf4j:slf4j-api:2.0.6' -> [Help 1]
> *11:02:23* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-bytecode-version) on project cris-swing-components: Execution enforce-bytecode-version of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Could not acquire write lock for 'artifact:org.slf4j:slf4j-api:2.0.6' -> [Help 1]
> *11:02:23* [ERROR] Could not acquire write lock for 'artifact:org.apache.logging.log4j:log4j-api:2.20.0'
> *11:02:23* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-bytecode-version) on project cris-internalservices: Execution enforce-bytecode-version of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Could not acquire write lock for 'artifact:org.slf4j:slf4j-api:2.0.6' -> [Help 1]
> *11:02:23* [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce-bytecode-version) on project cris-common-xmldata: Execution enforce-bytecode-version of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Could not acquire write lock for 'artifact:org.slf4j:slf4j-api:2.0.6' -> [Help 1]
> {noformat}



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