001/* 002 * Licensed to the Apache Software Foundation (ASF) under one 003 * or more contributor license agreements. See the NOTICE file 004 * distributed with this work for additional information 005 * regarding copyright ownership. The ASF licenses this file 006 * to you under the Apache License, Version 2.0 (the 007 * "License"); you may not use this file except in compliance 008 * with the License. You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, 013 * software distributed under the License is distributed on an 014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 015 * KIND, either express or implied. See the License for the 016 * specific language governing permissions and limitations 017 * under the License. 018 */ 019package org.eclipse.aether.impl.guice; 020 021import javax.inject.Named; 022import javax.inject.Singleton; 023 024import java.util.Collections; 025import java.util.HashMap; 026import java.util.HashSet; 027import java.util.Map; 028import java.util.Set; 029 030import com.google.inject.AbstractModule; 031import com.google.inject.Provides; 032import com.google.inject.name.Names; 033import org.eclipse.aether.RepositoryListener; 034import org.eclipse.aether.RepositorySystem; 035import org.eclipse.aether.impl.ArtifactResolver; 036import org.eclipse.aether.impl.DependencyCollector; 037import org.eclipse.aether.impl.Deployer; 038import org.eclipse.aether.impl.Installer; 039import org.eclipse.aether.impl.LocalRepositoryProvider; 040import org.eclipse.aether.impl.MetadataResolver; 041import org.eclipse.aether.impl.OfflineController; 042import org.eclipse.aether.impl.RemoteRepositoryFilterManager; 043import org.eclipse.aether.impl.RemoteRepositoryManager; 044import org.eclipse.aether.impl.RepositoryConnectorProvider; 045import org.eclipse.aether.impl.RepositoryEventDispatcher; 046import org.eclipse.aether.impl.RepositorySystemLifecycle; 047import org.eclipse.aether.impl.UpdateCheckManager; 048import org.eclipse.aether.impl.UpdatePolicyAnalyzer; 049import org.eclipse.aether.internal.impl.DefaultArtifactResolver; 050import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; 051import org.eclipse.aether.internal.impl.DefaultDeployer; 052import org.eclipse.aether.internal.impl.DefaultFileProcessor; 053import org.eclipse.aether.internal.impl.DefaultInstaller; 054import org.eclipse.aether.internal.impl.DefaultLocalPathComposer; 055import org.eclipse.aether.internal.impl.DefaultLocalPathPrefixComposerFactory; 056import org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider; 057import org.eclipse.aether.internal.impl.DefaultMetadataResolver; 058import org.eclipse.aether.internal.impl.DefaultOfflineController; 059import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager; 060import org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider; 061import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher; 062import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider; 063import org.eclipse.aether.internal.impl.DefaultRepositorySystem; 064import org.eclipse.aether.internal.impl.DefaultRepositorySystemLifecycle; 065import org.eclipse.aether.internal.impl.DefaultTrackingFileManager; 066import org.eclipse.aether.internal.impl.DefaultTransporterProvider; 067import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; 068import org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer; 069import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; 070import org.eclipse.aether.internal.impl.LocalPathComposer; 071import org.eclipse.aether.internal.impl.LocalPathPrefixComposerFactory; 072import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; 073import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; 074import org.eclipse.aether.internal.impl.TrackingFileManager; 075import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector; 076import org.eclipse.aether.internal.impl.checksum.Md5ChecksumAlgorithmFactory; 077import org.eclipse.aether.internal.impl.checksum.Sha1ChecksumAlgorithmFactory; 078import org.eclipse.aether.internal.impl.checksum.Sha256ChecksumAlgorithmFactory; 079import org.eclipse.aether.internal.impl.checksum.Sha512ChecksumAlgorithmFactory; 080import org.eclipse.aether.internal.impl.checksum.SparseDirectoryTrustedChecksumsSource; 081import org.eclipse.aether.internal.impl.checksum.SummaryFileTrustedChecksumsSource; 082import org.eclipse.aether.internal.impl.checksum.TrustedToProvidedChecksumsSourceAdapter; 083import org.eclipse.aether.internal.impl.collect.DefaultDependencyCollector; 084import org.eclipse.aether.internal.impl.collect.DependencyCollectorDelegate; 085import org.eclipse.aether.internal.impl.collect.bf.BfDependencyCollector; 086import org.eclipse.aether.internal.impl.collect.df.DfDependencyCollector; 087import org.eclipse.aether.internal.impl.filter.DefaultRemoteRepositoryFilterManager; 088import org.eclipse.aether.internal.impl.filter.GroupIdRemoteRepositoryFilterSource; 089import org.eclipse.aether.internal.impl.filter.PrefixesRemoteRepositoryFilterSource; 090import org.eclipse.aether.internal.impl.resolution.TrustedChecksumsArtifactResolverPostProcessor; 091import org.eclipse.aether.internal.impl.slf4j.Slf4jLoggerFactory; 092import org.eclipse.aether.internal.impl.synccontext.DefaultSyncContextFactory; 093import org.eclipse.aether.internal.impl.synccontext.named.NameMapper; 094import org.eclipse.aether.internal.impl.synccontext.named.NameMappers; 095import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactory; 096import org.eclipse.aether.internal.impl.synccontext.named.NamedLockFactoryAdapterFactoryImpl; 097import org.eclipse.aether.internal.impl.synccontext.named.providers.DiscriminatingNameMapperProvider; 098import org.eclipse.aether.internal.impl.synccontext.named.providers.FileGAVNameMapperProvider; 099import org.eclipse.aether.internal.impl.synccontext.named.providers.FileHashingGAVNameMapperProvider; 100import org.eclipse.aether.internal.impl.synccontext.named.providers.GAVNameMapperProvider; 101import org.eclipse.aether.internal.impl.synccontext.named.providers.StaticNameMapperProvider; 102import org.eclipse.aether.named.NamedLockFactory; 103import org.eclipse.aether.named.providers.FileLockNamedLockFactory; 104import org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory; 105import org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory; 106import org.eclipse.aether.named.providers.NoopNamedLockFactory; 107import org.eclipse.aether.spi.checksums.ProvidedChecksumsSource; 108import org.eclipse.aether.spi.checksums.TrustedChecksumsSource; 109import org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactory; 110import org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactorySelector; 111import org.eclipse.aether.spi.connector.checksum.ChecksumPolicyProvider; 112import org.eclipse.aether.spi.connector.filter.RemoteRepositoryFilterSource; 113import org.eclipse.aether.spi.connector.layout.RepositoryLayoutFactory; 114import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider; 115import org.eclipse.aether.spi.connector.transport.TransporterProvider; 116import org.eclipse.aether.spi.io.FileProcessor; 117import org.eclipse.aether.spi.localrepo.LocalRepositoryManagerFactory; 118import org.eclipse.aether.spi.log.LoggerFactory; 119import org.eclipse.aether.spi.resolution.ArtifactResolverPostProcessor; 120import org.eclipse.aether.spi.synccontext.SyncContextFactory; 121import org.slf4j.ILoggerFactory; 122 123/** 124 * A ready-made <a href="https://github.com/google/guice" target="_blank">Guice</a> module that sets up bindings 125 * for all components from this library. To acquire a complete repository system, clients need to bind an artifact 126 * descriptor reader, a version resolver, a version range resolver, zero or more metadata generator factories, some 127 * repository connector and transporter factories to access remote repositories. 128 * 129 * @noextend This class must not be extended by clients and will eventually be marked {@code final} without prior 130 * notice. 131 * @deprecated This class is about to be dropped in 2.0.0 release. Use SISU or use maven-resolver-supplier to 132 * get Resolver instances. 133 */ 134@Deprecated 135public class AetherModule extends AbstractModule { 136 137 /** 138 * Creates a new instance of this Guice module, typically for invoking 139 * {@link com.google.inject.Binder#install(com.google.inject.Module)}. 140 */ 141 public AetherModule() {} 142 143 /** 144 * Configures Guice with bindings for Aether components provided by this library. 145 */ 146 // CHECKSTYLE_OFF: MethodLength 147 @Override 148 protected void configure() { 149 bind(RepositorySystem.class) // 150 .to(DefaultRepositorySystem.class) 151 .in(Singleton.class); 152 bind(ArtifactResolver.class) // 153 .to(DefaultArtifactResolver.class) 154 .in(Singleton.class); 155 156 bind(DependencyCollector.class) // 157 .to(DefaultDependencyCollector.class) 158 .in(Singleton.class); 159 bind(DependencyCollectorDelegate.class) 160 .annotatedWith(Names.named(BfDependencyCollector.NAME)) 161 .to(BfDependencyCollector.class) 162 .in(Singleton.class); 163 bind(DependencyCollectorDelegate.class) 164 .annotatedWith(Names.named(DfDependencyCollector.NAME)) 165 .to(DfDependencyCollector.class) 166 .in(Singleton.class); 167 168 bind(Deployer.class) // 169 .to(DefaultDeployer.class) 170 .in(Singleton.class); 171 bind(Installer.class) // 172 .to(DefaultInstaller.class) 173 .in(Singleton.class); 174 bind(MetadataResolver.class) // 175 .to(DefaultMetadataResolver.class) 176 .in(Singleton.class); 177 bind(RepositoryLayoutProvider.class) // 178 .to(DefaultRepositoryLayoutProvider.class) 179 .in(Singleton.class); 180 bind(RepositoryLayoutFactory.class) 181 .annotatedWith(Names.named("maven2")) // 182 .to(Maven2RepositoryLayoutFactory.class) 183 .in(Singleton.class); 184 bind(TransporterProvider.class) // 185 .to(DefaultTransporterProvider.class) 186 .in(Singleton.class); 187 bind(ChecksumPolicyProvider.class) // 188 .to(DefaultChecksumPolicyProvider.class) 189 .in(Singleton.class); 190 bind(RepositoryConnectorProvider.class) // 191 .to(DefaultRepositoryConnectorProvider.class) 192 .in(Singleton.class); 193 bind(RemoteRepositoryManager.class) // 194 .to(DefaultRemoteRepositoryManager.class) 195 .in(Singleton.class); 196 bind(UpdateCheckManager.class) // 197 .to(DefaultUpdateCheckManager.class) 198 .in(Singleton.class); 199 bind(UpdatePolicyAnalyzer.class) // 200 .to(DefaultUpdatePolicyAnalyzer.class) 201 .in(Singleton.class); 202 bind(FileProcessor.class) // 203 .to(DefaultFileProcessor.class) 204 .in(Singleton.class); 205 bind(RepositoryEventDispatcher.class) // 206 .to(DefaultRepositoryEventDispatcher.class) 207 .in(Singleton.class); 208 bind(OfflineController.class) // 209 .to(DefaultOfflineController.class) 210 .in(Singleton.class); 211 212 bind(LocalPathComposer.class).to(DefaultLocalPathComposer.class).in(Singleton.class); 213 bind(LocalPathPrefixComposerFactory.class) 214 .to(DefaultLocalPathPrefixComposerFactory.class) 215 .in(Singleton.class); 216 217 bind(LocalRepositoryProvider.class) // 218 .to(DefaultLocalRepositoryProvider.class) 219 .in(Singleton.class); 220 bind(LocalRepositoryManagerFactory.class) 221 .annotatedWith(Names.named("simple")) // 222 .to(SimpleLocalRepositoryManagerFactory.class) 223 .in(Singleton.class); 224 bind(LocalRepositoryManagerFactory.class) 225 .annotatedWith(Names.named("enhanced")) // 226 .to(EnhancedLocalRepositoryManagerFactory.class) 227 .in(Singleton.class); 228 bind(TrackingFileManager.class).to(DefaultTrackingFileManager.class).in(Singleton.class); 229 230 bind(ProvidedChecksumsSource.class) 231 .annotatedWith(Names.named(TrustedToProvidedChecksumsSourceAdapter.NAME)) 232 .to(TrustedToProvidedChecksumsSourceAdapter.class) 233 .in(Singleton.class); 234 235 bind(TrustedChecksumsSource.class) 236 .annotatedWith(Names.named(SparseDirectoryTrustedChecksumsSource.NAME)) 237 .to(SparseDirectoryTrustedChecksumsSource.class) 238 .in(Singleton.class); 239 bind(TrustedChecksumsSource.class) 240 .annotatedWith(Names.named(SummaryFileTrustedChecksumsSource.NAME)) 241 .to(SummaryFileTrustedChecksumsSource.class) 242 .in(Singleton.class); 243 244 bind(ArtifactResolverPostProcessor.class) 245 .annotatedWith(Names.named(TrustedChecksumsArtifactResolverPostProcessor.NAME)) 246 .to(TrustedChecksumsArtifactResolverPostProcessor.class) 247 .in(Singleton.class); 248 249 bind(ChecksumAlgorithmFactory.class) 250 .annotatedWith(Names.named(Md5ChecksumAlgorithmFactory.NAME)) 251 .to(Md5ChecksumAlgorithmFactory.class); 252 bind(ChecksumAlgorithmFactory.class) 253 .annotatedWith(Names.named(Sha1ChecksumAlgorithmFactory.NAME)) 254 .to(Sha1ChecksumAlgorithmFactory.class); 255 bind(ChecksumAlgorithmFactory.class) 256 .annotatedWith(Names.named(Sha256ChecksumAlgorithmFactory.NAME)) 257 .to(Sha256ChecksumAlgorithmFactory.class); 258 bind(ChecksumAlgorithmFactory.class) 259 .annotatedWith(Names.named(Sha512ChecksumAlgorithmFactory.NAME)) 260 .to(Sha512ChecksumAlgorithmFactory.class); 261 bind(ChecksumAlgorithmFactorySelector.class) 262 .to(DefaultChecksumAlgorithmFactorySelector.class) 263 .in(Singleton.class); 264 265 bind(RepositorySystemLifecycle.class) 266 .to(DefaultRepositorySystemLifecycle.class) 267 .in(Singleton.class); 268 269 bind(NamedLockFactoryAdapterFactory.class) 270 .to(NamedLockFactoryAdapterFactoryImpl.class) 271 .in(Singleton.class); 272 bind(SyncContextFactory.class).to(DefaultSyncContextFactory.class).in(Singleton.class); 273 bind(org.eclipse.aether.impl.SyncContextFactory.class) 274 .to(org.eclipse.aether.internal.impl.synccontext.legacy.DefaultSyncContextFactory.class) 275 .in(Singleton.class); 276 277 bind(NameMapper.class) 278 .annotatedWith(Names.named(NameMappers.STATIC_NAME)) 279 .toProvider(StaticNameMapperProvider.class) 280 .in(Singleton.class); 281 bind(NameMapper.class) 282 .annotatedWith(Names.named(NameMappers.GAV_NAME)) 283 .toProvider(GAVNameMapperProvider.class) 284 .in(Singleton.class); 285 bind(NameMapper.class) 286 .annotatedWith(Names.named(NameMappers.DISCRIMINATING_NAME)) 287 .toProvider(DiscriminatingNameMapperProvider.class) 288 .in(Singleton.class); 289 bind(NameMapper.class) 290 .annotatedWith(Names.named(NameMappers.FILE_GAV_NAME)) 291 .toProvider(FileGAVNameMapperProvider.class) 292 .in(Singleton.class); 293 bind(NameMapper.class) 294 .annotatedWith(Names.named(NameMappers.FILE_HGAV_NAME)) 295 .toProvider(FileHashingGAVNameMapperProvider.class) 296 .in(Singleton.class); 297 298 bind(NamedLockFactory.class) 299 .annotatedWith(Names.named(NoopNamedLockFactory.NAME)) 300 .to(NoopNamedLockFactory.class) 301 .in(Singleton.class); 302 bind(NamedLockFactory.class) 303 .annotatedWith(Names.named(LocalReadWriteLockNamedLockFactory.NAME)) 304 .to(LocalReadWriteLockNamedLockFactory.class) 305 .in(Singleton.class); 306 bind(NamedLockFactory.class) 307 .annotatedWith(Names.named(LocalSemaphoreNamedLockFactory.NAME)) 308 .to(LocalSemaphoreNamedLockFactory.class) 309 .in(Singleton.class); 310 bind(NamedLockFactory.class) 311 .annotatedWith(Names.named(FileLockNamedLockFactory.NAME)) 312 .to(FileLockNamedLockFactory.class) 313 .in(Singleton.class); 314 315 bind(RemoteRepositoryFilterManager.class) 316 .to(DefaultRemoteRepositoryFilterManager.class) 317 .in(Singleton.class); 318 bind(RemoteRepositoryFilterSource.class) 319 .annotatedWith(Names.named(GroupIdRemoteRepositoryFilterSource.NAME)) 320 .to(GroupIdRemoteRepositoryFilterSource.class) 321 .in(Singleton.class); 322 bind(RemoteRepositoryFilterSource.class) 323 .annotatedWith(Names.named(PrefixesRemoteRepositoryFilterSource.NAME)) 324 .to(PrefixesRemoteRepositoryFilterSource.class) 325 .in(Singleton.class); 326 327 install(new Slf4jModule()); 328 } 329 330 @Provides 331 @Singleton 332 Map<String, RemoteRepositoryFilterSource> remoteRepositoryFilterSources( 333 @Named(GroupIdRemoteRepositoryFilterSource.NAME) RemoteRepositoryFilterSource groupId, 334 @Named(PrefixesRemoteRepositoryFilterSource.NAME) RemoteRepositoryFilterSource prefixes) { 335 Map<String, RemoteRepositoryFilterSource> result = new HashMap<>(); 336 result.put(GroupIdRemoteRepositoryFilterSource.NAME, groupId); 337 result.put(PrefixesRemoteRepositoryFilterSource.NAME, prefixes); 338 return Collections.unmodifiableMap(result); 339 } 340 341 @Provides 342 @Singleton 343 Map<String, ArtifactResolverPostProcessor> artifactResolverProcessors( 344 @Named(TrustedChecksumsArtifactResolverPostProcessor.NAME) ArtifactResolverPostProcessor trustedChecksums) { 345 Map<String, ArtifactResolverPostProcessor> result = new HashMap<>(); 346 result.put(TrustedChecksumsArtifactResolverPostProcessor.NAME, trustedChecksums); 347 return Collections.unmodifiableMap(result); 348 } 349 350 @Provides 351 @Singleton 352 Map<String, DependencyCollectorDelegate> dependencyCollectorDelegates( 353 @Named(BfDependencyCollector.NAME) DependencyCollectorDelegate bf, 354 @Named(DfDependencyCollector.NAME) DependencyCollectorDelegate df) { 355 Map<String, DependencyCollectorDelegate> result = new HashMap<>(); 356 result.put(BfDependencyCollector.NAME, bf); 357 result.put(DfDependencyCollector.NAME, df); 358 return Collections.unmodifiableMap(result); 359 } 360 361 @Provides 362 @Singleton 363 Map<String, ProvidedChecksumsSource> providedChecksumSources( 364 @Named(TrustedToProvidedChecksumsSourceAdapter.NAME) ProvidedChecksumsSource adapter) { 365 Map<String, ProvidedChecksumsSource> result = new HashMap<>(); 366 result.put(TrustedToProvidedChecksumsSourceAdapter.NAME, adapter); 367 return Collections.unmodifiableMap(result); 368 } 369 370 @Provides 371 @Singleton 372 Map<String, TrustedChecksumsSource> trustedChecksumSources( 373 @Named(SparseDirectoryTrustedChecksumsSource.NAME) TrustedChecksumsSource sparse, 374 @Named(SummaryFileTrustedChecksumsSource.NAME) TrustedChecksumsSource compact) { 375 Map<String, TrustedChecksumsSource> result = new HashMap<>(); 376 result.put(SparseDirectoryTrustedChecksumsSource.NAME, sparse); 377 result.put(SummaryFileTrustedChecksumsSource.NAME, compact); 378 return Collections.unmodifiableMap(result); 379 } 380 381 @Provides 382 @Singleton 383 Map<String, ChecksumAlgorithmFactory> provideChecksumTypes( 384 @Named(Sha512ChecksumAlgorithmFactory.NAME) ChecksumAlgorithmFactory sha512, 385 @Named(Sha256ChecksumAlgorithmFactory.NAME) ChecksumAlgorithmFactory sha256, 386 @Named(Sha1ChecksumAlgorithmFactory.NAME) ChecksumAlgorithmFactory sha1, 387 @Named(Md5ChecksumAlgorithmFactory.NAME) ChecksumAlgorithmFactory md5) { 388 Map<String, ChecksumAlgorithmFactory> result = new HashMap<>(); 389 result.put(Sha512ChecksumAlgorithmFactory.NAME, sha512); 390 result.put(Sha256ChecksumAlgorithmFactory.NAME, sha256); 391 result.put(Sha1ChecksumAlgorithmFactory.NAME, sha1); 392 result.put(Md5ChecksumAlgorithmFactory.NAME, md5); 393 return Collections.unmodifiableMap(result); 394 } 395 396 @Provides 397 @Singleton 398 Map<String, NameMapper> provideNameMappers( 399 @Named(NameMappers.STATIC_NAME) NameMapper staticNameMapper, 400 @Named(NameMappers.GAV_NAME) NameMapper gavNameMapper, 401 @Named(NameMappers.DISCRIMINATING_NAME) NameMapper discriminatingNameMapper, 402 @Named(NameMappers.FILE_GAV_NAME) NameMapper fileGavNameMapper, 403 @Named(NameMappers.FILE_HGAV_NAME) NameMapper fileHashingGavNameMapper) { 404 Map<String, NameMapper> result = new HashMap<>(); 405 result.put(NameMappers.STATIC_NAME, staticNameMapper); 406 result.put(NameMappers.GAV_NAME, gavNameMapper); 407 result.put(NameMappers.DISCRIMINATING_NAME, discriminatingNameMapper); 408 result.put(NameMappers.FILE_GAV_NAME, fileGavNameMapper); 409 result.put(NameMappers.FILE_HGAV_NAME, fileHashingGavNameMapper); 410 return Collections.unmodifiableMap(result); 411 } 412 413 @Provides 414 @Singleton 415 Map<String, NamedLockFactory> provideNamedLockFactories( 416 @Named(LocalReadWriteLockNamedLockFactory.NAME) NamedLockFactory localRwLock, 417 @Named(LocalSemaphoreNamedLockFactory.NAME) NamedLockFactory localSemaphore, 418 @Named(FileLockNamedLockFactory.NAME) NamedLockFactory fileLockFactory) { 419 Map<String, NamedLockFactory> result = new HashMap<>(); 420 result.put(LocalReadWriteLockNamedLockFactory.NAME, localRwLock); 421 result.put(LocalSemaphoreNamedLockFactory.NAME, localSemaphore); 422 result.put(FileLockNamedLockFactory.NAME, fileLockFactory); 423 return Collections.unmodifiableMap(result); 424 } 425 426 @Provides 427 @Singleton 428 Set<LocalRepositoryManagerFactory> provideLocalRepositoryManagerFactories( 429 @Named("simple") LocalRepositoryManagerFactory simple, 430 @Named("enhanced") LocalRepositoryManagerFactory enhanced) { 431 Set<LocalRepositoryManagerFactory> result = new HashSet<>(); 432 result.add(simple); 433 result.add(enhanced); 434 return Collections.unmodifiableSet(result); 435 } 436 437 @Provides 438 @Singleton 439 Set<RepositoryLayoutFactory> provideRepositoryLayoutFactories(@Named("maven2") RepositoryLayoutFactory maven2) { 440 Set<RepositoryLayoutFactory> result = new HashSet<>(); 441 result.add(maven2); 442 return Collections.unmodifiableSet(result); 443 } 444 445 @Provides 446 @Singleton 447 Set<RepositoryListener> providesRepositoryListeners() { 448 return Collections.emptySet(); 449 } 450 451 private static class Slf4jModule extends AbstractModule { 452 453 @Override 454 protected void configure() { 455 bind(LoggerFactory.class) // 456 .to(Slf4jLoggerFactory.class); 457 } 458 459 @Provides 460 @Singleton 461 ILoggerFactory getLoggerFactory() { 462 return org.slf4j.LoggerFactory.getILoggerFactory(); 463 } 464 } 465}