Redisson Sync Context for Maven Resolver

Note: This component has been deprecated and superseded in 1.7.0 with the named lock factories rwlock-redisson and semaphore-redisson.

The Redisson Sync Context Factory is a Redisson-based distributed locks factory for Maven Resolver on top of Redis to provide a fast, concurrent-safe access from one or multiple Maven instances to the same local Maven repository.

For further details about the factory read the Javadoc.

Open Issues/Notes

  • It only works when dependency injection is used and not the bundled AetherModule or ServiceLocator (Maven uses dependency injection).
  • It includes a lot of trace logging which partially will go way as soon as it has been stabilized.
  • 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.

Installation/Testing

Debugging

  • Add/modify the following entries in ${maven.home}/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
    #org.slf4j.simpleLogger.log.org.redisson=debug
    #org.slf4j.simpleLogger.log.io.netty=debug
    
  • Now start a multithreaded Maven build on your project and you should see at least these lines:
    # This line does not appear for the default configuration
    2316 [main] [TRACE] RedissonSyncContextFactory - Reading Redisson config file from '${maven.conf}/maven-resolver-redisson.yaml'
    4626 [main] [TRACE] RedissonSyncContextFactory - Created Redisson client with id '1c8db59b-7939-4014-8506-ae841c74608c'
    ...
    35318 [main] [TRACE] RedissonSyncContextFactory - Shutting down Redisson client with id '1c8db59b-7939-4014-8506-ae841c74608c'
    

Configuration Options

Option Type Description Default Value
aether.syncContext.redisson.configFile String Path to a Redisson configuration file in YAML format. Read official documentation for details. ${maven.conf}/maven-resolver-redisson.yaml
aether.syncContext.redisson.discriminator String A discriminator uniquely identifying a host and repository pair. If the generation of the default value fails, it will use sha1(''). sha1('${hostname:-localhost}:${maven.repo.local}')

Set Configuration from Apache Maven

To set one of the configuration options from above just use system variables.