| ${esc.hash} Global Sync Context for Maven Resolver |
| |
| <!-- |
| 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. |
| --> |
| |
| <span style="color: red; font-size: 16pt">***Note***: *This component is still considered to be experimental, use with caution!*</span> |
| |
| The Global Sync Context Factory is Java global lock factory for Maven Resolver to provide a |
| concurrent-safe access from a single Maven instance to the same local Maven repository. |
| |
| For further details about the factory read the [Javadoc](./apidocs/org/eclipse/aether/synccontext/GlobalSyncContextFactory.html). |
| |
| ${esc.hash}${esc.hash} Open Issues/Notes |
| |
| - It only works when dependency injection is used and not the bundled `AetherModule` or |
| `ServiceLocator` (Maven uses dependency injection). |
| - Usage from plugins has not been tested yet. |
| - The `furnace-maven-plugin` does not work this implementation because it uses `ServiceLocator` instead |
| of dependency injection. |
| |
| ${esc.hash}${esc.hash} Installation/Testing |
| - Copy the following dependencies from Maven Central to `${maven.home}/lib/ext/`: |
| <pre class="source"> |
| ├── <a href="https://repo1.maven.org/maven2/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar">javax.annotation-api-1.3.2.jar</a> |
| └── <a href="https://repo1.maven.org/maven2/org/apache/maven/resolver/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar">${project.artifactId}-${project.version}.jar</a></pre> |
| - Now start a multithreaded Maven build on your project. |
| |
| ${esc.hash}${esc.hash}${esc.hash} Debugging |
| |
| - Add/modify the following entries in `${maven.conf}/logging/simplelogger.properties`: |
| ``` |
| org.slf4j.simpleLogger.showDateTime=true |
| org.slf4j.simpleLogger.showThreadName=true |
| org.slf4j.simpleLogger.showShortLogName=true |
| org.slf4j.simpleLogger.log.org.eclipse.aether.synccontext=trace |
| ``` |
| - Now start a multithreaded Maven build on your project and you should see at least these lines: |
| ``` |
| 4626 [main] [TRACE] GlobalSyncContextFactory$GlobalSyncContext - Acquiring global... |
| 35318 [main] [TRACE] GlobalSyncContextFactory$GlobalSyncContext - Releasing global... |
| ``` |