You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2023/02/20 09:02:37 UTC
[maven-resolver] branch master updated: [MRESOLVER-311] Upgrade Parent to 39 (#250)
This is an automated email from the ASF dual-hosted git repository.
cstamas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
The following commit(s) were added to refs/heads/master by this push:
new 97dfd1c2 [MRESOLVER-311] Upgrade Parent to 39 (#250)
97dfd1c2 is described below
commit 97dfd1c2b9deb15734d5e401807e55cd0498332a
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Mon Feb 20 10:02:32 2023 +0100
[MRESOLVER-311] Upgrade Parent to 39 (#250)
No code change, only formatting applied. Two key plugins install/deploy upped to latest 3.1.0. Followup commit with git-blame-ignore-revs incoming.
---
https://issues.apache.org/jira/browse/MRESOLVER-311
---
maven-resolver-api/pom.xml | 6 +-
.../AbstractForwardingRepositorySystemSession.java | 91 +-
.../eclipse/aether/AbstractRepositoryListener.java | 94 +-
.../eclipse/aether/ConfigurationProperties.java | 32 +-
.../org/eclipse/aether/DefaultRepositoryCache.java | 35 +-
.../aether/DefaultRepositorySystemSession.java | 382 ++---
.../org/eclipse/aether/DefaultSessionData.java | 74 +-
.../org/eclipse/aether/MultiRuntimeException.java | 34 +-
.../java/org/eclipse/aether/RepositoryCache.java | 23 +-
.../java/org/eclipse/aether/RepositoryEvent.java | 166 +--
.../org/eclipse/aether/RepositoryException.java | 37 +-
.../org/eclipse/aether/RepositoryListener.java | 91 +-
.../java/org/eclipse/aether/RepositorySystem.java | 48 +-
.../eclipse/aether/RepositorySystemSession.java | 64 +-
.../main/java/org/eclipse/aether/RequestTrace.java | 61 +-
.../main/java/org/eclipse/aether/SessionData.java | 29 +-
.../main/java/org/eclipse/aether/SyncContext.java | 24 +-
.../eclipse/aether/artifact/AbstractArtifact.java | 173 +--
.../java/org/eclipse/aether/artifact/Artifact.java | 49 +-
.../aether/artifact/ArtifactProperties.java | 20 +-
.../org/eclipse/aether/artifact/ArtifactType.java | 23 +-
.../aether/artifact/ArtifactTypeRegistry.java | 19 +-
.../eclipse/aether/artifact/DefaultArtifact.java | 214 ++-
.../aether/artifact/DefaultArtifactType.java | 97 +-
.../org/eclipse/aether/artifact/package-info.java | 5 +-
.../eclipse/aether/collection/CollectRequest.java | 186 +--
.../eclipse/aether/collection/CollectResult.java | 77 +-
.../eclipse/aether/collection/CollectStepData.java | 8 +-
.../collection/DependencyCollectionContext.java | 23 +-
.../collection/DependencyCollectionException.java | 60 +-
.../DependencyGraphTransformationContext.java | 25 +-
.../collection/DependencyGraphTransformer.java | 21 +-
.../aether/collection/DependencyManagement.java | 68 +-
.../aether/collection/DependencyManager.java | 23 +-
.../aether/collection/DependencySelector.java | 23 +-
.../aether/collection/DependencyTraverser.java | 23 +-
.../UnsolvableVersionConflictException.java | 88 +-
.../eclipse/aether/collection/VersionFilter.java | 47 +-
.../eclipse/aether/collection/package-info.java | 5 +-
.../eclipse/aether/deployment/DeployRequest.java | 102 +-
.../eclipse/aether/deployment/DeployResult.java | 89 +-
.../aether/deployment/DeploymentException.java | 28 +-
.../eclipse/aether/deployment/package-info.java | 5 +-
.../aether/graph/DefaultDependencyNode.java | 248 ++--
.../java/org/eclipse/aether/graph/Dependency.java | 203 ++-
.../org/eclipse/aether/graph/DependencyCycle.java | 19 +-
.../org/eclipse/aether/graph/DependencyFilter.java | 17 +-
.../org/eclipse/aether/graph/DependencyNode.java | 79 +-
.../eclipse/aether/graph/DependencyVisitor.java | 23 +-
.../java/org/eclipse/aether/graph/Exclusion.java | 62 +-
.../org/eclipse/aether/graph/package-info.java | 5 +-
.../aether/installation/InstallRequest.java | 92 +-
.../eclipse/aether/installation/InstallResult.java | 89 +-
.../aether/installation/InstallationException.java | 28 +-
.../eclipse/aether/installation/package-info.java | 5 +-
.../eclipse/aether/metadata/AbstractMetadata.java | 118 +-
.../eclipse/aether/metadata/DefaultMetadata.java | 120 +-
.../eclipse/aether/metadata/MergeableMetadata.java | 21 +-
.../java/org/eclipse/aether/metadata/Metadata.java | 44 +-
.../org/eclipse/aether/metadata/package-info.java | 5 +-
.../main/java/org/eclipse/aether/package-info.java | 5 +-
.../aether/repository/ArtifactRepository.java | 19 +-
.../eclipse/aether/repository/Authentication.java | 21 +-
.../aether/repository/AuthenticationContext.java | 207 ++-
.../aether/repository/AuthenticationDigest.java | 141 +-
.../aether/repository/AuthenticationSelector.java | 19 +-
.../repository/LocalArtifactRegistration.java | 73 +-
.../aether/repository/LocalArtifactRequest.java | 71 +-
.../aether/repository/LocalArtifactResult.java | 57 +-
.../repository/LocalMetadataRegistration.java | 73 +-
.../aether/repository/LocalMetadataRequest.java | 64 +-
.../aether/repository/LocalMetadataResult.java | 45 +-
.../eclipse/aether/repository/LocalRepository.java | 70 +-
.../aether/repository/LocalRepositoryManager.java | 49 +-
.../eclipse/aether/repository/MirrorSelector.java | 19 +-
.../NoLocalRepositoryManagerException.java | 61 +-
.../java/org/eclipse/aether/repository/Proxy.java | 80 +-
.../eclipse/aether/repository/ProxySelector.java | 19 +-
.../aether/repository/RemoteRepository.java | 442 +++---
.../aether/repository/RepositoryPolicy.java | 72 +-
.../eclipse/aether/repository/WorkspaceReader.java | 25 +-
.../aether/repository/WorkspaceRepository.java | 63 +-
.../eclipse/aether/repository/package-info.java | 5 +-
.../resolution/ArtifactDescriptorException.java | 52 +-
.../resolution/ArtifactDescriptorPolicy.java | 19 +-
.../ArtifactDescriptorPolicyRequest.java | 54 +-
.../resolution/ArtifactDescriptorRequest.java | 94 +-
.../resolution/ArtifactDescriptorResult.java | 248 ++--
.../eclipse/aether/resolution/ArtifactRequest.java | 120 +-
.../resolution/ArtifactResolutionException.java | 120 +-
.../eclipse/aether/resolution/ArtifactResult.java | 83 +-
.../aether/resolution/DependencyRequest.java | 86 +-
.../resolution/DependencyResolutionException.java | 42 +-
.../aether/resolution/DependencyResult.java | 94 +-
.../eclipse/aether/resolution/MetadataRequest.java | 101 +-
.../eclipse/aether/resolution/MetadataResult.java | 72 +-
.../aether/resolution/ResolutionErrorPolicy.java | 23 +-
.../resolution/ResolutionErrorPolicyRequest.java | 50 +-
.../aether/resolution/VersionRangeRequest.java | 94 +-
.../VersionRangeResolutionException.java | 66 +-
.../aether/resolution/VersionRangeResult.java | 128 +-
.../eclipse/aether/resolution/VersionRequest.java | 94 +-
.../resolution/VersionResolutionException.java | 66 +-
.../eclipse/aether/resolution/VersionResult.java | 67 +-
.../eclipse/aether/resolution/package-info.java | 5 +-
.../aether/transfer/AbstractTransferListener.java | 46 +-
.../aether/transfer/ArtifactNotFoundException.java | 70 +-
.../aether/transfer/ArtifactTransferException.java | 75 +-
.../aether/transfer/ChecksumFailureException.java | 76 +-
.../aether/transfer/MetadataNotFoundException.java | 61 +-
.../aether/transfer/MetadataTransferException.java | 75 +-
.../transfer/NoRepositoryConnectorException.java | 59 +-
.../transfer/NoRepositoryLayoutException.java | 57 +-
.../aether/transfer/NoTransporterException.java | 57 +-
.../transfer/RepositoryOfflineException.java | 43 +-
.../transfer/TransferCancelledException.java | 33 +-
.../org/eclipse/aether/transfer/TransferEvent.java | 155 +-
.../eclipse/aether/transfer/TransferListener.java | 47 +-
.../eclipse/aether/transfer/TransferResource.java | 92 +-
.../org/eclipse/aether/transfer/package-info.java | 5 +-
.../eclipse/aether/transform/FileTransformer.java | 27 +-
.../aether/transform/FileTransformerManager.java | 22 +-
.../aether/transform/TransformException.java | 30 +-
.../InvalidVersionSpecificationException.java | 40 +-
.../java/org/eclipse/aether/version/Version.java | 16 +-
.../eclipse/aether/version/VersionConstraint.java | 21 +-
.../org/eclipse/aether/version/VersionRange.java | 60 +-
.../org/eclipse/aether/version/VersionScheme.java | 28 +-
.../org/eclipse/aether/version/package-info.java | 5 +-
...tractForwardingRepositorySystemSessionTest.java | 31 +-
.../aether/AbstractRepositoryListenerTest.java | 30 +-
.../eclipse/aether/DefaultRepositoryCacheTest.java | 97 +-
.../aether/DefaultRepositorySystemSessionTest.java | 136 +-
.../org/eclipse/aether/DefaultSessionDataTest.java | 153 +-
.../eclipse/aether/RepositoryExceptionTest.java | 171 +--
.../java/org/eclipse/aether/RequestTraceTest.java | 56 +-
.../aether/artifact/DefaultArtifactTest.java | 257 ++--
.../org/eclipse/aether/graph/DependencyTest.java | 67 +-
.../repository/AuthenticationContextTest.java | 183 ++-
.../repository/AuthenticationDigestTest.java | 149 +-
.../repository/RemoteRepositoryBuilderTest.java | 214 ++-
.../aether/repository/RemoteRepositoryTest.java | 96 +-
.../transfer/AbstractTransferListenerTest.java | 30 +-
.../eclipse/aether/transfer/TransferEventTest.java | 68 +-
maven-resolver-connector-basic/pom.xml | 12 +-
.../connector/basic/ArtifactTransportListener.java | 39 +-
.../connector/basic/BasicRepositoryConnector.java | 620 ++++----
.../basic/BasicRepositoryConnectorFactory.java | 114 +-
.../aether/connector/basic/ChecksumCalculator.java | 117 +-
.../aether/connector/basic/ChecksumValidator.java | 204 ++-
.../connector/basic/MetadataTransportListener.java | 39 +-
.../connector/basic/TransferTransportListener.java | 109 +-
.../aether/connector/basic/package-info.java | 5 +-
.../connector/basic/ChecksumCalculatorTest.java | 192 ++-
.../connector/basic/ChecksumValidatorTest.java | 461 +++---
.../basic/TestChecksumAlgorithmSelector.java | 85 +-
.../maven-resolver-demo-maven-plugin/pom.xml | 6 +-
.../examples/maven/ResolveArtifactMojo.java | 63 +-
.../maven-resolver-demo-snippets/pom.xml | 8 +-
.../src/main/java/TestNioLock.java | 196 ---
.../src/main/java/demo/TestNioLock.java | 164 +++
.../maven/resolver/examples/AllResolverDemos.java | 41 +-
.../maven/resolver/examples/DeployArtifacts.java | 49 +-
.../resolver/examples/FindAvailableVersions.java | 35 +-
.../maven/resolver/examples/FindNewestVersion.java | 37 +-
.../resolver/examples/GetDependencyHierarchy.java | 49 +-
.../maven/resolver/examples/GetDependencyTree.java | 35 +-
.../resolver/examples/GetDirectDependencies.java | 38 +-
.../maven/resolver/examples/InstallArtifacts.java | 37 +-
.../maven/resolver/examples/ResolveArtifact.java | 47 +-
.../examples/ResolveTransitiveDependencies.java | 44 +-
.../resolver/examples/ReverseDependencyTree.java | 53 +-
.../examples/guice/DemoResolverModule.java | 97 +-
.../guice/GuiceRepositorySystemFactory.java | 21 +-
.../manual/ManualRepositorySystemFactory.java | 33 +-
.../maven/resolver/examples/resolver/Resolver.java | 97 +-
.../resolver/examples/resolver/ResolverDemo.java | 85 +-
.../resolver/examples/resolver/ResolverResult.java | 26 +-
.../sisu/SisuRepositorySystemDemoModule.java | 31 +-
.../examples/sisu/SisuRepositorySystemFactory.java | 29 +-
.../maven/resolver/examples/util/Booter.java | 52 +-
.../util/ConsoleDependencyGraphDumper.java | 120 +-
.../examples/util/ConsoleRepositoryListener.java | 145 +-
.../examples/util/ConsoleTransferListener.java | 154 +-
.../util/ReverseTreeRepositoryListener.java | 69 +-
.../resolver/examples/AllResolverDemosTest.java | 14 +-
maven-resolver-demos/pom.xml | 14 +-
maven-resolver-impl/pom.xml | 6 +-
.../aether/impl/ArtifactDescriptorReader.java | 22 +-
.../org/eclipse/aether/impl/ArtifactResolver.java | 29 +-
.../eclipse/aether/impl/DefaultServiceLocator.java | 263 ++--
.../eclipse/aether/impl/DependencyCollector.java | 21 +-
.../java/org/eclipse/aether/impl/Deployer.java | 20 +-
.../java/org/eclipse/aether/impl/Installer.java | 20 +-
.../aether/impl/LocalRepositoryProvider.java | 21 +-
.../org/eclipse/aether/impl/MetadataGenerator.java | 27 +-
.../aether/impl/MetadataGeneratorFactory.java | 25 +-
.../org/eclipse/aether/impl/MetadataResolver.java | 21 +-
.../org/eclipse/aether/impl/OfflineController.java | 20 +-
.../aether/impl/RemoteRepositoryFilterManager.java | 10 +-
.../aether/impl/RemoteRepositoryManager.java | 32 +-
.../aether/impl/RepositoryConnectorProvider.java | 21 +-
.../aether/impl/RepositoryEventDispatcher.java | 19 +-
.../aether/impl/RepositorySystemLifecycle.java | 10 +-
.../eclipse/aether/impl/SyncContextFactory.java | 13 +-
.../java/org/eclipse/aether/impl/UpdateCheck.java | 112 +-
.../eclipse/aether/impl/UpdateCheckManager.java | 31 +-
.../eclipse/aether/impl/UpdatePolicyAnalyzer.java | 23 +-
.../eclipse/aether/impl/VersionRangeResolver.java | 21 +-
.../org/eclipse/aether/impl/VersionResolver.java | 21 +-
.../eclipse/aether/impl/guice/AetherModule.java | 536 +++----
.../eclipse/aether/impl/guice/package-info.java | 5 +-
.../java/org/eclipse/aether/impl/package-info.java | 5 +-
.../internal/impl/AbstractChecksumPolicy.java | 50 +-
.../internal/impl/ArtifactRequestBuilder.java | 35 +-
.../internal/impl/DefaultArtifactResolver.java | 735 +++++-----
.../impl/DefaultChecksumPolicyProvider.java | 80 +-
.../aether/internal/impl/DefaultDeployer.java | 647 ++++-----
.../aether/internal/impl/DefaultFileProcessor.java | 110 +-
.../aether/internal/impl/DefaultInstaller.java | 405 +++---
.../internal/impl/DefaultLocalPathComposer.java | 84 +-
.../DefaultLocalPathPrefixComposerFactory.java | 57 +-
.../impl/DefaultLocalRepositoryProvider.java | 134 +-
.../internal/impl/DefaultMetadataResolver.java | 588 ++++----
.../internal/impl/DefaultOfflineController.java | 83 +-
.../impl/DefaultRemoteRepositoryManager.java | 350 ++---
.../impl/DefaultRepositoryConnectorProvider.java | 189 ++-
.../impl/DefaultRepositoryEventDispatcher.java | 130 +-
.../impl/DefaultRepositoryLayoutProvider.java | 111 +-
.../internal/impl/DefaultRepositorySystem.java | 471 +++----
.../impl/DefaultRepositorySystemLifecycle.java | 49 +-
.../internal/impl/DefaultTrackingFileManager.java | 95 +-
.../internal/impl/DefaultTransporterProvider.java | 126 +-
.../internal/impl/DefaultUpdateCheckManager.java | 603 ++++----
.../internal/impl/DefaultUpdatePolicyAnalyzer.java | 118 +-
.../impl/EnhancedLocalRepositoryManager.java | 232 ++-
.../EnhancedLocalRepositoryManagerFactory.java | 74 +-
.../aether/internal/impl/FailChecksumPolicy.java | 22 +-
.../aether/internal/impl/LocalPathComposer.java | 12 +-
.../internal/impl/LocalPathPrefixComposer.java | 16 +-
.../impl/LocalPathPrefixComposerFactory.java | 10 +-
.../LocalPathPrefixComposerFactorySupport.java | 148 +-
.../internal/impl/LoggerFactoryProvider.java | 21 +-
.../impl/Maven2RepositoryLayoutFactory.java | 204 ++-
.../aether/internal/impl/PrioritizedComponent.java | 47 +-
.../internal/impl/PrioritizedComponents.java | 114 +-
.../aether/internal/impl/SafeTransferListener.java | 160 +--
.../impl/SimpleLocalRepositoryManager.java | 175 +--
.../impl/SimpleLocalRepositoryManagerFactory.java | 51 +-
.../aether/internal/impl/TrackingFileManager.java | 12 +-
.../org/eclipse/aether/internal/impl/Utils.java | 88 +-
.../aether/internal/impl/WarnChecksumPolicy.java | 25 +-
.../DefaultChecksumAlgorithmFactorySelector.java | 77 +-
.../FileTrustedChecksumsSourceSupport.java | 86 +-
.../impl/checksum/Md5ChecksumAlgorithmFactory.java | 16 +-
...ssageDigestChecksumAlgorithmFactorySupport.java | 49 +-
.../checksum/Sha1ChecksumAlgorithmFactory.java | 16 +-
.../checksum/Sha256ChecksumAlgorithmFactory.java | 16 +-
.../checksum/Sha512ChecksumAlgorithmFactory.java | 16 +-
.../SparseDirectoryTrustedChecksumsSource.java | 126 +-
.../SummaryFileTrustedChecksumsSource.java | 248 ++--
.../TrustedToProvidedChecksumsSourceAdapter.java | 37 +-
.../impl/collect/CachingArtifactTypeRegistry.java | 39 +-
.../internal/impl/collect/CollectStepDataImpl.java | 26 +-
.../aether/internal/impl/collect/DataPool.java | 365 ++---
.../DefaultDependencyCollectionContext.java | 44 +-
.../impl/collect/DefaultDependencyCollector.java | 46 +-
.../impl/collect/DefaultDependencyCycle.java | 79 +-
...efaultDependencyGraphTransformationContext.java | 49 +-
.../impl/collect/DefaultVersionFilterContext.java | 54 +-
.../impl/collect/DependencyCollectorDelegate.java | 548 ++++----
.../impl/collect/PremanagedDependency.java | 121 +-
.../impl/collect/bf/BfDependencyCollector.java | 636 +++++----
.../collect/bf/DependencyProcessingContext.java | 58 +-
.../collect/bf/DependencyResolutionSkipper.java | 285 ++--
.../impl/collect/df/DfDependencyCollector.java | 443 +++---
.../aether/internal/impl/collect/df/NodeStack.java | 55 +-
.../aether/internal/impl/collect/package-info.java | 2 +-
.../DefaultRemoteRepositoryFilterManager.java | 102 +-
.../impl/filter/FilteringRepositoryConnector.java | 95 +-
.../GroupIdRemoteRepositoryFilterSource.java | 200 +--
.../PrefixesRemoteRepositoryFilterSource.java | 207 ++-
.../RemoteRepositoryFilterSourceSupport.java | 50 +-
.../eclipse/aether/internal/impl/package-info.java | 7 +-
.../ArtifactResolverPostProcessorSupport.java | 34 +-
...stedChecksumsArtifactResolverPostProcessor.java | 187 +--
.../internal/impl/slf4j/Slf4jLoggerFactory.java | 129 +-
.../synccontext/DefaultSyncContextFactory.java | 34 +-
.../legacy/DefaultSyncContextFactory.java | 33 +-
.../impl/synccontext/named/BasedirNameMapper.java | 42 +-
.../named/DiscriminatingNameMapper.java | 79 +-
.../impl/synccontext/named/GAVNameMapper.java | 91 +-
.../impl/synccontext/named/HashingNameMapper.java | 54 +-
.../impl/synccontext/named/NameMapper.java | 15 +-
.../impl/synccontext/named/NameMappers.java | 29 +-
.../synccontext/named/NamedLockFactoryAdapter.java | 153 +-
.../named/NamedLockFactoryAdapterFactory.java | 12 +-
.../named/NamedLockFactoryAdapterFactoryImpl.java | 170 +--
.../impl/synccontext/named/StaticNameMapper.java | 28 +-
.../DiscriminatingNameMapperProvider.java | 16 +-
.../named/providers/FileGAVNameMapperProvider.java | 16 +-
.../FileHashingGAVNameMapperProvider.java | 16 +-
.../named/providers/GAVNameMapperProvider.java | 16 +-
.../named/providers/StaticNameMapperProvider.java | 16 +-
.../synccontext/named/providers/package-info.java | 5 +-
.../aether/impl/DefaultServiceLocatorTest.java | 78 +-
.../aether/impl/StubArtifactDescriptorReader.java | 22 +-
.../aether/impl/StubVersionRangeResolver.java | 23 +-
.../eclipse/aether/impl/StubVersionResolver.java | 25 +-
.../aether/impl/guice/AetherModuleTest.java | 52 +-
.../internal/impl/DefaultArtifactResolverTest.java | 1053 ++++++--------
.../impl/DefaultChecksumPolicyProviderTest.java | 141 +-
.../aether/internal/impl/DefaultDeployerTest.java | 373 +++--
.../internal/impl/DefaultFileProcessorTest.java | 113 +-
.../aether/internal/impl/DefaultInstallerTest.java | 488 +++----
.../DefaultLocalPathPrefixComposerFactoryTest.java | 251 ++--
.../internal/impl/DefaultMetadataResolverTest.java | 398 +++---
.../impl/DefaultOfflineControllerTest.java | 86 +-
.../impl/DefaultRemoteRepositoryManagerTest.java | 337 ++---
.../impl/DefaultRepositoryEventDispatcherTest.java | 54 +-
.../internal/impl/DefaultRepositorySystemTest.java | 104 +-
.../impl/DefaultTrackingFileManagerTest.java | 87 +-
.../impl/DefaultUpdateCheckManagerTest.java | 770 +++++-----
.../impl/DefaultUpdatePolicyAnalyzerTest.java | 119 +-
.../internal/impl/DependencyGraphDumper.java | 171 +--
.../impl/EnhancedLocalRepositoryManagerTest.java | 390 +++---
.../EnhancedSplitLocalRepositoryManagerTest.java | 60 +-
.../internal/impl/FailChecksumPolicyTest.java | 99 +-
.../internal/impl/IniArtifactDescriptorReader.java | 21 +-
.../impl/Maven2RepositoryLayoutFactoryTest.java | 390 +++---
.../internal/impl/PrioritizedComponentTest.java | 75 +-
.../internal/impl/PrioritizedComponentsTest.java | 127 +-
.../impl/RecordingRepositoryConnector.java | 251 ++--
.../internal/impl/RecordingRepositoryListener.java | 155 +-
.../internal/impl/SafeTransferListenerTest.java | 26 +-
.../impl/SimpleLocalRepositoryManagerTest.java | 103 +-
.../internal/impl/StaticUpdateCheckManager.java | 74 +-
.../internal/impl/StubFileTransformerManager.java | 32 +-
.../internal/impl/StubRemoteRepositoryManager.java | 53 +-
.../impl/StubRepositoryConnectorProvider.java | 31 +-
.../impl/StubRepositoryEventDispatcher.java | 65 +-
.../internal/impl/StubSyncContextFactory.java | 34 +-
.../internal/impl/StubVersionRangeResolver.java | 65 +-
.../aether/internal/impl/StubVersionResolver.java | 30 +-
.../internal/impl/WarnChecksumPolicyTest.java | 99 +-
.../FileTrustedChecksumsSourceTestSupport.java | 77 +-
.../SparseDirectoryTrustedChecksumsSourceTest.java | 19 +-
.../SummaryFileTrustedChecksumsSourceTest.java | 18 +-
.../aether/internal/impl/collect/DataPoolTest.java | 74 +-
.../impl/collect/DefaultDependencyCycleTest.java | 23 +-
.../collect/DefaultVersionFilterContextTest.java | 159 +--
.../DependencyCollectorDelegateTestSupport.java | 690 +++++----
.../impl/collect/bf/BfDependencyCollectorTest.java | 83 +-
.../bf/DependencyResolutionSkipperTest.java | 269 ++--
.../impl/collect/df/DfDependencyCollectorTest.java | 19 +-
.../aether/internal/impl/filter/Filters.java | 112 +-
.../GroupIdRemoteRepositoryFilterSourceTest.java | 59 +-
.../PrefixesRemoteRepositoryFilterSourceTest.java | 52 +-
.../RemoteRepositoryFilterSourceTestSupport.java | 66 +-
...ChecksumsArtifactResolverPostProcessorTest.java | 179 ++-
.../impl/synccontext/FileLockAdapterTest.java | 14 +-
.../synccontext/LocalReadWriteLockAdapterTest.java | 9 +-
.../synccontext/LocalSemaphoreAdapterTest.java | 9 +-
.../NamedLockFactoryAdapterTestSupport.java | 86 +-
.../synccontext/named/BasedirNameMapperTest.java | 142 +-
.../impl/synccontext/named/GAVNameMapperTest.java | 64 +-
.../synccontext/named/HashingNameMapperTest.java | 127 +-
.../synccontext/named/NameMapperTestSupport.java | 19 +-
maven-resolver-named-locks-hazelcast/pom.xml | 6 +-
.../DirectHazelcastSemaphoreProvider.java | 16 +-
.../HazelcastCPSemaphoreNamedLockFactory.java | 21 +-
...HazelcastClientCPSemaphoreNamedLockFactory.java | 21 +-
.../HazelcastSemaphoreNamedLockFactory.java | 54 +-
.../hazelcast/HazelcastSemaphoreProvider.java | 12 +-
.../hazelcast/HazelcastCPSemaphoreAdapterIT.java | 17 +-
.../HazelcastCPSemaphoreNamedLockFactoryIT.java | 16 +-
.../HazelcastClientCPSemaphoreAdapterIT.java | 19 +-
...zelcastClientCPSemaphoreNamedLockFactoryIT.java | 19 +-
.../named/hazelcast/HazelcastClientUtils.java | 50 +-
.../NamedLockFactoryAdapterTestSupport.java | 208 ++-
.../hazelcast/NamedLockFactoryTestSupport.java | 160 +--
maven-resolver-named-locks-redisson/pom.xml | 6 +-
.../redisson/RedissonNamedLockFactorySupport.java | 85 +-
.../RedissonReadWriteLockNamedLockFactory.java | 24 +-
.../RedissonSemaphoreNamedLockFactory.java | 61 +-
maven-resolver-named-locks/pom.xml | 6 +-
.../java/org/eclipse/aether/named/NamedLock.java | 12 +-
.../org/eclipse/aether/named/NamedLockFactory.java | 10 +-
.../named/providers/FileLockNamedLockFactory.java | 140 +-
.../LocalReadWriteLockNamedLockFactory.java | 23 +-
.../providers/LocalSemaphoreNamedLockFactory.java | 43 +-
.../named/providers/NoopNamedLockFactory.java | 65 +-
.../named/support/AdaptedSemaphoreNamedLock.java | 72 +-
.../aether/named/support/FileLockNamedLock.java | 191 +--
.../named/support/NamedLockFactorySupport.java | 82 +-
.../aether/named/support/NamedLockSupport.java | 22 +-
.../named/support/ReadWriteLockNamedLock.java | 59 +-
.../org/eclipse/aether/named/support/Retry.java | 113 +-
.../named/FileLockNamedLockFactorySupportTest.java | 26 +-
.../LocalReadWriteLockNamedLockFactoryTest.java | 8 +-
.../named/LocalSemaphoreNamedLockFactoryTest.java | 8 +-
.../aether/named/NamedLockFactoryTestSupport.java | 44 +-
.../java/org/eclipse/aether/named/RetryTest.java | 113 +-
maven-resolver-spi/pom.xml | 6 +-
.../spi/checksums/TrustedChecksumsSource.java | 32 +-
.../aether/spi/connector/ArtifactDownload.java | 132 +-
.../aether/spi/connector/ArtifactTransfer.java | 49 +-
.../aether/spi/connector/ArtifactUpload.java | 89 +-
.../aether/spi/connector/MetadataDownload.java | 99 +-
.../aether/spi/connector/MetadataTransfer.java | 49 +-
.../aether/spi/connector/MetadataUpload.java | 54 +-
.../aether/spi/connector/RepositoryConnector.java | 29 +-
.../spi/connector/RepositoryConnectorFactory.java | 21 +-
.../org/eclipse/aether/spi/connector/Transfer.java | 40 +-
.../spi/connector/checksum/ChecksumAlgorithm.java | 10 +-
.../checksum/ChecksumAlgorithmFactory.java | 8 +-
.../checksum/ChecksumAlgorithmFactorySelector.java | 14 +-
.../checksum/ChecksumAlgorithmFactorySupport.java | 22 +-
.../checksum/ChecksumAlgorithmHelper.java | 55 +-
.../spi/connector/checksum/ChecksumPolicy.java | 23 +-
.../connector/checksum/ChecksumPolicyProvider.java | 25 +-
.../checksum/ProvidedChecksumsSource.java | 15 +-
.../spi/connector/checksum/package-info.java | 7 +-
.../connector/filter/RemoteRepositoryFilter.java | 15 +-
.../filter/RemoteRepositoryFilterSource.java | 10 +-
.../spi/connector/layout/RepositoryLayout.java | 71 +-
.../connector/layout/RepositoryLayoutFactory.java | 21 +-
.../connector/layout/RepositoryLayoutProvider.java | 21 +-
.../aether/spi/connector/layout/package-info.java | 7 +-
.../eclipse/aether/spi/connector/package-info.java | 9 +-
.../connector/transport/AbstractTransporter.java | 122 +-
.../aether/spi/connector/transport/GetTask.java | 152 +-
.../aether/spi/connector/transport/PeekTask.java | 26 +-
.../aether/spi/connector/transport/PutTask.java | 72 +-
.../spi/connector/transport/TransportListener.java | 35 +-
.../spi/connector/transport/TransportTask.java | 41 +-
.../spi/connector/transport/Transporter.java | 37 +-
.../connector/transport/TransporterFactory.java | 20 +-
.../connector/transport/TransporterProvider.java | 21 +-
.../spi/connector/transport/package-info.java | 7 +-
.../org/eclipse/aether/spi/io/FileProcessor.java | 55 +-
.../org/eclipse/aether/spi/io/package-info.java | 7 +-
.../localrepo/LocalRepositoryManagerFactory.java | 21 +-
.../eclipse/aether/spi/localrepo/package-info.java | 7 +-
.../org/eclipse/aether/spi/locator/Service.java | 17 +-
.../eclipse/aether/spi/locator/ServiceLocator.java | 25 +-
.../eclipse/aether/spi/locator/package-info.java | 5 +-
.../java/org/eclipse/aether/spi/log/Logger.java | 17 +-
.../org/eclipse/aether/spi/log/LoggerFactory.java | 11 +-
.../org/eclipse/aether/spi/log/NullLogger.java | 32 +-
.../eclipse/aether/spi/log/NullLoggerFactory.java | 27 +-
.../org/eclipse/aether/spi/log/package-info.java | 7 +-
.../resolution/ArtifactResolverPostProcessor.java | 10 +-
.../aether/spi/synccontext/SyncContextFactory.java | 17 +-
.../aether/spi/synccontext/package-info.java | 5 +-
.../spi/connector/layout/ChecksumLocationTest.java | 59 +-
maven-resolver-test-util/pom.xml | 6 +-
.../internal/test/util/ArtifactDefinition.java | 85 +-
.../internal/test/util/ArtifactDescription.java | 33 +-
.../internal/test/util/DependencyGraphParser.java | 390 ++----
.../internal/test/util/IniArtifactDataReader.java | 292 ++--
.../test/util/IniArtifactDescriptorReader.java | 85 +-
.../aether/internal/test/util/NodeBuilder.java | 89 +-
.../aether/internal/test/util/NodeDefinition.java | 76 +-
.../test/util/TestDependencyCollectionContext.java | 41 +-
.../TestDependencyGraphTransformationContext.java | 49 +-
.../internal/test/util/TestFileProcessor.java | 191 +--
.../aether/internal/test/util/TestFileUtils.java | 312 ++---
.../test/util/TestLocalRepositoryManager.java | 132 +-
.../internal/test/util/TestLoggerFactory.java | 69 +-
.../aether/internal/test/util/TestUtils.java | 52 +-
.../aether/internal/test/util/TestVersion.java | 52 +-
.../internal/test/util/TestVersionConstraint.java | 75 +-
.../test/util/TestVersionFilterContext.java | 46 +-
.../internal/test/util/TestVersionRange.java | 210 ++-
.../internal/test/util/TestVersionScheme.java | 93 +-
.../aether/internal/test/util/package-info.java | 5 +-
.../test/util/DependencyGraphParserTest.java | 263 ++--
.../test/util/IniArtifactDataReaderTest.java | 250 ++--
.../test/util/IniArtifactDescriptorReaderTest.java | 160 +--
.../internal/test/util/NodeDefinitionTest.java | 249 ++--
maven-resolver-transport-classpath/pom.xml | 6 +-
.../transport/classpath/ClasspathTransporter.java | 103 +-
.../classpath/ClasspathTransporterFactory.java | 33 +-
.../classpath/ResourceNotFoundException.java | 19 +-
.../aether/transport/classpath/package-info.java | 5 +-
.../classpath/ClasspathTransporterTest.java | 399 ++----
.../classpath/RecordingTransportListener.java | 28 +-
maven-resolver-transport-file/pom.xml | 6 +-
.../aether/transport/file/FileTransporter.java | 90 +-
.../transport/file/FileTransporterFactory.java | 32 +-
.../eclipse/aether/transport/file/PathUtils.java | 102 +-
.../transport/file/ResourceNotFoundException.java | 19 +-
.../aether/transport/file/package-info.java | 5 +-
.../aether/transport/file/FileTransporterTest.java | 582 ++++----
.../transport/file/RecordingTransportListener.java | 28 +-
maven-resolver-transport-http/pom.xml | 6 +-
.../aether/transport/http/AuthSchemePool.java | 37 +-
.../aether/transport/http/ChecksumExtractor.java | 24 +-
.../http/DeferredCredentialsProvider.java | 144 +-
.../transport/http/DemuxCredentialsProvider.java | 40 +-
.../eclipse/aether/transport/http/GlobalState.java | 187 +--
.../eclipse/aether/transport/http/HttpMkCol.java | 22 +-
.../aether/transport/http/HttpTransporter.java | 665 ++++-----
.../transport/http/HttpTransporterFactory.java | 48 +-
.../eclipse/aether/transport/http/LocalState.java | 104 +-
.../transport/http/Nexus2ChecksumExtractor.java | 39 +-
.../aether/transport/http/SharingAuthCache.java | 76 +-
.../aether/transport/http/SharingHttpContext.java | 59 +-
.../eclipse/aether/transport/http/SslConfig.java | 84 +-
.../eclipse/aether/transport/http/UriUtils.java | 57 +-
.../transport/http/XChecksumChecksumExtractor.java | 61 +-
.../aether/transport/http/package-info.java | 5 +-
.../eclipse/aether/transport/http/HttpServer.java | 520 +++----
.../aether/transport/http/HttpTransporterTest.java | 1477 +++++++++-----------
.../transport/http/RecordingTransportListener.java | 28 +-
.../aether/transport/http/UriUtilsTest.java | 144 +-
maven-resolver-transport-wagon/pom.xml | 6 +-
.../transport/wagon/PlexusWagonConfigurator.java | 73 +-
.../transport/wagon/PlexusWagonProvider.java | 50 +-
.../internal/transport/wagon/package-info.java | 5 +-
.../transport/wagon/WagonCancelledException.java | 25 +-
.../aether/transport/wagon/WagonConfigurator.java | 18 +-
.../aether/transport/wagon/WagonProvider.java | 22 +-
.../transport/wagon/WagonTransferListener.java | 43 +-
.../aether/transport/wagon/WagonTransporter.java | 492 +++----
.../transport/wagon/WagonTransporterFactory.java | 52 +-
.../aether/transport/wagon/package-info.java | 5 +-
.../wagon/AbstractWagonTransporterTest.java | 574 ++++----
.../aether/transport/wagon/Configurable.java | 15 +-
.../aether/transport/wagon/MemStreamWagon.java | 85 +-
.../eclipse/aether/transport/wagon/MemWagon.java | 177 +--
.../aether/transport/wagon/MemWagonUtils.java | 94 +-
.../aether/transport/wagon/PlexusSupportTest.java | 29 +-
.../wagon/RecordingTransportListener.java | 28 +-
.../wagon/StreamWagonTransporterTest.java | 17 +-
.../transport/wagon/WagonTransporterTest.java | 17 +-
maven-resolver-util/pom.xml | 6 +-
.../org/eclipse/aether/util/ChecksumUtils.java | 155 +-
.../java/org/eclipse/aether/util/ConfigUtils.java | 229 ++-
.../org/eclipse/aether/util/DirectoryUtils.java | 65 +-
.../java/org/eclipse/aether/util/FileUtils.java | 97 +-
.../org/eclipse/aether/util/StringDigestUtil.java | 45 +-
.../java/org/eclipse/aether/util/StringUtils.java | 21 +-
.../aether/util/artifact/ArtifactIdUtils.java | 182 +--
.../util/artifact/DefaultArtifactTypeRegistry.java | 25 +-
.../aether/util/artifact/DelegatingArtifact.java | 105 +-
.../eclipse/aether/util/artifact/JavaScopes.java | 18 +-
.../util/artifact/OverlayArtifactTypeRegistry.java | 36 +-
.../util/artifact/SimpleArtifactTypeRegistry.java | 32 +-
.../eclipse/aether/util/artifact/SubArtifact.java | 141 +-
.../eclipse/aether/util/artifact/package-info.java | 5 +-
.../aether/util/concurrency/ExecutorUtils.java | 63 +-
.../util/concurrency/RunnableErrorForwarder.java | 86 +-
.../util/concurrency/WorkerThreadFactory.java | 41 +-
.../aether/util/concurrency/package-info.java | 5 +-
.../filter/AbstractPatternDependencyFilter.java | 165 +--
.../aether/util/filter/AndDependencyFilter.java | 75 +-
.../aether/util/filter/DependencyFilterUtils.java | 155 +-
.../util/filter/ExclusionsDependencyFilter.java | 54 +-
.../aether/util/filter/NotDependencyFilter.java | 41 +-
.../aether/util/filter/OrDependencyFilter.java | 71 +-
.../filter/PatternExclusionsDependencyFilter.java | 49 +-
.../filter/PatternInclusionsDependencyFilter.java | 44 +-
.../aether/util/filter/ScopeDependencyFilter.java | 64 +-
.../eclipse/aether/util/filter/package-info.java | 5 +-
.../graph/manager/ClassicDependencyManager.java | 256 ++--
.../graph/manager/DefaultDependencyManager.java | 233 ++-
.../util/graph/manager/DependencyManagerUtils.java | 62 +-
.../util/graph/manager/NoopDependencyManager.java | 41 +-
.../graph/manager/TransitiveDependencyManager.java | 243 ++--
.../aether/util/graph/manager/package-info.java | 5 +-
.../util/graph/selector/AndDependencySelector.java | 165 +--
.../selector/ExclusionDependencySelector.java | 186 +--
.../graph/selector/OptionalDependencySelector.java | 55 +-
.../graph/selector/ScopeDependencySelector.java | 104 +-
.../graph/selector/StaticDependencySelector.java | 49 +-
.../aether/util/graph/selector/package-info.java | 5 +-
.../ChainedDependencyGraphTransformer.java | 56 +-
.../util/graph/transformer/ConflictIdSorter.java | 293 ++--
.../util/graph/transformer/ConflictMarker.java | 254 ++--
.../util/graph/transformer/ConflictResolver.java | 786 +++++------
.../transformer/JavaDependencyContextRefiner.java | 58 +-
.../util/graph/transformer/JavaScopeDeriver.java | 46 +-
.../util/graph/transformer/JavaScopeSelector.java | 69 +-
.../graph/transformer/NearestVersionSelector.java | 130 +-
.../NoopDependencyGraphTransformer.java | 27 +-
.../transformer/SimpleOptionalitySelector.java | 38 +-
.../transformer/TransformationContextKeys.java | 24 +-
.../util/graph/transformer/package-info.java | 5 +-
.../graph/traverser/AndDependencyTraverser.java | 148 +-
.../util/graph/traverser/FatArtifactTraverser.java | 47 +-
.../graph/traverser/StaticDependencyTraverser.java | 44 +-
.../aether/util/graph/traverser/package-info.java | 5 +-
.../util/graph/version/ChainedVersionFilter.java | 121 +-
.../version/ContextualSnapshotVersionFilter.java | 55 +-
.../util/graph/version/HighestVersionFilter.java | 43 +-
.../util/graph/version/SnapshotVersionFilter.java | 43 +-
.../aether/util/graph/version/package-info.java | 5 +-
.../AbstractDepthFirstNodeListGenerator.java | 128 +-
.../graph/visitor/CloningDependencyVisitor.java | 61 +-
.../graph/visitor/FilteringDependencyVisitor.java | 63 +-
.../visitor/PathRecordingDependencyVisitor.java | 61 +-
.../graph/visitor/PostorderNodeListGenerator.java | 38 +-
.../graph/visitor/PreorderNodeListGenerator.java | 32 +-
.../eclipse/aether/util/graph/visitor/Stack.java | 50 +-
.../util/graph/visitor/TreeDependencyVisitor.java | 44 +-
.../aether/util/graph/visitor/package-info.java | 5 +-
.../util/listener/ChainedRepositoryListener.java | 444 +++---
.../util/listener/ChainedTransferListener.java | 201 +--
.../eclipse/aether/util/listener/package-info.java | 5 +-
.../java/org/eclipse/aether/util/package-info.java | 5 +-
.../util/repository/AuthenticationBuilder.java | 139 +-
.../util/repository/ChainedAuthentication.java | 87 +-
.../repository/ChainedLocalRepositoryManager.java | 134 +-
.../util/repository/ChainedWorkspaceReader.java | 111 +-
.../util/repository/ComponentAuthentication.java | 68 +-
.../ConservativeAuthenticationSelector.java | 33 +-
.../util/repository/ConservativeProxySelector.java | 33 +-
.../repository/DefaultAuthenticationSelector.java | 37 +-
.../util/repository/DefaultMirrorSelector.java | 197 ++-
.../util/repository/DefaultProxySelector.java | 109 +-
.../aether/util/repository/JreProxySelector.java | 137 +-
.../util/repository/SecretAuthentication.java | 151 +-
.../repository/SimpleArtifactDescriptorPolicy.java | 33 +-
.../repository/SimpleResolutionErrorPolicy.java | 47 +-
.../util/repository/StringAuthentication.java | 62 +-
.../aether/util/repository/package-info.java | 5 +-
.../aether/util/version/GenericVersion.java | 349 ++---
.../util/version/GenericVersionConstraint.java | 74 +-
.../aether/util/version/GenericVersionRange.java | 215 ++-
.../aether/util/version/GenericVersionScheme.java | 120 +-
.../aether/util/version/UnionVersionRange.java | 119 +-
.../eclipse/aether/util/version/package-info.java | 5 +-
.../org/eclipse/aether/util/ChecksumUtilTest.java | 280 ++--
.../org/eclipse/aether/util/ConfigUtilsTest.java | 217 ++-
.../eclipse/aether/util/DirectoryUtilsTest.java | 99 +-
.../eclipse/aether/util/StringDigestUtilTest.java | 106 +-
.../org/eclipse/aether/util/StringUtilsTest.java | 31 +-
.../aether/util/artifact/ArtifactIdUtilsTest.java | 215 ++-
.../aether/util/artifact/SubArtifactTest.java | 166 +--
.../util/filter/AbstractDependencyFilterTest.java | 36 +-
.../util/filter/AndDependencyFilterTest.java | 86 +-
.../util/filter/DependencyFilterUtilsTest.java | 162 +--
.../util/filter/ExclusionDependencyFilterTest.java | 40 +-
.../aether/util/filter/OrDependencyFilterTest.java | 81 +-
.../PatternExclusionsDependencyFilterTest.java | 188 +--
.../PatternInclusionsDependencyFilterTest.java | 179 +--
.../util/filter/ScopeDependencyFilterTest.java | 57 +-
.../manager/ClassicDependencyManagerTest.java | 61 +-
.../graph/selector/AndDependencySelectorTest.java | 171 +--
.../selector/ExclusionDependencySelectorTest.java | 21 +-
.../selector/OptionalDependencySelectorTest.java | 22 +-
.../selector/ScopeDependencySelectorTest.java | 22 +-
.../selector/StaticDependencySelectorTest.java | 22 +-
.../AbstractDependencyGraphTransformerTest.java | 76 +-
.../graph/transformer/ConflictIdSorterTest.java | 119 +-
.../util/graph/transformer/ConflictMarkerTest.java | 126 +-
.../graph/transformer/ConflictResolverTest.java | 193 ++-
.../JavaDependencyContextRefinerTest.java | 105 +-
.../graph/transformer/JavaScopeSelectorTest.java | 269 ++--
.../transformer/NearestVersionSelectorTest.java | 256 ++--
.../util/graph/transformer/RootQueueTest.java | 131 +-
.../graph/transformer/SimpleConflictMarker.java | 57 +-
.../transformer/SimpleOptionalitySelectorTest.java | 78 +-
.../traverser/AndDependencyTraverserTest.java | 161 +--
.../graph/traverser/FatArtifactTraverserTest.java | 68 +-
.../traverser/StaticDependencyTraverserTest.java | 78 +-
.../graph/versions/AbstractVersionFilterTest.java | 69 +-
.../graph/versions/ChainedVersionFilterTest.java | 72 +-
.../ContextualSnapshotVersionFilterTest.java | 64 +-
.../graph/versions/HighestVersionFilterTest.java | 43 +-
.../graph/versions/SnapshotVersionFilterTest.java | 43 +-
.../visitor/FilteringDependencyVisitorTest.java | 58 +-
.../PathRecordingDependencyVisitorTest.java | 165 +--
.../visitor/PostorderNodeListGeneratorTest.java | 58 +-
.../visitor/PreorderNodeListGeneratorTest.java | 58 +-
.../graph/visitor/TreeDependencyVisitorTest.java | 56 +-
.../listener/ChainedRepositoryListenerTest.java | 29 +-
.../util/listener/ChainedTransferListenerTest.java | 29 +-
.../repository/ComponentAuthenticationTest.java | 105 +-
.../util/repository/DefaultProxySelectorTest.java | 66 +-
.../util/repository/JreProxySelectorTest.java | 157 +--
.../util/repository/SecretAuthenticationTest.java | 110 +-
.../util/repository/StringAuthenticationTest.java | 97 +-
.../aether/util/version/AbstractVersionTest.java | 74 +-
.../util/version/GenericVersionRangeTest.java | 174 +--
.../util/version/GenericVersionSchemeTest.java | 121 +-
.../aether/util/version/GenericVersionTest.java | 507 ++++---
.../aether/util/version/UnionVersionRangeTest.java | 106 +-
pom.xml | 78 +-
691 files changed, 27869 insertions(+), 38622 deletions(-)
diff --git a/maven-resolver-api/pom.xml b/maven-resolver-api/pom.xml
index df5263ea..cf778ffa 100644
--- a/maven-resolver-api/pom.xml
+++ b/maven-resolver-api/pom.xml
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
-
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
@@ -18,7 +17,6 @@
specific language governing permissions and limitations
under the License.
-->
-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -31,9 +29,7 @@
<artifactId>maven-resolver-api</artifactId>
<name>Maven Artifact Resolver API</name>
- <description>
- The application programming interface for the repository system.
- </description>
+ <description>The application programming interface for the repository system.</description>
<properties>
<Automatic-Module-Name>org.apache.maven.resolver</Automatic-Module-Name>
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java
index b1ace216..a1a2083e 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractForwardingRepositorySystemSession.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.Map;
@@ -42,16 +41,12 @@ import org.eclipse.aether.transform.FileTransformerManager;
* A special repository system session to enable decorating or proxying another session. To do so, clients have to
* create a subclass and implement {@link #getSession()}, and optionally override other methods.
*/
-public abstract class AbstractForwardingRepositorySystemSession
- implements RepositorySystemSession
-{
+public abstract class AbstractForwardingRepositorySystemSession implements RepositorySystemSession {
/**
* Creates a new forwarding session.
*/
- protected AbstractForwardingRepositorySystemSession()
- {
- }
+ protected AbstractForwardingRepositorySystemSession() {}
/**
* Gets the repository system session to which this instance forwards calls. It's worth noting that this class does
@@ -63,158 +58,132 @@ public abstract class AbstractForwardingRepositorySystemSession
protected abstract RepositorySystemSession getSession();
@Override
- public boolean isOffline()
- {
+ public boolean isOffline() {
return getSession().isOffline();
}
@Override
- public boolean isIgnoreArtifactDescriptorRepositories()
- {
+ public boolean isIgnoreArtifactDescriptorRepositories() {
return getSession().isIgnoreArtifactDescriptorRepositories();
}
@Override
- public ResolutionErrorPolicy getResolutionErrorPolicy()
- {
+ public ResolutionErrorPolicy getResolutionErrorPolicy() {
return getSession().getResolutionErrorPolicy();
}
@Override
- public ArtifactDescriptorPolicy getArtifactDescriptorPolicy()
- {
+ public ArtifactDescriptorPolicy getArtifactDescriptorPolicy() {
return getSession().getArtifactDescriptorPolicy();
}
@Override
- public String getChecksumPolicy()
- {
+ public String getChecksumPolicy() {
return getSession().getChecksumPolicy();
}
@Override
- public String getUpdatePolicy()
- {
+ public String getUpdatePolicy() {
return getSession().getUpdatePolicy();
}
@Override
- public LocalRepository getLocalRepository()
- {
+ public LocalRepository getLocalRepository() {
return getSession().getLocalRepository();
}
@Override
- public LocalRepositoryManager getLocalRepositoryManager()
- {
+ public LocalRepositoryManager getLocalRepositoryManager() {
return getSession().getLocalRepositoryManager();
}
@Override
- public WorkspaceReader getWorkspaceReader()
- {
+ public WorkspaceReader getWorkspaceReader() {
return getSession().getWorkspaceReader();
}
@Override
- public RepositoryListener getRepositoryListener()
- {
+ public RepositoryListener getRepositoryListener() {
return getSession().getRepositoryListener();
}
@Override
- public TransferListener getTransferListener()
- {
+ public TransferListener getTransferListener() {
return getSession().getTransferListener();
}
@Override
- public Map<String, String> getSystemProperties()
- {
+ public Map<String, String> getSystemProperties() {
return getSession().getSystemProperties();
}
@Override
- public Map<String, String> getUserProperties()
- {
+ public Map<String, String> getUserProperties() {
return getSession().getUserProperties();
}
@Override
- public Map<String, Object> getConfigProperties()
- {
+ public Map<String, Object> getConfigProperties() {
return getSession().getConfigProperties();
}
@Override
- public MirrorSelector getMirrorSelector()
- {
+ public MirrorSelector getMirrorSelector() {
return getSession().getMirrorSelector();
}
@Override
- public ProxySelector getProxySelector()
- {
+ public ProxySelector getProxySelector() {
return getSession().getProxySelector();
}
@Override
- public AuthenticationSelector getAuthenticationSelector()
- {
+ public AuthenticationSelector getAuthenticationSelector() {
return getSession().getAuthenticationSelector();
}
@Override
- public ArtifactTypeRegistry getArtifactTypeRegistry()
- {
+ public ArtifactTypeRegistry getArtifactTypeRegistry() {
return getSession().getArtifactTypeRegistry();
}
@Override
- public DependencyTraverser getDependencyTraverser()
- {
+ public DependencyTraverser getDependencyTraverser() {
return getSession().getDependencyTraverser();
}
@Override
- public DependencyManager getDependencyManager()
- {
+ public DependencyManager getDependencyManager() {
return getSession().getDependencyManager();
}
@Override
- public DependencySelector getDependencySelector()
- {
+ public DependencySelector getDependencySelector() {
return getSession().getDependencySelector();
}
@Override
- public VersionFilter getVersionFilter()
- {
+ public VersionFilter getVersionFilter() {
return getSession().getVersionFilter();
}
@Override
- public DependencyGraphTransformer getDependencyGraphTransformer()
- {
+ public DependencyGraphTransformer getDependencyGraphTransformer() {
return getSession().getDependencyGraphTransformer();
}
@Override
- public SessionData getData()
- {
+ public SessionData getData() {
return getSession().getData();
}
@Override
- public RepositoryCache getCache()
- {
+ public RepositoryCache getCache() {
return getSession().getCache();
}
@Override
- public FileTransformerManager getFileTransformerManager()
- {
+ public FileTransformerManager getFileTransformerManager() {
return getSession().getFileTransformerManager();
}
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java
index f42d15e3..969bdfb9 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/AbstractRepositoryListener.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,95 +16,53 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* A skeleton implementation for custom repository listeners. The callback methods in this class do nothing.
*/
-public abstract class AbstractRepositoryListener
- implements RepositoryListener
-{
+public abstract class AbstractRepositoryListener implements RepositoryListener {
/**
* Enables subclassing.
*/
- protected AbstractRepositoryListener()
- {
- }
-
- public void artifactDeployed( RepositoryEvent event )
- {
- }
+ protected AbstractRepositoryListener() {}
- public void artifactDeploying( RepositoryEvent event )
- {
- }
+ public void artifactDeployed(RepositoryEvent event) {}
- public void artifactDescriptorInvalid( RepositoryEvent event )
- {
- }
+ public void artifactDeploying(RepositoryEvent event) {}
- public void artifactDescriptorMissing( RepositoryEvent event )
- {
- }
+ public void artifactDescriptorInvalid(RepositoryEvent event) {}
- public void artifactDownloaded( RepositoryEvent event )
- {
- }
+ public void artifactDescriptorMissing(RepositoryEvent event) {}
- public void artifactDownloading( RepositoryEvent event )
- {
- }
+ public void artifactDownloaded(RepositoryEvent event) {}
- public void artifactInstalled( RepositoryEvent event )
- {
- }
+ public void artifactDownloading(RepositoryEvent event) {}
- public void artifactInstalling( RepositoryEvent event )
- {
- }
+ public void artifactInstalled(RepositoryEvent event) {}
- public void artifactResolved( RepositoryEvent event )
- {
- }
+ public void artifactInstalling(RepositoryEvent event) {}
- public void artifactResolving( RepositoryEvent event )
- {
- }
+ public void artifactResolved(RepositoryEvent event) {}
- public void metadataDeployed( RepositoryEvent event )
- {
- }
+ public void artifactResolving(RepositoryEvent event) {}
- public void metadataDeploying( RepositoryEvent event )
- {
- }
+ public void metadataDeployed(RepositoryEvent event) {}
- public void metadataDownloaded( RepositoryEvent event )
- {
- }
+ public void metadataDeploying(RepositoryEvent event) {}
- public void metadataDownloading( RepositoryEvent event )
- {
- }
+ public void metadataDownloaded(RepositoryEvent event) {}
- public void metadataInstalled( RepositoryEvent event )
- {
- }
+ public void metadataDownloading(RepositoryEvent event) {}
- public void metadataInstalling( RepositoryEvent event )
- {
- }
+ public void metadataInstalled(RepositoryEvent event) {}
- public void metadataInvalid( RepositoryEvent event )
- {
- }
+ public void metadataInstalling(RepositoryEvent event) {}
- public void metadataResolved( RepositoryEvent event )
- {
- }
+ public void metadataInvalid(RepositoryEvent event) {}
- public void metadataResolving( RepositoryEvent event )
- {
- }
+ public void metadataResolved(RepositoryEvent event) {}
+ public void metadataResolving(RepositoryEvent event) {}
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java b/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java
index bc1738f3..fad69b02 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/ConfigurationProperties.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,14 +16,14 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* The keys and defaults for common configuration properties.
- *
+ *
* @see RepositorySystemSession#getConfigProperties()
*/
-public final class ConfigurationProperties
-{
+public final class ConfigurationProperties {
private static final String PREFIX_AETHER = "aether.";
@@ -47,7 +45,7 @@ public final class ConfigurationProperties
* corresponding {@code aether.priority.*} configuration properties are ignored when searching for a suitable
* implementation among the available extensions. This priority mode is meant for cases where the application will
* present/inject extensions in the desired search order.
- *
+ *
* @see #DEFAULT_IMPLICIT_PRIORITIES
*/
public static final String IMPLICIT_PRIORITIES = PREFIX_PRIORITY + "implicit";
@@ -59,7 +57,7 @@ public final class ConfigurationProperties
/**
* A flag indicating whether interaction with the user is allowed.
- *
+ *
* @see #DEFAULT_INTERACTIVE
*/
public static final String INTERACTIVE = PREFIX_AETHER + "interactive";
@@ -71,7 +69,7 @@ public final class ConfigurationProperties
/**
* The user agent that repository connectors should report to servers.
- *
+ *
* @see #DEFAULT_USER_AGENT
*/
public static final String USER_AGENT = PREFIX_CONNECTOR + "userAgent";
@@ -84,7 +82,7 @@ public final class ConfigurationProperties
/**
* The maximum amount of time (in milliseconds) to wait for a successful connection to a remote server. Non-positive
* values indicate no timeout.
- *
+ *
* @see #DEFAULT_CONNECT_TIMEOUT
*/
public static final String CONNECT_TIMEOUT = PREFIX_CONNECTOR + "connectTimeout";
@@ -98,7 +96,7 @@ public final class ConfigurationProperties
* The maximum amount of time (in milliseconds) to wait for remaining data to arrive from a remote server. Note that
* this timeout does not restrict the overall duration of a request, it only restricts the duration of inactivity
* between consecutive data packets. Non-positive values indicate no timeout.
- *
+ *
* @see #DEFAULT_REQUEST_TIMEOUT
*/
public static final String REQUEST_TIMEOUT = PREFIX_CONNECTOR + "requestTimeout";
@@ -121,7 +119,7 @@ public final class ConfigurationProperties
* The encoding/charset to use when exchanging credentials with HTTP servers. Besides this general key, clients may
* also specify the encoding for a specific remote repository by appending the suffix {@code .<repoId>} to this key
* when storing the charset name.
- *
+ *
* @see #DEFAULT_HTTP_CREDENTIAL_ENCODING
*/
public static final String HTTP_CREDENTIAL_ENCODING = PREFIX_CONNECTOR + "http.credentialEncoding";
@@ -134,7 +132,7 @@ public final class ConfigurationProperties
/**
* A flag indicating whether checksums which are retrieved during checksum validation should be persisted in the
* local filesystem next to the file they provide the checksum for.
- *
+ *
* @see #DEFAULT_PERSISTED_CHECKSUMS
*/
public static final String PERSISTED_CHECKSUMS = PREFIX_CONNECTOR + "persistedChecksums";
@@ -144,9 +142,7 @@ public final class ConfigurationProperties
*/
public static final boolean DEFAULT_PERSISTED_CHECKSUMS = true;
- private ConfigurationProperties()
- {
+ private ConfigurationProperties() {
// hide constructor
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java
index 18e28f0a..de8c4dc9 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositoryCache.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -26,27 +25,19 @@ import java.util.concurrent.ConcurrentHashMap;
* A simplistic repository cache backed by a thread-safe map. The simplistic nature of this cache makes it only suitable
* for use with short-lived repository system sessions where pruning of cache data is not required.
*/
-public final class DefaultRepositoryCache
- implements RepositoryCache
-{
+public final class DefaultRepositoryCache implements RepositoryCache {
- private final Map<Object, Object> cache = new ConcurrentHashMap<>( 256 );
+ private final Map<Object, Object> cache = new ConcurrentHashMap<>(256);
- public Object get( RepositorySystemSession session, Object key )
- {
- return cache.get( key );
+ public Object get(RepositorySystemSession session, Object key) {
+ return cache.get(key);
}
- public void put( RepositorySystemSession session, Object key, Object data )
- {
- if ( data != null )
- {
- cache.put( key, data );
- }
- else
- {
- cache.remove( key );
+ public void put(RepositorySystemSession session, Object key, Object data) {
+ if (data != null) {
+ cache.put(key, data);
+ } else {
+ cache.remove(key);
}
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java
index 4c0163e8..a6e24fd5 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultRepositorySystemSession.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.Collection;
import java.util.Collections;
@@ -58,9 +57,7 @@ import static java.util.Objects.requireNonNull;
* system. It is recommended to call {@link #setReadOnly()} once the session has been fully initialized to prevent
* accidental manipulation of it afterwards.
*/
-public final class DefaultRepositorySystemSession
- implements RepositorySystemSession
-{
+public final class DefaultRepositorySystemSession implements RepositorySystemSession {
private boolean readOnly;
@@ -125,14 +122,13 @@ public final class DefaultRepositorySystemSession
* {@link #setLocalRepositoryManager(LocalRepositoryManager)} needs to be called but usually other settings also
* need to be customized to achieve meaningful behavior.
*/
- public DefaultRepositorySystemSession()
- {
+ public DefaultRepositorySystemSession() {
systemProperties = new HashMap<>();
- systemPropertiesView = Collections.unmodifiableMap( systemProperties );
+ systemPropertiesView = Collections.unmodifiableMap(systemProperties);
userProperties = new HashMap<>();
- userPropertiesView = Collections.unmodifiableMap( userProperties );
+ userPropertiesView = Collections.unmodifiableMap(userProperties);
configProperties = new HashMap<>();
- configPropertiesView = Collections.unmodifiableMap( configProperties );
+ configPropertiesView = Collections.unmodifiableMap(configProperties);
mirrorSelector = NullMirrorSelector.INSTANCE;
proxySelector = NullProxySelector.INSTANCE;
authenticationSelector = NullAuthenticationSelector.INSTANCE;
@@ -149,40 +145,38 @@ public final class DefaultRepositorySystemSession
*
* @param session The session to copy, must not be {@code null}.
*/
- public DefaultRepositorySystemSession( RepositorySystemSession session )
- {
- requireNonNull( session, "repository system session cannot be null" );
-
- setOffline( session.isOffline() );
- setIgnoreArtifactDescriptorRepositories( session.isIgnoreArtifactDescriptorRepositories() );
- setResolutionErrorPolicy( session.getResolutionErrorPolicy() );
- setArtifactDescriptorPolicy( session.getArtifactDescriptorPolicy() );
- setChecksumPolicy( session.getChecksumPolicy() );
- setUpdatePolicy( session.getUpdatePolicy() );
- setLocalRepositoryManager( session.getLocalRepositoryManager() );
- setWorkspaceReader( session.getWorkspaceReader() );
- setRepositoryListener( session.getRepositoryListener() );
- setTransferListener( session.getTransferListener() );
- setSystemProperties( session.getSystemProperties() );
- setUserProperties( session.getUserProperties() );
- setConfigProperties( session.getConfigProperties() );
- setMirrorSelector( session.getMirrorSelector() );
- setProxySelector( session.getProxySelector() );
- setAuthenticationSelector( session.getAuthenticationSelector() );
- setArtifactTypeRegistry( session.getArtifactTypeRegistry() );
- setDependencyTraverser( session.getDependencyTraverser() );
- setDependencyManager( session.getDependencyManager() );
- setDependencySelector( session.getDependencySelector() );
- setVersionFilter( session.getVersionFilter() );
- setDependencyGraphTransformer( session.getDependencyGraphTransformer() );
- setFileTransformerManager( session.getFileTransformerManager() );
- setData( session.getData() );
- setCache( session.getCache() );
+ public DefaultRepositorySystemSession(RepositorySystemSession session) {
+ requireNonNull(session, "repository system session cannot be null");
+
+ setOffline(session.isOffline());
+ setIgnoreArtifactDescriptorRepositories(session.isIgnoreArtifactDescriptorRepositories());
+ setResolutionErrorPolicy(session.getResolutionErrorPolicy());
+ setArtifactDescriptorPolicy(session.getArtifactDescriptorPolicy());
+ setChecksumPolicy(session.getChecksumPolicy());
+ setUpdatePolicy(session.getUpdatePolicy());
+ setLocalRepositoryManager(session.getLocalRepositoryManager());
+ setWorkspaceReader(session.getWorkspaceReader());
+ setRepositoryListener(session.getRepositoryListener());
+ setTransferListener(session.getTransferListener());
+ setSystemProperties(session.getSystemProperties());
+ setUserProperties(session.getUserProperties());
+ setConfigProperties(session.getConfigProperties());
+ setMirrorSelector(session.getMirrorSelector());
+ setProxySelector(session.getProxySelector());
+ setAuthenticationSelector(session.getAuthenticationSelector());
+ setArtifactTypeRegistry(session.getArtifactTypeRegistry());
+ setDependencyTraverser(session.getDependencyTraverser());
+ setDependencyManager(session.getDependencyManager());
+ setDependencySelector(session.getDependencySelector());
+ setVersionFilter(session.getVersionFilter());
+ setDependencyGraphTransformer(session.getDependencyGraphTransformer());
+ setFileTransformerManager(session.getFileTransformerManager());
+ setData(session.getData());
+ setCache(session.getCache());
}
@Override
- public boolean isOffline()
- {
+ public boolean isOffline() {
return offline;
}
@@ -193,16 +187,14 @@ public final class DefaultRepositorySystemSession
* @param offline {@code true} if the repository system is in offline mode, {@code false} otherwise.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setOffline( boolean offline )
- {
+ public DefaultRepositorySystemSession setOffline(boolean offline) {
verifyStateForMutation();
this.offline = offline;
return this;
}
@Override
- public boolean isIgnoreArtifactDescriptorRepositories()
- {
+ public boolean isIgnoreArtifactDescriptorRepositories() {
return ignoreArtifactDescriptorRepositories;
}
@@ -216,16 +208,14 @@ public final class DefaultRepositorySystemSession
* @return This session for chaining, never {@code null}.
*/
public DefaultRepositorySystemSession setIgnoreArtifactDescriptorRepositories(
- boolean ignoreArtifactDescriptorRepositories )
- {
+ boolean ignoreArtifactDescriptorRepositories) {
verifyStateForMutation();
this.ignoreArtifactDescriptorRepositories = ignoreArtifactDescriptorRepositories;
return this;
}
@Override
- public ResolutionErrorPolicy getResolutionErrorPolicy()
- {
+ public ResolutionErrorPolicy getResolutionErrorPolicy() {
return resolutionErrorPolicy;
}
@@ -236,16 +226,14 @@ public final class DefaultRepositorySystemSession
* errors should generally not be cached.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setResolutionErrorPolicy( ResolutionErrorPolicy resolutionErrorPolicy )
- {
+ public DefaultRepositorySystemSession setResolutionErrorPolicy(ResolutionErrorPolicy resolutionErrorPolicy) {
verifyStateForMutation();
this.resolutionErrorPolicy = resolutionErrorPolicy;
return this;
}
@Override
- public ArtifactDescriptorPolicy getArtifactDescriptorPolicy()
- {
+ public ArtifactDescriptorPolicy getArtifactDescriptorPolicy() {
return artifactDescriptorPolicy;
}
@@ -257,16 +245,14 @@ public final class DefaultRepositorySystemSession
* @return This session for chaining, never {@code null}.
*/
public DefaultRepositorySystemSession setArtifactDescriptorPolicy(
- ArtifactDescriptorPolicy artifactDescriptorPolicy )
- {
+ ArtifactDescriptorPolicy artifactDescriptorPolicy) {
verifyStateForMutation();
this.artifactDescriptorPolicy = artifactDescriptorPolicy;
return this;
}
@Override
- public String getChecksumPolicy()
- {
+ public String getChecksumPolicy() {
return checksumPolicy;
}
@@ -280,16 +266,14 @@ public final class DefaultRepositorySystemSession
* @see RepositoryPolicy#CHECKSUM_POLICY_IGNORE
* @see RepositoryPolicy#CHECKSUM_POLICY_WARN
*/
- public DefaultRepositorySystemSession setChecksumPolicy( String checksumPolicy )
- {
+ public DefaultRepositorySystemSession setChecksumPolicy(String checksumPolicy) {
verifyStateForMutation();
this.checksumPolicy = checksumPolicy;
return this;
}
@Override
- public String getUpdatePolicy()
- {
+ public String getUpdatePolicy() {
return updatePolicy;
}
@@ -303,22 +287,19 @@ public final class DefaultRepositorySystemSession
* @see RepositoryPolicy#UPDATE_POLICY_DAILY
* @see RepositoryPolicy#UPDATE_POLICY_NEVER
*/
- public DefaultRepositorySystemSession setUpdatePolicy( String updatePolicy )
- {
+ public DefaultRepositorySystemSession setUpdatePolicy(String updatePolicy) {
verifyStateForMutation();
this.updatePolicy = updatePolicy;
return this;
}
@Override
- public LocalRepository getLocalRepository()
- {
+ public LocalRepository getLocalRepository() {
LocalRepositoryManager lrm = getLocalRepositoryManager();
- return ( lrm != null ) ? lrm.getRepository() : null;
+ return (lrm != null) ? lrm.getRepository() : null;
}
- public LocalRepositoryManager getLocalRepositoryManager()
- {
+ public LocalRepositoryManager getLocalRepositoryManager() {
return localRepositoryManager;
}
@@ -329,33 +310,28 @@ public final class DefaultRepositorySystemSession
* @param localRepositoryManager The local repository manager used during this session, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setLocalRepositoryManager( LocalRepositoryManager localRepositoryManager )
- {
+ public DefaultRepositorySystemSession setLocalRepositoryManager(LocalRepositoryManager localRepositoryManager) {
verifyStateForMutation();
this.localRepositoryManager = localRepositoryManager;
return this;
}
@Override
- public FileTransformerManager getFileTransformerManager()
- {
+ public FileTransformerManager getFileTransformerManager() {
return fileTransformerManager;
}
- public DefaultRepositorySystemSession setFileTransformerManager( FileTransformerManager fileTransformerManager )
- {
+ public DefaultRepositorySystemSession setFileTransformerManager(FileTransformerManager fileTransformerManager) {
verifyStateForMutation();
this.fileTransformerManager = fileTransformerManager;
- if ( this.fileTransformerManager == null )
- {
+ if (this.fileTransformerManager == null) {
this.fileTransformerManager = NullFileTransformerManager.INSTANCE;
}
return this;
}
@Override
- public WorkspaceReader getWorkspaceReader()
- {
+ public WorkspaceReader getWorkspaceReader() {
return workspaceReader;
}
@@ -366,16 +342,14 @@ public final class DefaultRepositorySystemSession
* @param workspaceReader The workspace reader for this session, may be {@code null} if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setWorkspaceReader( WorkspaceReader workspaceReader )
- {
+ public DefaultRepositorySystemSession setWorkspaceReader(WorkspaceReader workspaceReader) {
verifyStateForMutation();
this.workspaceReader = workspaceReader;
return this;
}
@Override
- public RepositoryListener getRepositoryListener()
- {
+ public RepositoryListener getRepositoryListener() {
return repositoryListener;
}
@@ -385,16 +359,14 @@ public final class DefaultRepositorySystemSession
* @param repositoryListener The repository listener, may be {@code null} if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setRepositoryListener( RepositoryListener repositoryListener )
- {
+ public DefaultRepositorySystemSession setRepositoryListener(RepositoryListener repositoryListener) {
verifyStateForMutation();
this.repositoryListener = repositoryListener;
return this;
}
@Override
- public TransferListener getTransferListener()
- {
+ public TransferListener getTransferListener() {
return transferListener;
}
@@ -404,33 +376,25 @@ public final class DefaultRepositorySystemSession
* @param transferListener The transfer listener, may be {@code null} if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setTransferListener( TransferListener transferListener )
- {
+ public DefaultRepositorySystemSession setTransferListener(TransferListener transferListener) {
verifyStateForMutation();
this.transferListener = transferListener;
return this;
}
- @SuppressWarnings( "checkstyle:magicnumber" )
- private <T> Map<String, T> copySafe( Map<?, ?> table, Class<T> valueType )
- {
+ @SuppressWarnings("checkstyle:magicnumber")
+ private <T> Map<String, T> copySafe(Map<?, ?> table, Class<T> valueType) {
Map<String, T> map;
- if ( table == null || table.isEmpty() )
- {
+ if (table == null || table.isEmpty()) {
map = new HashMap<>();
- }
- else
- {
- map = new HashMap<>( (int) ( table.size() / 0.75f ) + 1 );
- for ( Map.Entry<?, ?> entry : table.entrySet() )
- {
+ } else {
+ map = new HashMap<>((int) (table.size() / 0.75f) + 1);
+ for (Map.Entry<?, ?> entry : table.entrySet()) {
Object key = entry.getKey();
- if ( key instanceof String )
- {
+ if (key instanceof String) {
Object value = entry.getValue();
- if ( valueType.isInstance( value ) )
- {
- map.put( key.toString(), valueType.cast( value ) );
+ if (valueType.isInstance(value)) {
+ map.put(key.toString(), valueType.cast(value));
}
}
}
@@ -439,8 +403,7 @@ public final class DefaultRepositorySystemSession
}
@Override
- public Map<String, String> getSystemProperties()
- {
+ public Map<String, String> getSystemProperties() {
return systemPropertiesView;
}
@@ -454,11 +417,10 @@ public final class DefaultRepositorySystemSession
* @param systemProperties The system properties, may be {@code null} or empty if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setSystemProperties( Map<?, ?> systemProperties )
- {
+ public DefaultRepositorySystemSession setSystemProperties(Map<?, ?> systemProperties) {
verifyStateForMutation();
- this.systemProperties = copySafe( systemProperties, String.class );
- systemPropertiesView = Collections.unmodifiableMap( this.systemProperties );
+ this.systemProperties = copySafe(systemProperties, String.class);
+ systemPropertiesView = Collections.unmodifiableMap(this.systemProperties);
return this;
}
@@ -469,23 +431,18 @@ public final class DefaultRepositorySystemSession
* @param value The property value, may be {@code null} to remove/unset the property.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setSystemProperty( String key, String value )
- {
+ public DefaultRepositorySystemSession setSystemProperty(String key, String value) {
verifyStateForMutation();
- if ( value != null )
- {
- systemProperties.put( key, value );
- }
- else
- {
- systemProperties.remove( key );
+ if (value != null) {
+ systemProperties.put(key, value);
+ } else {
+ systemProperties.remove(key);
}
return this;
}
@Override
- public Map<String, String> getUserProperties()
- {
+ public Map<String, String> getUserProperties() {
return userPropertiesView;
}
@@ -500,11 +457,10 @@ public final class DefaultRepositorySystemSession
* @param userProperties The user properties, may be {@code null} or empty if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setUserProperties( Map<?, ?> userProperties )
- {
+ public DefaultRepositorySystemSession setUserProperties(Map<?, ?> userProperties) {
verifyStateForMutation();
- this.userProperties = copySafe( userProperties, String.class );
- userPropertiesView = Collections.unmodifiableMap( this.userProperties );
+ this.userProperties = copySafe(userProperties, String.class);
+ userPropertiesView = Collections.unmodifiableMap(this.userProperties);
return this;
}
@@ -515,23 +471,18 @@ public final class DefaultRepositorySystemSession
* @param value The property value, may be {@code null} to remove/unset the property.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setUserProperty( String key, String value )
- {
+ public DefaultRepositorySystemSession setUserProperty(String key, String value) {
verifyStateForMutation();
- if ( value != null )
- {
- userProperties.put( key, value );
- }
- else
- {
- userProperties.remove( key );
+ if (value != null) {
+ userProperties.put(key, value);
+ } else {
+ userProperties.remove(key);
}
return this;
}
@Override
- public Map<String, Object> getConfigProperties()
- {
+ public Map<String, Object> getConfigProperties() {
return configPropertiesView;
}
@@ -545,11 +496,10 @@ public final class DefaultRepositorySystemSession
* @param configProperties The configuration properties, may be {@code null} or empty if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setConfigProperties( Map<?, ?> configProperties )
- {
+ public DefaultRepositorySystemSession setConfigProperties(Map<?, ?> configProperties) {
verifyStateForMutation();
- this.configProperties = copySafe( configProperties, Object.class );
- configPropertiesView = Collections.unmodifiableMap( this.configProperties );
+ this.configProperties = copySafe(configProperties, Object.class);
+ configPropertiesView = Collections.unmodifiableMap(this.configProperties);
return this;
}
@@ -560,23 +510,18 @@ public final class DefaultRepositorySystemSession
* @param value The property value, may be {@code null} to remove/unset the property.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setConfigProperty( String key, Object value )
- {
+ public DefaultRepositorySystemSession setConfigProperty(String key, Object value) {
verifyStateForMutation();
- if ( value != null )
- {
- configProperties.put( key, value );
- }
- else
- {
- configProperties.remove( key );
+ if (value != null) {
+ configProperties.put(key, value);
+ } else {
+ configProperties.remove(key);
}
return this;
}
@Override
- public MirrorSelector getMirrorSelector()
- {
+ public MirrorSelector getMirrorSelector() {
return mirrorSelector;
}
@@ -588,20 +533,17 @@ public final class DefaultRepositorySystemSession
* @param mirrorSelector The mirror selector to use, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setMirrorSelector( MirrorSelector mirrorSelector )
- {
+ public DefaultRepositorySystemSession setMirrorSelector(MirrorSelector mirrorSelector) {
verifyStateForMutation();
this.mirrorSelector = mirrorSelector;
- if ( this.mirrorSelector == null )
- {
+ if (this.mirrorSelector == null) {
this.mirrorSelector = NullMirrorSelector.INSTANCE;
}
return this;
}
@Override
- public ProxySelector getProxySelector()
- {
+ public ProxySelector getProxySelector() {
return proxySelector;
}
@@ -614,20 +556,17 @@ public final class DefaultRepositorySystemSession
* @return This session for chaining, never {@code null}.
* @see org.eclipse.aether.repository.RemoteRepository#getProxy()
*/
- public DefaultRepositorySystemSession setProxySelector( ProxySelector proxySelector )
- {
+ public DefaultRepositorySystemSession setProxySelector(ProxySelector proxySelector) {
verifyStateForMutation();
this.proxySelector = proxySelector;
- if ( this.proxySelector == null )
- {
+ if (this.proxySelector == null) {
this.proxySelector = NullProxySelector.INSTANCE;
}
return this;
}
@Override
- public AuthenticationSelector getAuthenticationSelector()
- {
+ public AuthenticationSelector getAuthenticationSelector() {
return authenticationSelector;
}
@@ -640,20 +579,17 @@ public final class DefaultRepositorySystemSession
* @return This session for chaining, never {@code null}.
* @see org.eclipse.aether.repository.RemoteRepository#getAuthentication()
*/
- public DefaultRepositorySystemSession setAuthenticationSelector( AuthenticationSelector authenticationSelector )
- {
+ public DefaultRepositorySystemSession setAuthenticationSelector(AuthenticationSelector authenticationSelector) {
verifyStateForMutation();
this.authenticationSelector = authenticationSelector;
- if ( this.authenticationSelector == null )
- {
+ if (this.authenticationSelector == null) {
this.authenticationSelector = NullAuthenticationSelector.INSTANCE;
}
return this;
}
@Override
- public ArtifactTypeRegistry getArtifactTypeRegistry()
- {
+ public ArtifactTypeRegistry getArtifactTypeRegistry() {
return artifactTypeRegistry;
}
@@ -663,20 +599,17 @@ public final class DefaultRepositorySystemSession
* @param artifactTypeRegistry The artifact type registry, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setArtifactTypeRegistry( ArtifactTypeRegistry artifactTypeRegistry )
- {
+ public DefaultRepositorySystemSession setArtifactTypeRegistry(ArtifactTypeRegistry artifactTypeRegistry) {
verifyStateForMutation();
this.artifactTypeRegistry = artifactTypeRegistry;
- if ( this.artifactTypeRegistry == null )
- {
+ if (this.artifactTypeRegistry == null) {
this.artifactTypeRegistry = NullArtifactTypeRegistry.INSTANCE;
}
return this;
}
@Override
- public DependencyTraverser getDependencyTraverser()
- {
+ public DependencyTraverser getDependencyTraverser() {
return dependencyTraverser;
}
@@ -686,16 +619,14 @@ public final class DefaultRepositorySystemSession
* @param dependencyTraverser The dependency traverser to use for building dependency graphs, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setDependencyTraverser( DependencyTraverser dependencyTraverser )
- {
+ public DefaultRepositorySystemSession setDependencyTraverser(DependencyTraverser dependencyTraverser) {
verifyStateForMutation();
this.dependencyTraverser = dependencyTraverser;
return this;
}
@Override
- public DependencyManager getDependencyManager()
- {
+ public DependencyManager getDependencyManager() {
return dependencyManager;
}
@@ -705,16 +636,14 @@ public final class DefaultRepositorySystemSession
* @param dependencyManager The dependency manager to use for building dependency graphs, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setDependencyManager( DependencyManager dependencyManager )
- {
+ public DefaultRepositorySystemSession setDependencyManager(DependencyManager dependencyManager) {
verifyStateForMutation();
this.dependencyManager = dependencyManager;
return this;
}
@Override
- public DependencySelector getDependencySelector()
- {
+ public DependencySelector getDependencySelector() {
return dependencySelector;
}
@@ -724,16 +653,14 @@ public final class DefaultRepositorySystemSession
* @param dependencySelector The dependency selector to use for building dependency graphs, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setDependencySelector( DependencySelector dependencySelector )
- {
+ public DefaultRepositorySystemSession setDependencySelector(DependencySelector dependencySelector) {
verifyStateForMutation();
this.dependencySelector = dependencySelector;
return this;
}
@Override
- public VersionFilter getVersionFilter()
- {
+ public VersionFilter getVersionFilter() {
return versionFilter;
}
@@ -744,16 +671,14 @@ public final class DefaultRepositorySystemSession
* versions.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setVersionFilter( VersionFilter versionFilter )
- {
+ public DefaultRepositorySystemSession setVersionFilter(VersionFilter versionFilter) {
verifyStateForMutation();
this.versionFilter = versionFilter;
return this;
}
@Override
- public DependencyGraphTransformer getDependencyGraphTransformer()
- {
+ public DependencyGraphTransformer getDependencyGraphTransformer() {
return dependencyGraphTransformer;
}
@@ -765,16 +690,14 @@ public final class DefaultRepositorySystemSession
* @return This session for chaining, never {@code null}.
*/
public DefaultRepositorySystemSession setDependencyGraphTransformer(
- DependencyGraphTransformer dependencyGraphTransformer )
- {
+ DependencyGraphTransformer dependencyGraphTransformer) {
verifyStateForMutation();
this.dependencyGraphTransformer = dependencyGraphTransformer;
return this;
}
@Override
- public SessionData getData()
- {
+ public SessionData getData() {
return data;
}
@@ -784,20 +707,17 @@ public final class DefaultRepositorySystemSession
* @param data The session data, may be {@code null}.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setData( SessionData data )
- {
+ public DefaultRepositorySystemSession setData(SessionData data) {
verifyStateForMutation();
this.data = data;
- if ( this.data == null )
- {
+ if (this.data == null) {
this.data = new DefaultSessionData();
}
return this;
}
@Override
- public RepositoryCache getCache()
- {
+ public RepositoryCache getCache() {
return cache;
}
@@ -807,8 +727,7 @@ public final class DefaultRepositorySystemSession
* @param cache The repository cache, may be {@code null} if none.
* @return This session for chaining, never {@code null}.
*/
- public DefaultRepositorySystemSession setCache( RepositoryCache cache )
- {
+ public DefaultRepositorySystemSession setCache(RepositoryCache cache) {
verifyStateForMutation();
this.cache = cache;
return this;
@@ -819,84 +738,63 @@ public final class DefaultRepositorySystemSession
* Marking an already read-only session as read-only has no effect. The session's data and cache remain writable
* though.
*/
- public void setReadOnly()
- {
+ public void setReadOnly() {
readOnly = true;
}
/**
* Verifies this instance state for mutation operations: mutated instance must not be read-only or closed.
*/
- private void verifyStateForMutation()
- {
- if ( readOnly )
- {
- throw new IllegalStateException( "repository system session is read-only" );
+ private void verifyStateForMutation() {
+ if (readOnly) {
+ throw new IllegalStateException("repository system session is read-only");
}
}
- static class NullProxySelector
- implements ProxySelector
- {
+ static class NullProxySelector implements ProxySelector {
public static final ProxySelector INSTANCE = new NullProxySelector();
- public Proxy getProxy( RemoteRepository repository )
- {
- requireNonNull( repository, "repository cannot be null" );
+ public Proxy getProxy(RemoteRepository repository) {
+ requireNonNull(repository, "repository cannot be null");
return repository.getProxy();
}
-
}
- static class NullMirrorSelector
- implements MirrorSelector
- {
+ static class NullMirrorSelector implements MirrorSelector {
public static final MirrorSelector INSTANCE = new NullMirrorSelector();
- public RemoteRepository getMirror( RemoteRepository repository )
- {
- requireNonNull( repository, "repository cannot be null" );
+ public RemoteRepository getMirror(RemoteRepository repository) {
+ requireNonNull(repository, "repository cannot be null");
return null;
}
-
}
- static class NullAuthenticationSelector
- implements AuthenticationSelector
- {
+ static class NullAuthenticationSelector implements AuthenticationSelector {
public static final AuthenticationSelector INSTANCE = new NullAuthenticationSelector();
- public Authentication getAuthentication( RemoteRepository repository )
- {
- requireNonNull( repository, "repository cannot be null" );
+ public Authentication getAuthentication(RemoteRepository repository) {
+ requireNonNull(repository, "repository cannot be null");
return repository.getAuthentication();
}
-
}
- static final class NullArtifactTypeRegistry
- implements ArtifactTypeRegistry
- {
+ static final class NullArtifactTypeRegistry implements ArtifactTypeRegistry {
public static final ArtifactTypeRegistry INSTANCE = new NullArtifactTypeRegistry();
- public ArtifactType get( String typeId )
- {
+ public ArtifactType get(String typeId) {
return null;
}
-
}
- static final class NullFileTransformerManager implements FileTransformerManager
- {
+ static final class NullFileTransformerManager implements FileTransformerManager {
public static final FileTransformerManager INSTANCE = new NullFileTransformerManager();
@Override
- public Collection<FileTransformer> getTransformersForArtifact( Artifact artifact )
- {
+ public Collection<FileTransformer> getTransformersForArtifact(Artifact artifact) {
return Collections.emptyList();
}
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java
index ea430a53..284945e1 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/DefaultSessionData.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,72 +16,58 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
-
-import static java.util.Objects.requireNonNull;
+package org.eclipse.aether;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Supplier;
+import static java.util.Objects.requireNonNull;
+
/**
* A simple session data storage backed by a thread-safe map.
*/
-public final class DefaultSessionData
- implements SessionData
-{
+public final class DefaultSessionData implements SessionData {
private final ConcurrentMap<Object, Object> data;
- public DefaultSessionData()
- {
+ public DefaultSessionData() {
data = new ConcurrentHashMap<>();
}
- public void set( Object key, Object value )
- {
- requireNonNull( key, "key cannot be null" );
+ public void set(Object key, Object value) {
+ requireNonNull(key, "key cannot be null");
- if ( value != null )
- {
- data.put( key, value );
- }
- else
- {
- data.remove( key );
+ if (value != null) {
+ data.put(key, value);
+ } else {
+ data.remove(key);
}
}
- public boolean set( Object key, Object oldValue, Object newValue )
- {
- requireNonNull( key, "key cannot be null" );
+ public boolean set(Object key, Object oldValue, Object newValue) {
+ requireNonNull(key, "key cannot be null");
- if ( newValue != null )
- {
- if ( oldValue == null )
- {
- return data.putIfAbsent( key, newValue ) == null;
+ if (newValue != null) {
+ if (oldValue == null) {
+ return data.putIfAbsent(key, newValue) == null;
}
- return data.replace( key, oldValue, newValue );
- }
- else
- {
- if ( oldValue == null )
- {
- return !data.containsKey( key );
+ return data.replace(key, oldValue, newValue);
+ } else {
+ if (oldValue == null) {
+ return !data.containsKey(key);
}
- return data.remove( key, oldValue );
+ return data.remove(key, oldValue);
}
}
- public Object get( Object key )
- {
- requireNonNull( key, "key cannot be null" );
+ public Object get(Object key) {
+ requireNonNull(key, "key cannot be null");
- return data.get( key );
+ return data.get(key);
}
- public Object computeIfAbsent( Object key, Supplier<Object> supplier )
- {
- return data.computeIfAbsent( key, k -> supplier.get() );
+ public Object computeIfAbsent(Object key, Supplier<Object> supplier) {
+ return data.computeIfAbsent(key, k -> supplier.get());
}
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/MultiRuntimeException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/MultiRuntimeException.java
index 94681666..fd359bce 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/MultiRuntimeException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/MultiRuntimeException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.List;
@@ -29,18 +28,14 @@ import static java.util.Objects.requireNonNull;
*
* @since 1.9.0
*/
-public final class MultiRuntimeException
- extends RuntimeException
-{
+public final class MultiRuntimeException extends RuntimeException {
private final List<? extends Throwable> throwables;
- private MultiRuntimeException( String message, List<? extends Throwable> throwables )
- {
- super( message );
+ private MultiRuntimeException(String message, List<? extends Throwable> throwables) {
+ super(message);
this.throwables = throwables;
- for ( Throwable throwable : throwables )
- {
- addSuppressed( throwable );
+ for (Throwable throwable : throwables) {
+ addSuppressed(throwable);
}
}
@@ -49,8 +44,7 @@ public final class MultiRuntimeException
*
* @return The list of throwables, never {@code null}.
*/
- public List<? extends Throwable> getThrowables()
- {
+ public List<? extends Throwable> getThrowables() {
return throwables;
}
@@ -61,14 +55,12 @@ public final class MultiRuntimeException
* <li>if list not empty - {@link MultiRuntimeException} is thrown wrapping all elements</li>
* </ul>
*/
- public static void mayThrow( String message, List<? extends Throwable> throwables )
- {
- requireNonNull( message );
- requireNonNull( throwables );
+ public static void mayThrow(String message, List<? extends Throwable> throwables) {
+ requireNonNull(message);
+ requireNonNull(throwables);
- if ( !throwables.isEmpty() )
- {
- throw new MultiRuntimeException( message, throwables );
+ if (!throwables.isEmpty()) {
+ throw new MultiRuntimeException(message, throwables);
}
}
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java
index 6f9f1144..9bf6268f 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryCache.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,16 +16,16 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* Caches auxiliary data used during repository access like already processed metadata. The data in the cache is meant
* for exclusive consumption by the repository system and is opaque to the cache implementation. <strong>Note:</strong>
* Actual cache implementations must be thread-safe.
- *
+ *
* @see RepositorySystemSession#getCache()
*/
-public interface RepositoryCache
-{
+public interface RepositoryCache {
/**
* Puts the specified data into the cache. It is entirely up to the cache implementation how long this data will be
@@ -36,12 +34,12 @@ public interface RepositoryCache
* <em>Warning:</em> The cache will directly save the provided reference. If the cached data is mutable, i.e. could
* be modified after being put into the cache, the caller is responsible for creating a copy of the original data
* and store the copy in the cache.
- *
+ *
* @param session The repository session during which the cache is accessed, must not be {@code null}.
* @param key The key to use for lookup of the data, must not be {@code null}.
* @param data The data to store in the cache, may be {@code null}.
*/
- void put( RepositorySystemSession session, Object key, Object data );
+ void put(RepositorySystemSession session, Object key, Object data);
/**
* Gets the specified data from the cache.
@@ -49,11 +47,10 @@ public interface RepositoryCache
* <em>Warning:</em> The cache will directly return the saved reference. If the cached data is to be modified after
* its retrieval, the caller is responsible to create a copy of the returned data and use this instead of the cache
* record.
- *
+ *
* @param session The repository session during which the cache is accessed, must not be {@code null}.
* @param key The key to use for lookup of the data, must not be {@code null}.
* @return The requested data or {@code null} if none was present in the cache.
*/
- Object get( RepositorySystemSession session, Object key );
-
+ Object get(RepositorySystemSession session, Object key);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java
index 8d1e6016..a75bfa5e 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryEvent.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,32 +16,32 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.io.File;
import java.util.Collections;
import java.util.List;
-import static java.util.Objects.requireNonNull;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.metadata.Metadata;
import org.eclipse.aether.repository.ArtifactRepository;
+import static java.util.Objects.requireNonNull;
+
/**
* An event describing an action performed by the repository system. Note that events which indicate the end of an
* action like {@link EventType#ARTIFACT_RESOLVED} are generally fired in both the success and the failure case. Use
* {@link #getException()} to check whether an event denotes success or failure.
- *
+ *
* @see RepositoryListener
* @see RepositoryEvent.Builder
*/
-public final class RepositoryEvent
-{
+public final class RepositoryEvent {
/**
* The type of the repository event.
*/
- public enum EventType
- {
+ public enum EventType {
/**
* @see RepositoryListener#artifactDescriptorInvalid(RepositoryEvent)
@@ -139,7 +137,6 @@ public final class RepositoryEvent
* @see RepositoryListener#metadataDeployed(RepositoryEvent)
*/
METADATA_DEPLOYED
-
}
private final EventType type;
@@ -158,8 +155,7 @@ public final class RepositoryEvent
private final RequestTrace trace;
- RepositoryEvent( Builder builder )
- {
+ RepositoryEvent(Builder builder) {
type = builder.type;
session = builder.session;
artifact = builder.artifact;
@@ -172,61 +168,55 @@ public final class RepositoryEvent
/**
* Gets the type of the event.
- *
+ *
* @return The type of the event, never {@code null}.
*/
- public EventType getType()
- {
+ public EventType getType() {
return type;
}
/**
* Gets the repository system session during which the event occurred.
- *
+ *
* @return The repository system session during which the event occurred, never {@code null}.
*/
- public RepositorySystemSession getSession()
- {
+ public RepositorySystemSession getSession() {
return session;
}
/**
* Gets the artifact involved in the event (if any).
- *
+ *
* @return The involved artifact or {@code null} if none.
*/
- public Artifact getArtifact()
- {
+ public Artifact getArtifact() {
return artifact;
}
/**
* Gets the metadata involved in the event (if any).
- *
+ *
* @return The involved metadata or {@code null} if none.
*/
- public Metadata getMetadata()
- {
+ public Metadata getMetadata() {
return metadata;
}
/**
* Gets the file involved in the event (if any).
- *
+ *
* @return The involved file or {@code null} if none.
*/
- public File getFile()
- {
+ public File getFile() {
return file;
}
/**
* Gets the repository involved in the event (if any).
- *
+ *
* @return The involved repository or {@code null} if none.
*/
- public ArtifactRepository getRepository()
- {
+ public ArtifactRepository getRepository() {
return repository;
}
@@ -234,55 +224,47 @@ public final class RepositoryEvent
* Gets the exception that caused the event (if any). As a rule of thumb, an event accompanied by an exception
* indicates a failure of the corresponding action. If multiple exceptions occurred, this method returns the first
* exception.
- *
+ *
* @return The exception or {@code null} if none.
*/
- public Exception getException()
- {
- return exceptions.isEmpty() ? null : exceptions.get( 0 );
+ public Exception getException() {
+ return exceptions.isEmpty() ? null : exceptions.get(0);
}
/**
* Gets the exceptions that caused the event (if any). As a rule of thumb, an event accompanied by exceptions
* indicates a failure of the corresponding action.
- *
+ *
* @return The exceptions, never {@code null}.
*/
- public List<Exception> getExceptions()
- {
+ public List<Exception> getExceptions() {
return exceptions;
}
/**
* Gets the trace information about the request during which the event occurred.
- *
+ *
* @return The trace information or {@code null} if none.
*/
- public RequestTrace getTrace()
- {
+ public RequestTrace getTrace() {
return trace;
}
@Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder( 256 );
- buffer.append( getType() );
- if ( getArtifact() != null )
- {
- buffer.append( " " ).append( getArtifact() );
+ public String toString() {
+ StringBuilder buffer = new StringBuilder(256);
+ buffer.append(getType());
+ if (getArtifact() != null) {
+ buffer.append(" ").append(getArtifact());
}
- if ( getMetadata() != null )
- {
- buffer.append( " " ).append( getMetadata() );
+ if (getMetadata() != null) {
+ buffer.append(" ").append(getMetadata());
}
- if ( getFile() != null )
- {
- buffer.append( " (" ).append( getFile() ).append( ")" );
+ if (getFile() != null) {
+ buffer.append(" (").append(getFile()).append(")");
}
- if ( getRepository() != null )
- {
- buffer.append( " @ " ).append( getRepository() );
+ if (getRepository() != null) {
+ buffer.append(" @ ").append(getRepository());
}
return buffer.toString();
}
@@ -290,8 +272,7 @@ public final class RepositoryEvent
/**
* A builder to create events.
*/
- public static final class Builder
- {
+ public static final class Builder {
final EventType type;
@@ -315,10 +296,9 @@ public final class RepositoryEvent
* @param session The repository system session, must not be {@code null}.
* @param type The type of the event, must not be {@code null}.
*/
- public Builder( RepositorySystemSession session, EventType type )
- {
- this.session = requireNonNull( session, "session cannot be null" );
- this.type = requireNonNull( type, "event type cannot be null" );
+ public Builder(RepositorySystemSession session, EventType type) {
+ this.session = requireNonNull(session, "session cannot be null");
+ this.type = requireNonNull(type, "event type cannot be null");
}
/**
@@ -327,62 +307,54 @@ public final class RepositoryEvent
* @param artifact The involved artifact, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setArtifact( Artifact artifact )
- {
+ public Builder setArtifact(Artifact artifact) {
this.artifact = artifact;
return this;
}
/**
* Sets the metadata involved in the event.
- *
+ *
* @param metadata The involved metadata, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setMetadata( Metadata metadata )
- {
+ public Builder setMetadata(Metadata metadata) {
this.metadata = metadata;
return this;
}
/**
* Sets the repository involved in the event.
- *
+ *
* @param repository The involved repository, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setRepository( ArtifactRepository repository )
- {
+ public Builder setRepository(ArtifactRepository repository) {
this.repository = repository;
return this;
}
/**
* Sets the file involved in the event.
- *
+ *
* @param file The involved file, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setFile( File file )
- {
+ public Builder setFile(File file) {
this.file = file;
return this;
}
/**
* Sets the exception causing the event.
- *
+ *
* @param exception The exception causing the event, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setException( Exception exception )
- {
- if ( exception != null )
- {
- this.exceptions = Collections.singletonList( exception );
- }
- else
- {
+ public Builder setException(Exception exception) {
+ if (exception != null) {
+ this.exceptions = Collections.singletonList(exception);
+ } else {
this.exceptions = Collections.emptyList();
}
return this;
@@ -390,18 +362,14 @@ public final class RepositoryEvent
/**
* Sets the exceptions causing the event.
- *
+ *
* @param exceptions The exceptions causing the event, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setExceptions( List<Exception> exceptions )
- {
- if ( exceptions != null )
- {
+ public Builder setExceptions(List<Exception> exceptions) {
+ if (exceptions != null) {
this.exceptions = exceptions;
- }
- else
- {
+ } else {
this.exceptions = Collections.emptyList();
}
return this;
@@ -409,12 +377,11 @@ public final class RepositoryEvent
/**
* Sets the trace information about the request during which the event occurred.
- *
+ *
* @param trace The trace information, may be {@code null}.
* @return This event builder for chaining, never {@code null}.
*/
- public Builder setTrace( RequestTrace trace )
- {
+ public Builder setTrace(RequestTrace trace) {
this.trace = trace;
return this;
}
@@ -422,14 +389,11 @@ public final class RepositoryEvent
/**
* Builds a new event from the current values of this builder. The state of the builder itself remains
* unchanged.
- *
+ *
* @return The event, never {@code null}.
*/
- public RepositoryEvent build()
- {
- return new RepositoryEvent( this );
+ public RepositoryEvent build() {
+ return new RepositoryEvent(this);
}
-
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java
index abf962eb..d7f19a85 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,34 +16,31 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* The base class for exceptions thrown by the repository system. <em>Note:</em> Unless otherwise noted, instances of
* this class and its subclasses will not persist fields carrying extended error information during serialization.
*/
-public class RepositoryException
- extends Exception
-{
+public class RepositoryException extends Exception {
/**
* Creates a new exception with the specified detail message.
- *
+ *
* @param message The detail message, may be {@code null}.
*/
- public RepositoryException( String message )
- {
- super( message );
+ public RepositoryException(String message) {
+ super(message);
}
/**
* Creates a new exception with the specified detail message and cause.
- *
+ *
* @param message The detail message, may be {@code null}.
* @param cause The exception that caused this one, may be {@code null}.
*/
- public RepositoryException( String message, Throwable cause )
- {
- super( message, cause );
+ public RepositoryException(String message, Throwable cause) {
+ super(message, cause);
}
/**
@@ -54,19 +49,15 @@ public class RepositoryException
* @return The message.
* @noreference This method is not intended to be used by clients.
*/
- protected static String getMessage( String prefix, Throwable cause )
- {
+ protected static String getMessage(String prefix, Throwable cause) {
String msg = "";
- if ( cause != null )
- {
+ if (cause != null) {
msg = cause.getMessage();
- if ( msg == null || msg.isEmpty() )
- {
+ if (msg == null || msg.isEmpty()) {
msg = cause.getClass().getSimpleName();
}
msg = prefix + msg;
}
return msg;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java
index d6546305..cca779b8 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositoryListener.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* A listener being notified of events from the repository system. In general, the system sends events upon termination
@@ -25,14 +24,13 @@ package org.eclipse.aether;
* listeners need to inspect the event details carefully. Also, the listener may be called from an arbitrary thread.
* <em>Note:</em> Implementors are strongly advised to inherit from {@link AbstractRepositoryListener} instead of
* directly implementing this interface.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getRepositoryListener()
* @see org.eclipse.aether.transfer.TransferListener
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface RepositoryListener
-{
+public interface RepositoryListener {
/**
* Notifies the listener of a syntactically or semantically invalid artifact descriptor.
@@ -40,39 +38,39 @@ public interface RepositoryListener
* {@link RepositoryEvent#getExceptions()} carries the encountered errors. Depending on the session's
* {@link org.eclipse.aether.resolution.ArtifactDescriptorPolicy}, the underlying repository operation might abort
* with an exception or ignore the invalid descriptor.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDescriptorInvalid( RepositoryEvent event );
+ void artifactDescriptorInvalid(RepositoryEvent event);
/**
* Notifies the listener of a missing artifact descriptor. {@link RepositoryEvent#getArtifact()} indicates the
* artifact whose descriptor is missing. Depending on the session's
* {@link org.eclipse.aether.resolution.ArtifactDescriptorPolicy}, the underlying repository operation might abort
* with an exception or ignore the missing descriptor.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDescriptorMissing( RepositoryEvent event );
+ void artifactDescriptorMissing(RepositoryEvent event);
/**
* Notifies the listener of syntactically or semantically invalid metadata. {@link RepositoryEvent#getMetadata()}
* indicates the invalid metadata and {@link RepositoryEvent#getExceptions()} carries the encountered errors. The
* underlying repository operation might still succeed, depending on whether the metadata in question is actually
* needed to carry out the resolution process.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataInvalid( RepositoryEvent event );
+ void metadataInvalid(RepositoryEvent event);
/**
* Notifies the listener of an artifact that is about to be resolved. {@link RepositoryEvent#getArtifact()} denotes
* the artifact in question. Unlike the {@link #artifactDownloading(RepositoryEvent)} event, this event is fired
* regardless whether the artifact already exists locally or not.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactResolving( RepositoryEvent event );
+ void artifactResolving(RepositoryEvent event);
/**
* Notifies the listener of an artifact whose resolution has been completed, either successfully or not.
@@ -80,19 +78,19 @@ public interface RepositoryListener
* {@link RepositoryEvent#getExceptions()} indicates whether the resolution succeeded or failed. Unlike the
* {@link #artifactDownloaded(RepositoryEvent)} event, this event is fired regardless whether the artifact already
* exists locally or not.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactResolved( RepositoryEvent event );
+ void artifactResolved(RepositoryEvent event);
/**
* Notifies the listener of some metadata that is about to be resolved. {@link RepositoryEvent#getMetadata()}
* denotes the metadata in question. Unlike the {@link #metadataDownloading(RepositoryEvent)} event, this event is
* fired regardless whether the metadata already exists locally or not.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataResolving( RepositoryEvent event );
+ void metadataResolving(RepositoryEvent event);
/**
* Notifies the listener of some metadata whose resolution has been completed, either successfully or not.
@@ -100,10 +98,10 @@ public interface RepositoryListener
* {@link RepositoryEvent#getExceptions()} indicates whether the resolution succeeded or failed. Unlike the
* {@link #metadataDownloaded(RepositoryEvent)} event, this event is fired regardless whether the metadata already
* exists locally or not.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataResolved( RepositoryEvent event );
+ void metadataResolved(RepositoryEvent event);
/**
* Notifies the listener of an artifact that is about to be downloaded from a remote repository.
@@ -111,10 +109,10 @@ public interface RepositoryListener
* {@link RepositoryEvent#getRepository()} the source repository. Unlike the
* {@link #artifactResolving(RepositoryEvent)} event, this event is only fired when the artifact does not already
* exist locally.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDownloading( RepositoryEvent event );
+ void artifactDownloading(RepositoryEvent event);
/**
* Notifies the listener of an artifact whose download has been completed, either successfully or not.
@@ -122,10 +120,10 @@ public interface RepositoryListener
* {@link RepositoryEvent#getExceptions()} indicates whether the download succeeded or failed. Unlike the
* {@link #artifactResolved(RepositoryEvent)} event, this event is only fired when the artifact does not already
* exist locally.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDownloaded( RepositoryEvent event );
+ void artifactDownloaded(RepositoryEvent event);
/**
* Notifies the listener of some metadata that is about to be downloaded from a remote repository.
@@ -133,10 +131,10 @@ public interface RepositoryListener
* {@link RepositoryEvent#getRepository()} the source repository. Unlike the
* {@link #metadataResolving(RepositoryEvent)} event, this event is only fired when the metadata does not already
* exist locally.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataDownloading( RepositoryEvent event );
+ void metadataDownloading(RepositoryEvent event);
/**
* Notifies the listener of some metadata whose download has been completed, either successfully or not.
@@ -144,79 +142,78 @@ public interface RepositoryListener
* {@link RepositoryEvent#getExceptions()} indicates whether the download succeeded or failed. Unlike the
* {@link #metadataResolved(RepositoryEvent)} event, this event is only fired when the metadata does not already
* exist locally.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataDownloaded( RepositoryEvent event );
+ void metadataDownloaded(RepositoryEvent event);
/**
* Notifies the listener of an artifact that is about to be installed to the local repository.
* {@link RepositoryEvent#getArtifact()} denotes the artifact in question.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactInstalling( RepositoryEvent event );
+ void artifactInstalling(RepositoryEvent event);
/**
* Notifies the listener of an artifact whose installation to the local repository has been completed, either
* successfully or not. {@link RepositoryEvent#getArtifact()} denotes the artifact in question and
* {@link RepositoryEvent#getExceptions()} indicates whether the installation succeeded or failed.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactInstalled( RepositoryEvent event );
+ void artifactInstalled(RepositoryEvent event);
/**
* Notifies the listener of some metadata that is about to be installed to the local repository.
* {@link RepositoryEvent#getMetadata()} denotes the metadata in question.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataInstalling( RepositoryEvent event );
+ void metadataInstalling(RepositoryEvent event);
/**
* Notifies the listener of some metadata whose installation to the local repository has been completed, either
* successfully or not. {@link RepositoryEvent#getMetadata()} denotes the metadata in question and
* {@link RepositoryEvent#getExceptions()} indicates whether the installation succeeded or failed.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataInstalled( RepositoryEvent event );
+ void metadataInstalled(RepositoryEvent event);
/**
* Notifies the listener of an artifact that is about to be uploaded to a remote repository.
* {@link RepositoryEvent#getArtifact()} denotes the artifact in question and
* {@link RepositoryEvent#getRepository()} the destination repository.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDeploying( RepositoryEvent event );
+ void artifactDeploying(RepositoryEvent event);
/**
* Notifies the listener of an artifact whose upload to a remote repository has been completed, either successfully
* or not. {@link RepositoryEvent#getArtifact()} denotes the artifact in question and
* {@link RepositoryEvent#getExceptions()} indicates whether the upload succeeded or failed.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void artifactDeployed( RepositoryEvent event );
+ void artifactDeployed(RepositoryEvent event);
/**
* Notifies the listener of some metadata that is about to be uploaded to a remote repository.
* {@link RepositoryEvent#getMetadata()} denotes the metadata in question and
* {@link RepositoryEvent#getRepository()} the destination repository.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataDeploying( RepositoryEvent event );
+ void metadataDeploying(RepositoryEvent event);
/**
* Notifies the listener of some metadata whose upload to a remote repository has been completed, either
* successfully or not. {@link RepositoryEvent#getMetadata()} denotes the metadata in question and
* {@link RepositoryEvent#getExceptions()} indicates whether the upload succeeded or failed.
- *
+ *
* @param event The event details, must not be {@code null}.
*/
- void metadataDeployed( RepositoryEvent event );
-
+ void metadataDeployed(RepositoryEvent event);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
index be186e87..61a612e2 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystem.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.Collection;
import java.util.List;
@@ -65,8 +64,7 @@ import org.eclipse.aether.resolution.VersionResult;
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface RepositorySystem
-{
+public interface RepositorySystem {
/**
* Expands a version range to a list of matching versions, in ascending order. For example, resolves "[3.8,4.0)" to
@@ -84,7 +82,7 @@ public interface RepositorySystem
* not raise an exception.
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- VersionRangeResult resolveVersionRange( RepositorySystemSession session, VersionRangeRequest request )
+ VersionRangeResult resolveVersionRange(RepositorySystemSession session, VersionRangeRequest request)
throws VersionRangeResolutionException;
/**
@@ -97,7 +95,7 @@ public interface RepositorySystem
* @throws VersionResolutionException If the metaversion could not be resolved.
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- VersionResult resolveVersion( RepositorySystemSession session, VersionRequest request )
+ VersionResult resolveVersion(RepositorySystemSession session, VersionRequest request)
throws VersionResolutionException;
/**
@@ -110,8 +108,7 @@ public interface RepositorySystem
* @see RepositorySystemSession#getArtifactDescriptorPolicy()
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- ArtifactDescriptorResult readArtifactDescriptor( RepositorySystemSession session,
- ArtifactDescriptorRequest request )
+ ArtifactDescriptorResult readArtifactDescriptor(RepositorySystemSession session, ArtifactDescriptorRequest request)
throws ArtifactDescriptorException;
/**
@@ -130,7 +127,7 @@ public interface RepositorySystem
* @see RepositorySystemSession#getDependencyGraphTransformer()
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- CollectResult collectDependencies( RepositorySystemSession session, CollectRequest request )
+ CollectResult collectDependencies(RepositorySystemSession session, CollectRequest request)
throws DependencyCollectionException;
/**
@@ -145,7 +142,7 @@ public interface RepositorySystem
* not be resolved.
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- DependencyResult resolveDependencies( RepositorySystemSession session, DependencyRequest request )
+ DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request)
throws DependencyResolutionException;
/**
@@ -161,7 +158,7 @@ public interface RepositorySystem
* @see Artifact#getFile()
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- ArtifactResult resolveArtifact( RepositorySystemSession session, ArtifactRequest request )
+ ArtifactResult resolveArtifact(RepositorySystemSession session, ArtifactRequest request)
throws ArtifactResolutionException;
/**
@@ -177,8 +174,8 @@ public interface RepositorySystem
* @see Artifact#getFile()
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- List<ArtifactResult> resolveArtifacts( RepositorySystemSession session,
- Collection<? extends ArtifactRequest> requests )
+ List<ArtifactResult> resolveArtifacts(
+ RepositorySystemSession session, Collection<? extends ArtifactRequest> requests)
throws ArtifactResolutionException;
/**
@@ -191,8 +188,8 @@ public interface RepositorySystem
* @see Metadata#getFile()
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- List<MetadataResult> resolveMetadata( RepositorySystemSession session,
- Collection<? extends MetadataRequest> requests );
+ List<MetadataResult> resolveMetadata(
+ RepositorySystemSession session, Collection<? extends MetadataRequest> requests);
/**
* Installs a collection of artifacts and their accompanying metadata to the local repository.
@@ -202,8 +199,7 @@ public interface RepositorySystem
* @return The installation result, never {@code null}.
* @throws InstallationException If any artifact/metadata from the request could not be installed.
*/
- InstallResult install( RepositorySystemSession session, InstallRequest request )
- throws InstallationException;
+ InstallResult install(RepositorySystemSession session, InstallRequest request) throws InstallationException;
/**
* Uploads a collection of artifacts and their accompanying metadata to a remote repository.
@@ -214,8 +210,7 @@ public interface RepositorySystem
* @throws DeploymentException If any artifact/metadata from the request could not be deployed.
* @see #newDeploymentRepository(RepositorySystemSession, RemoteRepository)
*/
- DeployResult deploy( RepositorySystemSession session, DeployRequest request )
- throws DeploymentException;
+ DeployResult deploy(RepositorySystemSession session, DeployRequest request) throws DeploymentException;
/**
* Creates a new manager for the specified local repository. If the specified local repository has no type, the
@@ -230,8 +225,7 @@ public interface RepositorySystem
* @throws IllegalArgumentException If the specified repository type is not recognized or no base directory is
* given.
*/
- LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession session,
- LocalRepository localRepository );
+ LocalRepositoryManager newLocalRepositoryManager(RepositorySystemSession session, LocalRepository localRepository);
/**
* Creates a new synchronization context.
@@ -241,7 +235,7 @@ public interface RepositorySystem
* shared among concurrent readers or whether access needs to be exclusive to the calling thread.
* @return The synchronization context, never {@code null}.
*/
- SyncContext newSyncContext( RepositorySystemSession session, boolean shared );
+ SyncContext newSyncContext(RepositorySystemSession session, boolean shared);
/**
* Forms remote repositories suitable for artifact resolution by applying the session's authentication selector and
@@ -261,8 +255,8 @@ public interface RepositorySystem
* repositories.
* @see #newDeploymentRepository(RepositorySystemSession, RemoteRepository)
*/
- List<RemoteRepository> newResolutionRepositories( RepositorySystemSession session,
- List<RemoteRepository> repositories );
+ List<RemoteRepository> newResolutionRepositories(
+ RepositorySystemSession session, List<RemoteRepository> repositories);
/**
* Forms a remote repository suitable for artifact deployment by applying the session's authentication selector and
@@ -279,7 +273,7 @@ public interface RepositorySystem
* @return The deployment repository, never {@code null}.
* @see #newResolutionRepositories(RepositorySystemSession, List)
*/
- RemoteRepository newDeploymentRepository( RepositorySystemSession session, RemoteRepository repository );
+ RemoteRepository newDeploymentRepository(RepositorySystemSession session, RemoteRepository repository);
/**
* Registers an "on repository system end" handler, executed after repository system is shut down.
@@ -287,7 +281,7 @@ public interface RepositorySystem
* @param handler The handler, must not be {@code null}.
* @since 1.9.0
*/
- void addOnSystemEndedHandler( Runnable handler );
+ void addOnSystemEndedHandler(Runnable handler);
/**
* Signals to repository system to shut down. Shut down instance is not usable anymore.
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java
index df6b2fbf..31e99cd7 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RepositorySystemSession.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.Map;
@@ -48,13 +47,12 @@ import org.eclipse.aether.transform.FileTransformerManager;
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface RepositorySystemSession
-{
+public interface RepositorySystemSession {
/**
* Indicates whether the repository system operates in offline mode and avoids/refuses any access to remote
* repositories.
- *
+ *
* @return {@code true} if the repository system is in offline mode, {@code false} otherwise.
*/
boolean isOffline();
@@ -62,7 +60,7 @@ public interface RepositorySystemSession
/**
* Indicates whether repositories declared in artifact descriptors should be ignored during transitive dependency
* collection. If enabled, only the repositories originally provided with the collect request will be considered.
- *
+ *
* @return {@code true} if additional repositories from artifact descriptors are ignored, {@code false} to merge
* those with the originally specified repositories.
*/
@@ -70,7 +68,7 @@ public interface RepositorySystemSession
/**
* Gets the policy which controls whether resolutions errors from remote repositories should be cached.
- *
+ *
* @return The resolution error policy for this session or {@code null} if resolution errors should generally not be
* cached.
*/
@@ -78,7 +76,7 @@ public interface RepositorySystemSession
/**
* Gets the policy which controls how errors related to reading artifact descriptors should be handled.
- *
+ *
* @return The descriptor error policy for this session or {@code null} if descriptor errors should generally not be
* tolerated.
*/
@@ -87,7 +85,7 @@ public interface RepositorySystemSession
/**
* Gets the global checksum policy. If set, the global checksum policy overrides the checksum policies of the remote
* repositories being used for resolution.
- *
+ *
* @return The global checksum policy or {@code null}/empty if not set and the per-repository policies apply.
* @see RepositoryPolicy#CHECKSUM_POLICY_FAIL
* @see RepositoryPolicy#CHECKSUM_POLICY_IGNORE
@@ -98,7 +96,7 @@ public interface RepositorySystemSession
/**
* Gets the global update policy. If set, the global update policy overrides the update policies of the remote
* repositories being used for resolution.
- *
+ *
* @return The global update policy or {@code null}/empty if not set and the per-repository policies apply.
* @see RepositoryPolicy#UPDATE_POLICY_ALWAYS
* @see RepositoryPolicy#UPDATE_POLICY_DAILY
@@ -109,14 +107,14 @@ public interface RepositorySystemSession
/**
* Gets the local repository used during this session. This is a convenience method for
* {@link LocalRepositoryManager#getRepository()}.
- *
+ *
* @return The local repository being during this session, never {@code null}.
*/
LocalRepository getLocalRepository();
/**
* Gets the local repository manager used during this session.
- *
+ *
* @return The local repository manager used during this session, never {@code null}.
*/
LocalRepositoryManager getLocalRepositoryManager();
@@ -124,21 +122,21 @@ public interface RepositorySystemSession
/**
* Gets the workspace reader used during this session. If set, the workspace reader will usually be consulted first
* to resolve artifacts.
- *
+ *
* @return The workspace reader for this session or {@code null} if none.
*/
WorkspaceReader getWorkspaceReader();
/**
* Gets the listener being notified of actions in the repository system.
- *
+ *
* @return The repository listener or {@code null} if none.
*/
RepositoryListener getRepositoryListener();
/**
* Gets the listener being notified of uploads/downloads by the repository system.
- *
+ *
* @return The transfer listener or {@code null} if none.
*/
TransferListener getTransferListener();
@@ -146,7 +144,7 @@ public interface RepositorySystemSession
/**
* Gets the system properties to use, e.g. for processing of artifact descriptors. System properties are usually
* collected from the runtime environment like {@link System#getProperties()} and environment variables.
- *
+ *
* @return The (read-only) system properties, never {@code null}.
*/
Map<String, String> getSystemProperties();
@@ -155,7 +153,7 @@ public interface RepositorySystemSession
* Gets the user properties to use, e.g. for processing of artifact descriptors. User properties are similar to
* system properties but are set on the discretion of the user and hence are considered of higher priority than
* system properties.
- *
+ *
* @return The (read-only) user properties, never {@code null}.
*/
Map<String, String> getUserProperties();
@@ -163,7 +161,7 @@ public interface RepositorySystemSession
/**
* Gets the configuration properties used to tweak internal aspects of the repository system (e.g. thread pooling,
* connector-specific behavior, etc.)
- *
+ *
* @return The (read-only) configuration properties, never {@code null}.
* @see ConfigurationProperties
*/
@@ -173,7 +171,7 @@ public interface RepositorySystemSession
* Gets the mirror selector to use for repositories discovered in artifact descriptors. Note that this selector is
* not used for remote repositories which are passed as request parameters to the repository system, those
* repositories are supposed to denote the effective repositories.
- *
+ *
* @return The mirror selector to use, never {@code null}.
* @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
*/
@@ -183,7 +181,7 @@ public interface RepositorySystemSession
* Gets the proxy selector to use for repositories discovered in artifact descriptors. Note that this selector is
* not used for remote repositories which are passed as request parameters to the repository system, those
* repositories are supposed to have their proxy (if any) already set.
- *
+ *
* @return The proxy selector to use, never {@code null}.
* @see org.eclipse.aether.repository.RemoteRepository#getProxy()
* @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
@@ -194,7 +192,7 @@ public interface RepositorySystemSession
* Gets the authentication selector to use for repositories discovered in artifact descriptors. Note that this
* selector is not used for remote repositories which are passed as request parameters to the repository system,
* those repositories are supposed to have their authentication (if any) already set.
- *
+ *
* @return The authentication selector to use, never {@code null}.
* @see org.eclipse.aether.repository.RemoteRepository#getAuthentication()
* @see RepositorySystem#newResolutionRepositories(RepositorySystemSession, java.util.List)
@@ -204,14 +202,14 @@ public interface RepositorySystemSession
/**
* Gets the registry of artifact types recognized by this session, for instance when processing artifact
* descriptors.
- *
+ *
* @return The artifact type registry, never {@code null}.
*/
ArtifactTypeRegistry getArtifactTypeRegistry();
/**
* Gets the dependency traverser to use for building dependency graphs.
- *
+ *
* @return The dependency traverser to use for building dependency graphs or {@code null} if dependencies are
* unconditionally traversed.
*/
@@ -219,7 +217,7 @@ public interface RepositorySystemSession
/**
* Gets the dependency manager to use for building dependency graphs.
- *
+ *
* @return The dependency manager to use for building dependency graphs or {@code null} if dependency management is
* not performed.
*/
@@ -227,7 +225,7 @@ public interface RepositorySystemSession
/**
* Gets the dependency selector to use for building dependency graphs.
- *
+ *
* @return The dependency selector to use for building dependency graphs or {@code null} if dependencies are
* unconditionally included.
*/
@@ -235,35 +233,35 @@ public interface RepositorySystemSession
/**
* Gets the version filter to use for building dependency graphs.
- *
+ *
* @return The version filter to use for building dependency graphs or {@code null} if versions aren't filtered.
*/
VersionFilter getVersionFilter();
/**
* Gets the dependency graph transformer to use for building dependency graphs.
- *
+ *
* @return The dependency graph transformer to use for building dependency graphs or {@code null} if none.
*/
DependencyGraphTransformer getDependencyGraphTransformer();
/**
* Gets the custom data associated with this session.
- *
+ *
* @return The session data, never {@code null}.
*/
SessionData getData();
/**
* Gets the cache the repository system may use to save data for future reuse during the session.
- *
+ *
* @return The repository cache or {@code null} if none.
*/
RepositoryCache getCache();
/**
* Get the file transformer manager
- *
+ *
* @return the manager, never {@code null}
* @deprecated Without any direct replacement for now. This API is OOM-prone, and also lacks a lot of context about
* transforming.
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java b/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java
index 86aaa78b..fe202522 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/RequestTrace.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
/**
* A trace of nested requests that are performed by the repository system. This trace information can be used to
@@ -27,11 +26,10 @@ package org.eclipse.aether;
* object that is currently processed. When invoking methods on the repository system, client code may provide a request
* trace that has been prepopulated with whatever data is useful for the application to indicate its state for later
* evaluation when processing the repository events.
- *
+ *
* @see RepositoryEvent#getTrace()
*/
-public class RequestTrace
-{
+public class RequestTrace {
private final RequestTrace parent;
@@ -41,77 +39,68 @@ public class RequestTrace
* Creates a child of the specified request trace. This method is basically a convenience that will invoke
* {@link RequestTrace#newChild(Object) parent.newChild()} when the specified parent trace is not {@code null} or
* otherwise instantiante a new root trace.
- *
+ *
* @param parent The parent request trace, may be {@code null}.
* @param data The data to associate with the child trace, may be {@code null}.
* @return The child trace, never {@code null}.
*/
- public static RequestTrace newChild( RequestTrace parent, Object data )
- {
- if ( parent == null )
- {
- return new RequestTrace( data );
+ public static RequestTrace newChild(RequestTrace parent, Object data) {
+ if (parent == null) {
+ return new RequestTrace(data);
}
- return parent.newChild( data );
+ return parent.newChild(data);
}
/**
* Creates a new root trace with the specified data.
- *
+ *
* @param data The data to associate with the trace, may be {@code null}.
*/
- public RequestTrace( Object data )
- {
- this( null, data );
+ public RequestTrace(Object data) {
+ this(null, data);
}
/**
* Creates a new trace with the specified data and parent
- *
+ *
* @param parent The parent trace, may be {@code null} for a root trace.
* @param data The data to associate with the trace, may be {@code null}.
*/
- protected RequestTrace( RequestTrace parent, Object data )
- {
+ protected RequestTrace(RequestTrace parent, Object data) {
this.parent = parent;
this.data = data;
}
/**
* Gets the data associated with this trace.
- *
+ *
* @return The data associated with this trace or {@code null} if none.
*/
- public final Object getData()
- {
+ public final Object getData() {
return data;
}
/**
* Gets the parent of this trace.
- *
+ *
* @return The parent of this trace or {@code null} if this is the root of the trace stack.
*/
- public final RequestTrace getParent()
- {
+ public final RequestTrace getParent() {
return parent;
}
/**
* Creates a new child of this trace.
- *
+ *
* @param data The data to associate with the child, may be {@code null}.
* @return The child trace, never {@code null}.
*/
- public RequestTrace newChild( Object data )
- {
- return new RequestTrace( this, data );
+ public RequestTrace newChild(Object data) {
+ return new RequestTrace(this, data);
}
@Override
- public String toString()
- {
- return String.valueOf( getData() );
+ public String toString() {
+ return String.valueOf(getData());
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java b/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java
index 330449e2..eeca945f 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/SessionData.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.util.function.Supplier;
@@ -29,41 +28,40 @@ import java.util.function.Supplier;
* abused as a cache (i.e. for storing values that can be re-calculated) to avoid memory exhaustion.
* <p>
* <strong>Note:</strong> Actual implementations must be thread-safe.
- *
+ *
* @see RepositorySystemSession#getData()
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface SessionData
-{
+public interface SessionData {
/**
* Associates the specified session data with the given key.
- *
+ *
* @param key The key under which to store the session data, must not be {@code null}.
* @param value The data to associate with the key, may be {@code null} to remove the mapping.
*/
- void set( Object key, Object value );
+ void set(Object key, Object value);
/**
* Associates the specified session data with the given key if the key is currently mapped to the given value. This
* method provides an atomic compare-and-update of some key's value.
- *
+ *
* @param key The key under which to store the session data, must not be {@code null}.
* @param oldValue The expected data currently associated with the key, may be {@code null}.
* @param newValue The data to associate with the key, may be {@code null} to remove the mapping.
* @return {@code true} if the key mapping was successfully updated from the old value to the new value,
* {@code false} if the current key mapping didn't match the expected value and was not updated.
*/
- boolean set( Object key, Object oldValue, Object newValue );
+ boolean set(Object key, Object oldValue, Object newValue);
/**
* Gets the session data associated with the specified key.
- *
+ *
* @param key The key for which to retrieve the session data, must not be {@code null}.
* @return The session data associated with the key or {@code null} if none.
*/
- Object get( Object key );
+ Object get(Object key);
/**
* Retrieve of compute the data associated with the specified key.
@@ -72,6 +70,5 @@ public interface SessionData
* @param supplier The supplier will compute the new value.
* @return The session data associated with the key.
*/
- Object computeIfAbsent( Object key, Supplier<Object> supplier );
-
+ Object computeIfAbsent(Object key, Supplier<Object> supplier);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java
index 2d751c04..63e8394b 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/SyncContext.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether;
import java.io.Closeable;
import java.util.Collection;
@@ -28,7 +27,7 @@ import org.eclipse.aether.metadata.Metadata;
/**
* A synchronization context used to coordinate concurrent access to artifacts or metadatas. The typical usage of a
* synchronization context looks like this:
- *
+ *
* <pre>
* SyncContext syncContext = repositorySystem.newSyncContext( ... );
* try {
@@ -38,7 +37,7 @@ import org.eclipse.aether.metadata.Metadata;
* syncContext.close();
* }
* </pre>
- *
+ *
* Within one thread, synchronization contexts may be nested which can naturally happen in a hierarchy of method calls.
* The nested synchronization contexts may also acquire overlapping sets of artifacts/metadatas as long as the following
* conditions are met. If the outer-most context holding a particular resource is exclusive, that resource can be
@@ -48,12 +47,10 @@ import org.eclipse.aether.metadata.Metadata;
* A synchronization context is meant to be utilized by only one thread and as such is not thread-safe.
* <p>
* Note that the level of actual synchronization is subject to the implementation and might range from OS-wide to none.
- *
+ *
* @see RepositorySystem#newSyncContext(RepositorySystemSession, boolean)
*/
-public interface SyncContext
- extends Closeable
-{
+public interface SyncContext extends Closeable {
/**
* Acquires synchronized access to the specified artifacts and metadatas. The invocation will potentially block
@@ -61,16 +58,15 @@ public interface SyncContext
* acquired by this synchronization context has no effect. Please also see the class-level documentation for
* information regarding reentrancy. The method may be invoked multiple times on a synchronization context until all
* desired resources have been acquired.
- *
+ *
* @param artifacts The artifacts to acquire, may be {@code null} or empty if none.
* @param metadatas The metadatas to acquire, may be {@code null} or empty if none.
*/
- void acquire( Collection<? extends Artifact> artifacts, Collection<? extends Metadata> metadatas );
+ void acquire(Collection<? extends Artifact> artifacts, Collection<? extends Metadata> metadatas);
/**
* Releases all previously acquired artifacts/metadatas. If no resources have been acquired before or if this
* synchronization context has already been closed, this method does nothing.
*/
void close();
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java
index f18b398c..777a81e2 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/AbstractArtifact.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
import java.io.File;
import java.util.Collections;
@@ -30,57 +29,40 @@ import java.util.regex.Pattern;
/**
* A skeleton class for artifacts.
*/
-public abstract class AbstractArtifact
- implements Artifact
-{
+public abstract class AbstractArtifact implements Artifact {
private static final String SNAPSHOT = "SNAPSHOT";
- private static final Pattern SNAPSHOT_TIMESTAMP = Pattern.compile( "^(.*-)?([0-9]{8}\\.[0-9]{6}-[0-9]+)$" );
+ private static final Pattern SNAPSHOT_TIMESTAMP = Pattern.compile("^(.*-)?([0-9]{8}\\.[0-9]{6}-[0-9]+)$");
- public boolean isSnapshot()
- {
- return isSnapshot( getVersion() );
+ public boolean isSnapshot() {
+ return isSnapshot(getVersion());
}
- private static boolean isSnapshot( String version )
- {
- return version.endsWith( SNAPSHOT ) || SNAPSHOT_TIMESTAMP.matcher( version ).matches();
+ private static boolean isSnapshot(String version) {
+ return version.endsWith(SNAPSHOT) || SNAPSHOT_TIMESTAMP.matcher(version).matches();
}
- public String getBaseVersion()
- {
- return toBaseVersion( getVersion() );
+ public String getBaseVersion() {
+ return toBaseVersion(getVersion());
}
- private static String toBaseVersion( String version )
- {
+ private static String toBaseVersion(String version) {
String baseVersion;
- if ( version == null )
- {
+ if (version == null) {
baseVersion = null;
- }
- else if ( version.startsWith( "[" ) || version.startsWith( "(" ) )
- {
+ } else if (version.startsWith("[") || version.startsWith("(")) {
baseVersion = version;
- }
- else
- {
- Matcher m = SNAPSHOT_TIMESTAMP.matcher( version );
- if ( m.matches() )
- {
- if ( m.group( 1 ) != null )
- {
- baseVersion = m.group( 1 ) + SNAPSHOT;
- }
- else
- {
+ } else {
+ Matcher m = SNAPSHOT_TIMESTAMP.matcher(version);
+ if (m.matches()) {
+ if (m.group(1) != null) {
+ baseVersion = m.group(1) + SNAPSHOT;
+ } else {
baseVersion = SNAPSHOT;
}
- }
- else
- {
+ } else {
baseVersion = version;
}
}
@@ -90,140 +72,119 @@ public abstract class AbstractArtifact
/**
* Creates a new artifact with the specified coordinates, properties and file.
- *
+ *
* @param version The version of the artifact, may be {@code null}.
* @param properties The properties of the artifact, may be {@code null} if none. The method may assume immutability
* of the supplied map, i.e. need not copy it.
* @param file The resolved file of the artifact, may be {@code null}.
* @return The new artifact instance, never {@code null}.
*/
- private Artifact newInstance( String version, Map<String, String> properties, File file )
- {
- return new DefaultArtifact( getGroupId(), getArtifactId(), getClassifier(), getExtension(), version, file,
- properties );
+ private Artifact newInstance(String version, Map<String, String> properties, File file) {
+ return new DefaultArtifact(
+ getGroupId(), getArtifactId(), getClassifier(), getExtension(), version, file, properties);
}
- public Artifact setVersion( String version )
- {
+ public Artifact setVersion(String version) {
String current = getVersion();
- if ( current.equals( version ) || ( version == null && current.isEmpty() ) )
- {
+ if (current.equals(version) || (version == null && current.isEmpty())) {
return this;
}
- return newInstance( version, getProperties(), getFile() );
+ return newInstance(version, getProperties(), getFile());
}
- public Artifact setFile( File file )
- {
+ public Artifact setFile(File file) {
File current = getFile();
- if ( Objects.equals( current, file ) )
- {
+ if (Objects.equals(current, file)) {
return this;
}
- return newInstance( getVersion(), getProperties(), file );
+ return newInstance(getVersion(), getProperties(), file);
}
- public Artifact setProperties( Map<String, String> properties )
- {
+ public Artifact setProperties(Map<String, String> properties) {
Map<String, String> current = getProperties();
- if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) )
- {
+ if (current.equals(properties) || (properties == null && current.isEmpty())) {
return this;
}
- return newInstance( getVersion(), copyProperties( properties ), getFile() );
+ return newInstance(getVersion(), copyProperties(properties), getFile());
}
- public String getProperty( String key, String defaultValue )
- {
- String value = getProperties().get( key );
- return ( value != null ) ? value : defaultValue;
+ public String getProperty(String key, String defaultValue) {
+ String value = getProperties().get(key);
+ return (value != null) ? value : defaultValue;
}
/**
* Copies the specified artifact properties. This utility method should be used when creating new artifact instances
* with caller-supplied properties.
- *
+ *
* @param properties The properties to copy, may be {@code null}.
* @return The copied and read-only properties, never {@code null}.
*/
- protected static Map<String, String> copyProperties( Map<String, String> properties )
- {
- if ( properties != null && !properties.isEmpty() )
- {
- return Collections.unmodifiableMap( new HashMap<>( properties ) );
- }
- else
- {
+ protected static Map<String, String> copyProperties(Map<String, String> properties) {
+ if (properties != null && !properties.isEmpty()) {
+ return Collections.unmodifiableMap(new HashMap<>(properties));
+ } else {
return Collections.emptyMap();
}
}
@Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder( 128 );
- buffer.append( getGroupId() );
- buffer.append( ':' ).append( getArtifactId() );
- buffer.append( ':' ).append( getExtension() );
- if ( getClassifier().length() > 0 )
- {
- buffer.append( ':' ).append( getClassifier() );
+ public String toString() {
+ StringBuilder buffer = new StringBuilder(128);
+ buffer.append(getGroupId());
+ buffer.append(':').append(getArtifactId());
+ buffer.append(':').append(getExtension());
+ if (getClassifier().length() > 0) {
+ buffer.append(':').append(getClassifier());
}
- buffer.append( ':' ).append( getVersion() );
+ buffer.append(':').append(getVersion());
return buffer.toString();
}
/**
* Compares this artifact with the specified object.
- *
+ *
* @param obj The object to compare this artifact against, may be {@code null}.
* @return {@code true} if and only if the specified object is another {@link Artifact} with equal coordinates,
* properties and file, {@code false} otherwise.
*/
@Override
- public boolean equals( Object obj )
- {
- if ( obj == this )
- {
+ public boolean equals(Object obj) {
+ if (obj == this) {
return true;
- }
- else if ( !( obj instanceof Artifact ) )
- {
+ } else if (!(obj instanceof Artifact)) {
return false;
}
Artifact that = (Artifact) obj;
- return Objects.equals( getArtifactId(), that.getArtifactId() )
- && Objects.equals( getGroupId(), that.getGroupId() )
- && Objects.equals( getVersion(), that.getVersion() )
- && Objects.equals( getExtension(), that.getExtension() )
- && Objects.equals( getClassifier(), that.getClassifier() )
- && Objects.equals( getFile(), that.getFile() )
- && Objects.equals( getProperties(), that.getProperties() );
+ return Objects.equals(getArtifactId(), that.getArtifactId())
+ && Objects.equals(getGroupId(), that.getGroupId())
+ && Objects.equals(getVersion(), that.getVersion())
+ && Objects.equals(getExtension(), that.getExtension())
+ && Objects.equals(getClassifier(), that.getClassifier())
+ && Objects.equals(getFile(), that.getFile())
+ && Objects.equals(getProperties(), that.getProperties());
}
/**
* Returns a hash code for this artifact.
- *
+ *
* @return A hash code for the artifact.
*/
@Override
- public int hashCode()
- {
+ public int hashCode() {
int hash = 17;
hash = hash * 31 + getGroupId().hashCode();
hash = hash * 31 + getArtifactId().hashCode();
hash = hash * 31 + getExtension().hashCode();
hash = hash * 31 + getClassifier().hashCode();
hash = hash * 31 + getVersion().hashCode();
- hash = hash * 31 + hash( getFile() );
+ hash = hash * 31 + hash(getFile());
return hash;
}
- private static int hash( Object obj )
- {
- return ( obj != null ) ? obj.hashCode() : 0;
+ private static int hash(Object obj) {
+ return (obj != null) ? obj.hashCode() : 0;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java
index 63232432..d9736c12 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/Artifact.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
import java.io.File;
import java.util.Map;
@@ -27,23 +26,22 @@ import java.util.Map;
* data. <em>Note:</em> Artifact instances are supposed to be immutable, e.g. any exposed mutator method returns a new
* artifact instance and leaves the original instance unchanged. <em>Note:</em> Implementors are strongly advised to
* inherit from {@link AbstractArtifact} instead of directly implementing this interface.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface Artifact
-{
+public interface Artifact {
/**
* Gets the group identifier of this artifact, for example "org.apache.maven".
- *
+ *
* @return The group identifier, never {@code null}.
*/
String getGroupId();
/**
* Gets the artifact identifier of this artifact, for example "maven-model".
- *
+ *
* @return The artifact identifier, never {@code null}.
*/
String getArtifactId();
@@ -52,44 +50,44 @@ public interface Artifact
* Gets the version of this artifact, for example "1.0-20100529-1213". Note that in case of meta versions like
* "1.0-SNAPSHOT", the artifact's version depends on the state of the artifact. Artifacts that have been resolved or
* deployed will usually have the meta version expanded.
- *
+ *
* @return The version, never {@code null}.
*/
String getVersion();
/**
* Sets the version of the artifact.
- *
+ *
* @param version The version of this artifact, may be {@code null} or empty.
* @return The new artifact, never {@code null}.
*/
- Artifact setVersion( String version );
+ Artifact setVersion(String version);
/**
* Gets the base version of this artifact, for example "1.0-SNAPSHOT". In contrast to the {@link #getVersion()}, the
* base version will always refer to the unresolved meta version.
- *
+ *
* @return The base version, never {@code null}.
*/
String getBaseVersion();
/**
* Determines whether this artifact uses a snapshot version.
- *
+ *
* @return {@code true} if the artifact is a snapshot, {@code false} otherwise.
*/
boolean isSnapshot();
/**
* Gets the classifier of this artifact, for example "sources".
- *
+ *
* @return The classifier or an empty string if none, never {@code null}.
*/
String getClassifier();
/**
* Gets the (file) extension of this artifact, for example "jar" or "tar.gz".
- *
+ *
* @return The file extension (without leading period), never {@code null}.
*/
String getExtension();
@@ -97,34 +95,34 @@ public interface Artifact
/**
* Gets the file of this artifact. Note that only resolved artifacts have a file associated with them. In general,
* callers must not assume any relationship between an artifact's filename and its coordinates.
- *
+ *
* @return The file or {@code null} if the artifact isn't resolved.
*/
File getFile();
/**
* Sets the file of the artifact.
- *
+ *
* @param file The file of the artifact, may be {@code null}
* @return The new artifact, never {@code null}.
*/
- Artifact setFile( File file );
+ Artifact setFile(File file);
/**
* Gets the specified property.
- *
+ *
* @param key The name of the property, must not be {@code null}.
* @param defaultValue The default value to return in case the property is not set, may be {@code null}.
* @return The requested property value or {@code null} if the property is not set and no default value was
* provided.
* @see ArtifactProperties
*/
- String getProperty( String key, String defaultValue );
+ String getProperty(String key, String defaultValue);
/**
* Gets the properties of this artifact. Clients may use these properties to associate non-persistent values with an
* artifact that help later processing when the artifact gets passed around within the application.
- *
+ *
* @return The (read-only) properties, never {@code null}.
* @see ArtifactProperties
*/
@@ -133,11 +131,10 @@ public interface Artifact
/**
* Sets the properties for the artifact. Note that these properties exist merely in memory and are not persisted
* when the artifact gets installed/deployed to a repository.
- *
+ *
* @param properties The properties for the artifact, may be {@code null}.
* @return The new artifact, never {@code null}.
* @see ArtifactProperties
*/
- Artifact setProperties( Map<String, String> properties );
-
+ Artifact setProperties(Map<String, String> properties);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
index 11080868..b900e292 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactProperties.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,18 +16,18 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
/**
* The keys for common properties of artifacts.
- *
+ *
* @see Artifact#getProperties()
*/
-public final class ArtifactProperties
-{
+public final class ArtifactProperties {
/**
* A high-level characterization of the artifact, e.g. "maven-plugin" or "test-jar".
- *
+ *
* @see ArtifactType#getId()
*/
public static final String TYPE = "type";
@@ -66,9 +64,7 @@ public final class ArtifactProperties
*/
public static final String DOWNLOAD_URL = "downloadUrl";
- private ArtifactProperties()
- {
+ private ArtifactProperties() {
// hide constructor
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java
index 5f872174..58942213 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactType.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
import java.util.Map;
@@ -25,18 +24,17 @@ import java.util.Map;
* An artifact type describing artifact characteristics/properties that are common for certain artifacts. Artifact types
* are a means to simplify the description of an artifact by referring to an artifact type instead of specifying the
* various properties individually.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
* @see ArtifactTypeRegistry
* @see DefaultArtifact#DefaultArtifact(String, String, String, String, String, ArtifactType)
*/
-public interface ArtifactType
-{
+public interface ArtifactType {
/**
* Gets the identifier of this type, e.g. "maven-plugin" or "test-jar".
- *
+ *
* @return The identifier of this type, never {@code null}.
* @see ArtifactProperties#TYPE
*/
@@ -44,24 +42,23 @@ public interface ArtifactType
/**
* Gets the file extension to use for artifacts of this type (unless explicitly overridden by the artifact).
- *
+ *
* @return The usual file extension, never {@code null}.
*/
String getExtension();
/**
* Gets the classifier to use for artifacts of this type (unless explicitly overridden by the artifact).
- *
+ *
* @return The usual classifier or an empty string if none, never {@code null}.
*/
String getClassifier();
/**
* Gets the properties to use for artifacts of this type (unless explicitly overridden by the artifact).
- *
+ *
* @return The (read-only) properties, never {@code null}.
* @see ArtifactProperties
*/
Map<String, String> getProperties();
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java
index f3791733..b07244ea 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/ArtifactTypeRegistry.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,21 +16,20 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
/**
* A registry of known artifact types.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getArtifactTypeRegistry()
*/
-public interface ArtifactTypeRegistry
-{
+public interface ArtifactTypeRegistry {
/**
* Gets the artifact type with the specified identifier.
- *
+ *
* @param typeId The identifier of the type, must not be {@code null}.
* @return The artifact type or {@code null} if no type with the requested identifier exists.
*/
- ArtifactType get( String typeId );
-
+ ArtifactType get(String typeId);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
index f385e2c8..bf582733 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifact.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
import java.io.File;
import java.util.Collections;
@@ -30,11 +29,9 @@ import java.util.regex.Pattern;
* A simple artifact. <em>Note:</em> Instances of this class are immutable and the exposed mutators return new objects
* rather than changing the current instance.
*/
-public final class DefaultArtifact
- extends AbstractArtifact
-{
+public final class DefaultArtifact extends AbstractArtifact {
private static final Pattern COORDINATE_PATTERN =
- Pattern.compile( "([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)" );
+ Pattern.compile("([^: ]+):([^: ]+)(:([^: ]*)(:([^: ]+))?)?:([^: ]+)");
private final String groupId;
@@ -53,22 +50,21 @@ public final class DefaultArtifact
/**
* Creates a new artifact with the specified coordinates. If not specified in the artifact coordinates, the
* artifact's extension defaults to {@code jar} and classifier to an empty string.
- *
+ *
* @param coords The artifact coordinates in the format
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>}, must not be {@code null}.
*
* @throws IllegalArgumentException If the artifact coordinates found in {@code coords} do not match the expected
* format.
*/
- public DefaultArtifact( String coords )
- {
- this( coords, Collections.<String, String>emptyMap() );
+ public DefaultArtifact(String coords) {
+ this(coords, Collections.<String, String>emptyMap());
}
/**
* Creates a new artifact with the specified coordinates and properties. If not specified in the artifact
* coordinates, the artifact's extension defaults to {@code jar} and classifier to an empty string.
- *
+ *
* @param coords The artifact coordinates in the format
* {@code <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>}, must not be {@code null}.
* @param properties The artifact properties, may be {@code null}.
@@ -76,55 +72,50 @@ public final class DefaultArtifact
* @throws IllegalArgumentException If the artifact coordinates found in {@code coords} do not match the expected
* format.
*/
- public DefaultArtifact( String coords, Map<String, String> properties )
- {
- Matcher m = COORDINATE_PATTERN.matcher( coords );
- if ( !m.matches() )
- {
- throw new IllegalArgumentException( "Bad artifact coordinates " + coords
- + ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>" );
+ public DefaultArtifact(String coords, Map<String, String> properties) {
+ Matcher m = COORDINATE_PATTERN.matcher(coords);
+ if (!m.matches()) {
+ throw new IllegalArgumentException("Bad artifact coordinates " + coords
+ + ", expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>");
}
- groupId = m.group( 1 );
- artifactId = m.group( 2 );
- extension = get( m.group( 4 ), "jar" );
- classifier = get( m.group( 6 ), "" );
- version = m.group( 7 );
+ groupId = m.group(1);
+ artifactId = m.group(2);
+ extension = get(m.group(4), "jar");
+ classifier = get(m.group(6), "");
+ version = m.group(7);
file = null;
- this.properties = copyProperties( properties );
+ this.properties = copyProperties(properties);
}
- private static String get( String value, String defaultValue )
- {
- return ( value == null || value.isEmpty() ) ? defaultValue : value;
+ private static String get(String value, String defaultValue) {
+ return (value == null || value.isEmpty()) ? defaultValue : value;
}
/**
* Creates a new artifact with the specified coordinates and no classifier. Passing {@code null} for any of the
* coordinates is equivalent to specifying an empty string.
- *
+ *
* @param groupId The group identifier of the artifact, may be {@code null}.
* @param artifactId The artifact identifier of the artifact, may be {@code null}.
* @param extension The file extension of the artifact, may be {@code null}.
* @param version The version of the artifact, may be {@code null}.
*/
- public DefaultArtifact( String groupId, String artifactId, String extension, String version )
- {
- this( groupId, artifactId, "", extension, version );
+ public DefaultArtifact(String groupId, String artifactId, String extension, String version) {
+ this(groupId, artifactId, "", extension, version);
}
/**
* Creates a new artifact with the specified coordinates. Passing {@code null} for any of the coordinates is
* equivalent to specifying an empty string.
- *
+ *
* @param groupId The group identifier of the artifact, may be {@code null}.
* @param artifactId The artifact identifier of the artifact, may be {@code null}.
* @param classifier The classifier of the artifact, may be {@code null}.
* @param extension The file extension of the artifact, may be {@code null}.
* @param version The version of the artifact, may be {@code null}.
*/
- public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version )
- {
- this( groupId, artifactId, classifier, extension, version, null, (File) null );
+ public DefaultArtifact(String groupId, String artifactId, String classifier, String extension, String version) {
+ this(groupId, artifactId, classifier, extension, version, null, (File) null);
}
/**
@@ -132,7 +123,7 @@ public final class DefaultArtifact
* equivalent to specifying an empty string. The optional artifact type provided to this constructor will be used to
* determine the artifact's classifier and file extension if the corresponding arguments for this constructor are
* {@code null}.
- *
+ *
* @param groupId The group identifier of the artifact, may be {@code null}.
* @param artifactId The artifact identifier of the artifact, may be {@code null}.
* @param classifier The classifier of the artifact, may be {@code null}.
@@ -140,10 +131,9 @@ public final class DefaultArtifact
* @param version The version of the artifact, may be {@code null}.
* @param type The artifact type from which to query classifier, file extension and properties, may be {@code null}.
*/
- public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version,
- ArtifactType type )
- {
- this( groupId, artifactId, classifier, extension, version, null, type );
+ public DefaultArtifact(
+ String groupId, String artifactId, String classifier, String extension, String version, ArtifactType type) {
+ this(groupId, artifactId, classifier, extension, version, null, type);
}
/**
@@ -152,7 +142,7 @@ public final class DefaultArtifact
* will be used to determine the artifact's classifier and file extension if the corresponding arguments for this
* constructor are {@code null}. If the artifact type specifies properties, those will get merged with the
* properties passed directly into the constructor, with the latter properties taking precedence.
- *
+ *
* @param groupId The group identifier of the artifact, may be {@code null}.
* @param artifactId The artifact identifier of the artifact, may be {@code null}.
* @param classifier The classifier of the artifact, may be {@code null}.
@@ -161,52 +151,45 @@ public final class DefaultArtifact
* @param properties The properties of the artifact, may be {@code null} if none.
* @param type The artifact type from which to query classifier, file extension and properties, may be {@code null}.
*/
- public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version,
- Map<String, String> properties, ArtifactType type )
- {
- this.groupId = emptify( groupId );
- this.artifactId = emptify( artifactId );
- if ( classifier != null || type == null )
- {
- this.classifier = emptify( classifier );
- }
- else
- {
- this.classifier = emptify( type.getClassifier() );
- }
- if ( extension != null || type == null )
- {
- this.extension = emptify( extension );
+ public DefaultArtifact(
+ String groupId,
+ String artifactId,
+ String classifier,
+ String extension,
+ String version,
+ Map<String, String> properties,
+ ArtifactType type) {
+ this.groupId = emptify(groupId);
+ this.artifactId = emptify(artifactId);
+ if (classifier != null || type == null) {
+ this.classifier = emptify(classifier);
+ } else {
+ this.classifier = emptify(type.getClassifier());
}
- else
- {
- this.extension = emptify( type.getExtension() );
+ if (extension != null || type == null) {
+ this.extension = emptify(extension);
+ } else {
+ this.extension = emptify(type.getExtension());
}
- this.version = emptify( version );
+ this.version = emptify(version);
this.file = null;
- this.properties = merge( properties, ( type != null ) ? type.getProperties() : null );
+ this.properties = merge(properties, (type != null) ? type.getProperties() : null);
}
- private static Map<String, String> merge( Map<String, String> dominant, Map<String, String> recessive )
- {
+ private static Map<String, String> merge(Map<String, String> dominant, Map<String, String> recessive) {
Map<String, String> properties;
- if ( ( dominant == null || dominant.isEmpty() ) && ( recessive == null || recessive.isEmpty() ) )
- {
+ if ((dominant == null || dominant.isEmpty()) && (recessive == null || recessive.isEmpty())) {
properties = Collections.emptyMap();
- }
- else
- {
+ } else {
properties = new HashMap<>();
- if ( recessive != null )
- {
- properties.putAll( recessive );
+ if (recessive != null) {
+ properties.putAll(recessive);
}
- if ( dominant != null )
- {
- properties.putAll( dominant );
+ if (dominant != null) {
+ properties.putAll(dominant);
}
- properties = Collections.unmodifiableMap( properties );
+ properties = Collections.unmodifiableMap(properties);
}
return properties;
@@ -215,7 +198,7 @@ public final class DefaultArtifact
/**
* Creates a new artifact with the specified coordinates, properties and file. Passing {@code null} for any of the
* coordinates is equivalent to specifying an empty string.
- *
+ *
* @param groupId The group identifier of the artifact, may be {@code null}.
* @param artifactId The artifact identifier of the artifact, may be {@code null}.
* @param classifier The classifier of the artifact, may be {@code null}.
@@ -224,69 +207,70 @@ public final class DefaultArtifact
* @param properties The properties of the artifact, may be {@code null} if none.
* @param file The resolved file of the artifact, may be {@code null}.
*/
- public DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version,
- Map<String, String> properties, File file )
- {
- this.groupId = emptify( groupId );
- this.artifactId = emptify( artifactId );
- this.classifier = emptify( classifier );
- this.extension = emptify( extension );
- this.version = emptify( version );
+ public DefaultArtifact(
+ String groupId,
+ String artifactId,
+ String classifier,
+ String extension,
+ String version,
+ Map<String, String> properties,
+ File file) {
+ this.groupId = emptify(groupId);
+ this.artifactId = emptify(artifactId);
+ this.classifier = emptify(classifier);
+ this.extension = emptify(extension);
+ this.version = emptify(version);
this.file = file;
- this.properties = copyProperties( properties );
+ this.properties = copyProperties(properties);
}
- DefaultArtifact( String groupId, String artifactId, String classifier, String extension, String version, File file,
- Map<String, String> properties )
- {
+ DefaultArtifact(
+ String groupId,
+ String artifactId,
+ String classifier,
+ String extension,
+ String version,
+ File file,
+ Map<String, String> properties) {
// NOTE: This constructor assumes immutability of the provided properties, for internal use only
- this.groupId = emptify( groupId );
- this.artifactId = emptify( artifactId );
- this.classifier = emptify( classifier );
- this.extension = emptify( extension );
- this.version = emptify( version );
+ this.groupId = emptify(groupId);
+ this.artifactId = emptify(artifactId);
+ this.classifier = emptify(classifier);
+ this.extension = emptify(extension);
+ this.version = emptify(version);
this.file = file;
this.properties = properties;
}
- private static String emptify( String str )
- {
- return ( str == null ) ? "" : str;
+ private static String emptify(String str) {
+ return (str == null) ? "" : str;
}
- public String getGroupId()
- {
+ public String getGroupId() {
return groupId;
}
- public String getArtifactId()
- {
+ public String getArtifactId() {
return artifactId;
}
- public String getVersion()
- {
+ public String getVersion() {
return version;
}
- public String getClassifier()
- {
+ public String getClassifier() {
return classifier;
}
- public String getExtension()
- {
+ public String getExtension() {
return extension;
}
- public File getFile()
- {
+ public File getFile() {
return file;
}
- public Map<String, String> getProperties()
- {
+ public Map<String, String> getProperties() {
return properties;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
index 5d23aa23..68d8963d 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/DefaultArtifactType.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.artifact;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.artifact;
* 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
- *
+ *
+ * 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
@@ -18,18 +16,18 @@ package org.eclipse.aether.artifact;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.artifact;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+
import static java.util.Objects.requireNonNull;
/**
* A simple artifact type.
*/
-public final class DefaultArtifactType
- implements ArtifactType
-{
+public final class DefaultArtifactType implements ArtifactType {
private final String id;
@@ -45,34 +43,32 @@ public final class DefaultArtifactType
* {@link ArtifactProperties#LANGUAGE}, {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} and
* {@link ArtifactProperties#INCLUDES_DEPENDENCIES} will be set to {@code "none"}, {@code true} and {@code false},
* respectively.
- *
+ *
* @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE}
* property, must not be {@code null} or empty.
*/
- public DefaultArtifactType( String id )
- {
- this( id, id, "", "none", false, false );
+ public DefaultArtifactType(String id) {
+ this(id, id, "", "none", false, false);
}
/**
* Creates a new artifact type with the specified properties. Additionally, the properties
* {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} and {@link ArtifactProperties#INCLUDES_DEPENDENCIES} will be
* set to {@code true} and {@code false}, respectively.
- *
+ *
* @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE}
* property, must not be {@code null} or empty.
* @param extension The usual file extension for artifacts of this type, may be {@code null}.
* @param classifier The usual classifier for artifacts of this type, may be {@code null}.
* @param language The value for the {@link ArtifactProperties#LANGUAGE} property, may be {@code null}.
*/
- public DefaultArtifactType( String id, String extension, String classifier, String language )
- {
- this( id, extension, classifier, language, true, false );
+ public DefaultArtifactType(String id, String extension, String classifier, String language) {
+ this(id, extension, classifier, language, true, false);
}
/**
* Creates a new artifact type with the specified properties.
- *
+ *
* @param id The identifier of the type which will also be used as the value for the {@link ArtifactProperties#TYPE}
* property, must not be {@code null} or empty.
* @param extension The usual file extension for artifacts of this type, may be {@code null}.
@@ -81,67 +77,62 @@ public final class DefaultArtifactType
* @param constitutesBuildPath The value for the {@link ArtifactProperties#CONSTITUTES_BUILD_PATH} property.
* @param includesDependencies The value for the {@link ArtifactProperties#INCLUDES_DEPENDENCIES} property.
*/
- public DefaultArtifactType( String id, String extension, String classifier, String language,
- boolean constitutesBuildPath, boolean includesDependencies )
- {
- this.id = requireNonNull( id, "type id cannot be null" );
- if ( id.length() == 0 )
- {
- throw new IllegalArgumentException( "type id cannot be empty" );
+ public DefaultArtifactType(
+ String id,
+ String extension,
+ String classifier,
+ String language,
+ boolean constitutesBuildPath,
+ boolean includesDependencies) {
+ this.id = requireNonNull(id, "type id cannot be null");
+ if (id.length() == 0) {
+ throw new IllegalArgumentException("type id cannot be empty");
}
- this.extension = emptify( extension );
- this.classifier = emptify( classifier );
+ this.extension = emptify(extension);
+ this.classifier = emptify(classifier);
Map<String, String> props = new HashMap<>();
- props.put( ArtifactProperties.TYPE, id );
- props.put( ArtifactProperties.LANGUAGE, ( language != null && language.length() > 0 ) ? language : "none" );
- props.put( ArtifactProperties.INCLUDES_DEPENDENCIES, Boolean.toString( includesDependencies ) );
- props.put( ArtifactProperties.CONSTITUTES_BUILD_PATH, Boolean.toString( constitutesBuildPath ) );
- properties = Collections.unmodifiableMap( props );
+ props.put(ArtifactProperties.TYPE, id);
+ props.put(ArtifactProperties.LANGUAGE, (language != null && language.length() > 0) ? language : "none");
+ props.put(ArtifactProperties.INCLUDES_DEPENDENCIES, Boolean.toString(includesDependencies));
+ props.put(ArtifactProperties.CONSTITUTES_BUILD_PATH, Boolean.toString(constitutesBuildPath));
+ properties = Collections.unmodifiableMap(props);
}
/**
* Creates a new artifact type with the specified properties.
- *
+ *
* @param id The identifier of the type, must not be {@code null} or empty.
* @param extension The usual file extension for artifacts of this type, may be {@code null}.
* @param classifier The usual classifier for artifacts of this type, may be {@code null}.
* @param properties The properties for artifacts of this type, may be {@code null}.
*/
- public DefaultArtifactType( String id, String extension, String classifier, Map<String, String> properties )
- {
- this.id = requireNonNull( id, "type id cannot be null" );
- if ( id.length() == 0 )
- {
- throw new IllegalArgumentException( "type id cannot be empty" );
+ public DefaultArtifactType(String id, String extension, String classifier, Map<String, String> properties) {
+ this.id = requireNonNull(id, "type id cannot be null");
+ if (id.length() == 0) {
+ throw new IllegalArgumentException("type id cannot be empty");
}
- this.extension = emptify( extension );
- this.classifier = emptify( classifier );
- this.properties = AbstractArtifact.copyProperties( properties );
+ this.extension = emptify(extension);
+ this.classifier = emptify(classifier);
+ this.properties = AbstractArtifact.copyProperties(properties);
}
- private static String emptify( String str )
- {
- return ( str == null ) ? "" : str;
+ private static String emptify(String str) {
+ return (str == null) ? "" : str;
}
- public String getId()
- {
+ public String getId() {
return id;
}
- public String getExtension()
- {
+ public String getExtension() {
return extension;
}
- public String getClassifier()
- {
+ public String getClassifier() {
return classifier;
}
- public Map<String, String> getProperties()
- {
+ public Map<String, String> getProperties() {
return properties;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java
index 9a4cc795..373c1f70 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/artifact/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -21,4 +21,3 @@
* The definition of an artifact, that is the primary entity managed by the repository system.
*/
package org.eclipse.aether.artifact;
-
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java
index 59bc620e..d524127e 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectRequest.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.ArrayList;
import java.util.Collections;
@@ -35,11 +34,10 @@ import org.eclipse.aether.repository.RemoteRepository;
* dependencies can be specified in which case the specified direct dependencies are merged with the direct dependencies
* retrieved from the artifact descriptor of the root dependency. And last, only direct dependencies can be specified in
* which case the root node of the resulting graph has no associated dependency.
- *
+ *
* @see RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, CollectRequest)
*/
-public final class CollectRequest
-{
+public final class CollectRequest {
private Artifact rootArtifact;
@@ -58,61 +56,56 @@ public final class CollectRequest
/**
* Creates an uninitialized request.
*/
- public CollectRequest()
- {
+ public CollectRequest() {
// enables default constructor
}
/**
* Creates a request with the specified properties.
- *
+ *
* @param root The root dependency whose transitive dependencies should be collected, may be {@code null}.
* @param repositories The repositories to use for the collection, may be {@code null}.
*/
- public CollectRequest( Dependency root, List<RemoteRepository> repositories )
- {
- setRoot( root );
- setRepositories( repositories );
+ public CollectRequest(Dependency root, List<RemoteRepository> repositories) {
+ setRoot(root);
+ setRepositories(repositories);
}
/**
* Creates a new request with the specified properties.
- *
+ *
* @param root The root dependency whose transitive dependencies should be collected, may be {@code null}.
* @param dependencies The direct dependencies to merge with the direct dependencies from the root dependency's
* artifact descriptor.
* @param repositories The repositories to use for the collection, may be {@code null}.
*/
- public CollectRequest( Dependency root, List<Dependency> dependencies, List<RemoteRepository> repositories )
- {
- setRoot( root );
- setDependencies( dependencies );
- setRepositories( repositories );
+ public CollectRequest(Dependency root, List<Dependency> dependencies, List<RemoteRepository> repositories) {
+ setRoot(root);
+ setDependencies(dependencies);
+ setRepositories(repositories);
}
/**
* Creates a new request with the specified properties.
- *
+ *
* @param dependencies The direct dependencies of some imaginary root, may be {@code null}.
* @param managedDependencies The dependency management information to apply to the transitive dependencies, may be
* {@code null}.
* @param repositories The repositories to use for the collection, may be {@code null}.
*/
- public CollectRequest( List<Dependency> dependencies, List<Dependency> managedDependencies,
- List<RemoteRepository> repositories )
- {
- setDependencies( dependencies );
- setManagedDependencies( managedDependencies );
- setRepositories( repositories );
+ public CollectRequest(
+ List<Dependency> dependencies, List<Dependency> managedDependencies, List<RemoteRepository> repositories) {
+ setDependencies(dependencies);
+ setManagedDependencies(managedDependencies);
+ setRepositories(repositories);
}
/**
* Gets the root artifact for the dependency graph.
- *
+ *
* @return The root artifact for the dependency graph or {@code null} if none.
*/
- public Artifact getRootArtifact()
- {
+ public Artifact getRootArtifact() {
return rootArtifact;
}
@@ -123,45 +116,41 @@ public final class CollectRequest
* <em>artifact</em> on the other hand is only used as a label for the root node of the graph in case no root
* dependency was specified. As such, the configured root artifact is ignored if {@link #getRoot()} does not return
* {@code null}.
- *
+ *
* @param rootArtifact The root artifact for the dependency graph, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setRootArtifact( Artifact rootArtifact )
- {
+ public CollectRequest setRootArtifact(Artifact rootArtifact) {
this.rootArtifact = rootArtifact;
return this;
}
/**
* Gets the root dependency of the graph.
- *
+ *
* @return The root dependency of the graph or {@code null} if none.
*/
- public Dependency getRoot()
- {
+ public Dependency getRoot() {
return root;
}
/**
* Sets the root dependency of the graph.
- *
+ *
* @param root The root dependency of the graph, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setRoot( Dependency root )
- {
+ public CollectRequest setRoot(Dependency root) {
this.root = root;
return this;
}
/**
* Gets the direct dependencies.
- *
+ *
* @return The direct dependencies, never {@code null}.
*/
- public List<Dependency> getDependencies()
- {
+ public List<Dependency> getDependencies() {
return dependencies;
}
@@ -169,18 +158,14 @@ public final class CollectRequest
* Sets the direct dependencies. If both a root dependency and direct dependencies are given in the request, the
* direct dependencies from the request will be merged with the direct dependencies from the root dependency's
* artifact descriptor, giving higher priority to the dependencies from the request.
- *
+ *
* @param dependencies The direct dependencies, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setDependencies( List<Dependency> dependencies )
- {
- if ( dependencies == null )
- {
+ public CollectRequest setDependencies(List<Dependency> dependencies) {
+ if (dependencies == null) {
this.dependencies = Collections.emptyList();
- }
- else
- {
+ } else {
this.dependencies = dependencies;
}
return this;
@@ -188,48 +173,40 @@ public final class CollectRequest
/**
* Adds the specified direct dependency.
- *
+ *
* @param dependency The dependency to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest addDependency( Dependency dependency )
- {
- if ( dependency != null )
- {
- if ( this.dependencies.isEmpty() )
- {
+ public CollectRequest addDependency(Dependency dependency) {
+ if (dependency != null) {
+ if (this.dependencies.isEmpty()) {
this.dependencies = new ArrayList<>();
}
- this.dependencies.add( dependency );
+ this.dependencies.add(dependency);
}
return this;
}
/**
* Gets the dependency management to apply to transitive dependencies.
- *
+ *
* @return The dependency management to apply to transitive dependencies, never {@code null}.
*/
- public List<Dependency> getManagedDependencies()
- {
+ public List<Dependency> getManagedDependencies() {
return managedDependencies;
}
/**
* Sets the dependency management to apply to transitive dependencies. To clarify, this management does not apply to
* the direct dependencies of the root node.
- *
+ *
* @param managedDependencies The dependency management, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setManagedDependencies( List<Dependency> managedDependencies )
- {
- if ( managedDependencies == null )
- {
+ public CollectRequest setManagedDependencies(List<Dependency> managedDependencies) {
+ if (managedDependencies == null) {
this.managedDependencies = Collections.emptyList();
- }
- else
- {
+ } else {
this.managedDependencies = managedDependencies;
}
return this;
@@ -237,47 +214,39 @@ public final class CollectRequest
/**
* Adds the specified managed dependency.
- *
+ *
* @param managedDependency The managed dependency to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest addManagedDependency( Dependency managedDependency )
- {
- if ( managedDependency != null )
- {
- if ( this.managedDependencies.isEmpty() )
- {
+ public CollectRequest addManagedDependency(Dependency managedDependency) {
+ if (managedDependency != null) {
+ if (this.managedDependencies.isEmpty()) {
this.managedDependencies = new ArrayList<>();
}
- this.managedDependencies.add( managedDependency );
+ this.managedDependencies.add(managedDependency);
}
return this;
}
/**
* Gets the repositories to use for the collection.
- *
+ *
* @return The repositories to use for the collection, never {@code null}.
*/
- public List<RemoteRepository> getRepositories()
- {
+ public List<RemoteRepository> getRepositories() {
return repositories;
}
/**
* Sets the repositories to use for the collection.
- *
+ *
* @param repositories The repositories to use for the collection, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setRepositories( List<RemoteRepository> repositories )
- {
- if ( repositories == null )
- {
+ public CollectRequest setRepositories(List<RemoteRepository> repositories) {
+ if (repositories == null) {
this.repositories = Collections.emptyList();
- }
- else
- {
+ } else {
this.repositories = repositories;
}
return this;
@@ -285,71 +254,62 @@ public final class CollectRequest
/**
* Adds the specified repository for collection.
- *
+ *
* @param repository The repository to collect dependency information from, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest addRepository( RemoteRepository repository )
- {
- if ( repository != null )
- {
- if ( this.repositories.isEmpty() )
- {
+ public CollectRequest addRepository(RemoteRepository repository) {
+ if (repository != null) {
+ if (this.repositories.isEmpty()) {
this.repositories = new ArrayList<>();
}
- this.repositories.add( repository );
+ this.repositories.add(repository);
}
return this;
}
/**
* Gets the context in which this request is made.
- *
+ *
* @return The context, never {@code null}.
*/
- public String getRequestContext()
- {
+ public String getRequestContext() {
return context;
}
/**
* Sets the context in which this request is made.
- *
+ *
* @param context The context, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setRequestContext( String context )
- {
- this.context = ( context != null ) ? context : "";
+ public CollectRequest setRequestContext(String context) {
+ this.context = (context != null) ? context : "";
return this;
}
/**
* Gets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @return The trace information about the higher level operation or {@code null} if none.
*/
- public RequestTrace getTrace()
- {
+ public RequestTrace getTrace() {
return trace;
}
/**
* Sets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @param trace The trace information about the higher level operation, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public CollectRequest setTrace( RequestTrace trace )
- {
+ public CollectRequest setTrace(RequestTrace trace) {
this.trace = trace;
return this;
}
@Override
- public String toString()
- {
+ public String toString() {
return getRoot() + " -> " + getDependencies() + " < " + getRepositories();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java
index 7944ad5c..8bc234fd 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectResult.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,23 +16,24 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import static java.util.Objects.requireNonNull;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.graph.DependencyCycle;
import org.eclipse.aether.graph.DependencyNode;
+import static java.util.Objects.requireNonNull;
+
/**
* The result of a dependency collection request.
- *
+ *
* @see RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession, CollectRequest)
*/
-public final class CollectResult
-{
+public final class CollectResult {
private final CollectRequest request;
@@ -49,9 +48,8 @@ public final class CollectResult
*
* @param request The resolution request, must not be {@code null}.
*/
- public CollectResult( CollectRequest request )
- {
- this.request = requireNonNull( request, "dependency collection request cannot be null" );
+ public CollectResult(CollectRequest request) {
+ this.request = requireNonNull(request, "dependency collection request cannot be null");
exceptions = Collections.emptyList();
cycles = Collections.emptyList();
}
@@ -61,95 +59,82 @@ public final class CollectResult
*
* @return The collection request, never {@code null}.
*/
- public CollectRequest getRequest()
- {
+ public CollectRequest getRequest() {
return request;
}
/**
* Gets the exceptions that occurred while building the dependency graph.
- *
+ *
* @return The exceptions that occurred, never {@code null}.
*/
- public List<Exception> getExceptions()
- {
+ public List<Exception> getExceptions() {
return exceptions;
}
/**
* Records the specified exception while building the dependency graph.
- *
+ *
* @param exception The exception to record, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public CollectResult addException( Exception exception )
- {
- if ( exception != null )
- {
- if ( exceptions.isEmpty() )
- {
+ public CollectResult addException(Exception exception) {
+ if (exception != null) {
+ if (exceptions.isEmpty()) {
exceptions = new ArrayList<>();
}
- exceptions.add( exception );
+ exceptions.add(exception);
}
return this;
}
/**
* Gets the dependency cycles that were encountered while building the dependency graph.
- *
+ *
* @return The dependency cycles in the (raw) graph, never {@code null}.
*/
- public List<DependencyCycle> getCycles()
- {
+ public List<DependencyCycle> getCycles() {
return cycles;
}
/**
* Records the specified dependency cycle.
- *
+ *
* @param cycle The dependency cycle to record, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public CollectResult addCycle( DependencyCycle cycle )
- {
- if ( cycle != null )
- {
- if ( cycles.isEmpty() )
- {
+ public CollectResult addCycle(DependencyCycle cycle) {
+ if (cycle != null) {
+ if (cycles.isEmpty()) {
cycles = new ArrayList<>();
}
- cycles.add( cycle );
+ cycles.add(cycle);
}
return this;
}
/**
* Gets the root node of the dependency graph.
- *
+ *
* @return The root node of the dependency graph or {@code null} if none.
*/
- public DependencyNode getRoot()
- {
+ public DependencyNode getRoot() {
return root;
}
/**
* Sets the root node of the dependency graph.
- *
+ *
* @param root The root node of the dependency graph, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public CollectResult setRoot( DependencyNode root )
- {
+ public CollectResult setRoot(DependencyNode root) {
this.root = root;
return this;
}
@Override
- public String toString()
- {
- return String.valueOf( getRoot() );
+ public String toString() {
+ return String.valueOf(getRoot());
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectStepData.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectStepData.java
index 632872db..ae8d01f4 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectStepData.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/CollectStepData.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether.collection;
* "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
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.List;
@@ -32,8 +31,7 @@ import org.eclipse.aether.graph.DependencyNode;
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface CollectStepData
-{
+public interface CollectStepData {
/**
* Returns the context of collection. Never {@code null}.
*/
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java
index 671bd2ac..2c84e3dd 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionContext.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.List;
@@ -27,7 +26,7 @@ import org.eclipse.aether.graph.Dependency;
/**
* A context used during dependency collection to update the dependency manager, selector and traverser.
- *
+ *
* @see DependencyManager#deriveChildManager(DependencyCollectionContext)
* @see DependencyTraverser#deriveChildTraverser(DependencyCollectionContext)
* @see DependencySelector#deriveChildSelector(DependencyCollectionContext)
@@ -35,12 +34,11 @@ import org.eclipse.aether.graph.Dependency;
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface DependencyCollectionContext
-{
+public interface DependencyCollectionContext {
/**
* Gets the repository system session during which the dependency collection happens.
- *
+ *
* @return The repository system session, never {@code null}.
*/
RepositorySystemSession getSession();
@@ -50,7 +48,7 @@ public interface DependencyCollectionContext
* root, this is simply shorthand for {@code getDependency().getArtifact()}. In case of the root node however,
* {@link #getDependency()} might be {@code null} while the node still has an artifact which serves as its label and
* is not to be resolved.
- *
+ *
* @return The artifact whose children are going to be processed or {@code null} in case of the root node without
* dependency and label.
*/
@@ -58,7 +56,7 @@ public interface DependencyCollectionContext
/**
* Gets the dependency whose children are to be processed next during dependency collection.
- *
+ *
* @return The dependency whose children are going to be processed or {@code null} in case of the root node without
* dependency.
*/
@@ -67,9 +65,8 @@ public interface DependencyCollectionContext
/**
* Gets the dependency management information that was contributed by the artifact descriptor of the current
* dependency.
- *
+ *
* @return The dependency management information, never {@code null}.
*/
List<Dependency> getManagedDependencies();
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java
index 8a04d795..397219ee 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyCollectionException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.RepositoryException;
@@ -25,87 +24,74 @@ import org.eclipse.aether.RepositoryException;
* Thrown in case of bad artifact descriptors, version ranges or other issues encountered during calculation of the
* dependency graph.
*/
-public class DependencyCollectionException
- extends RepositoryException
-{
+public class DependencyCollectionException extends RepositoryException {
private final transient CollectResult result;
/**
* Creates a new exception with the specified result.
- *
+ *
* @param result The collection result at the point the exception occurred, may be {@code null}.
*/
- public DependencyCollectionException( CollectResult result )
- {
- super( "Failed to collect dependencies for " + getSource( result ), getCause( result ) );
+ public DependencyCollectionException(CollectResult result) {
+ super("Failed to collect dependencies for " + getSource(result), getCause(result));
this.result = result;
}
/**
* Creates a new exception with the specified result and detail message.
- *
+ *
* @param result The collection result at the point the exception occurred, may be {@code null}.
* @param message The detail message, may be {@code null}.
*/
- public DependencyCollectionException( CollectResult result, String message )
- {
- super( message, getCause( result ) );
+ public DependencyCollectionException(CollectResult result, String message) {
+ super(message, getCause(result));
this.result = result;
}
/**
* Creates a new exception with the specified result, detail message and cause.
- *
+ *
* @param result The collection result at the point the exception occurred, may be {@code null}.
* @param message The detail message, may be {@code null}.
* @param cause The exception that caused this one, may be {@code null}.
*/
- public DependencyCollectionException( CollectResult result, String message, Throwable cause )
- {
- super( message, cause );
+ public DependencyCollectionException(CollectResult result, String message, Throwable cause) {
+ super(message, cause);
this.result = result;
}
/**
* Gets the collection result at the point the exception occurred. Despite being incomplete, callers might want to
* use this result to fail gracefully and continue their operation with whatever interim data has been gathered.
- *
+ *
* @return The collection result or {@code null} if unknown.
*/
- public CollectResult getResult()
- {
+ public CollectResult getResult() {
return result;
}
- private static String getSource( CollectResult result )
- {
- if ( result == null )
- {
+ private static String getSource(CollectResult result) {
+ if (result == null) {
return "";
}
CollectRequest request = result.getRequest();
- if ( request.getRoot() != null )
- {
+ if (request.getRoot() != null) {
return request.getRoot().toString();
}
- if ( request.getRootArtifact() != null )
- {
+ if (request.getRootArtifact() != null) {
return request.getRootArtifact().toString();
}
return request.getDependencies().toString();
}
- private static Throwable getCause( CollectResult result )
- {
+ private static Throwable getCause(CollectResult result) {
Throwable cause = null;
- if ( result != null && !result.getExceptions().isEmpty() )
- {
- cause = result.getExceptions().get( 0 );
+ if (result != null && !result.getExceptions().isEmpty()) {
+ cause = result.getExceptions().get(0);
}
return cause;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java
index ba664747..3921a4fc 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformationContext.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,41 +16,40 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.RepositorySystemSession;
/**
* A context used during dependency collection to exchange information within a chain of dependency graph transformers.
- *
+ *
* @see DependencyGraphTransformer
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface DependencyGraphTransformationContext
-{
+public interface DependencyGraphTransformationContext {
/**
* Gets the repository system session during which the graph transformation happens.
- *
+ *
* @return The repository system session, never {@code null}.
*/
RepositorySystemSession getSession();
/**
* Gets a keyed value from the context.
- *
+ *
* @param key The key used to query the value, must not be {@code null}.
* @return The queried value or {@code null} if none.
*/
- Object get( Object key );
+ Object get(Object key);
/**
* Puts a keyed value into the context.
- *
+ *
* @param key The key used to store the value, must not be {@code null}.
* @param value The value to store, may be {@code null} to remove the mapping.
* @return The previous value associated with the key or {@code null} if none.
*/
- Object put( Object key, Object value );
-
+ Object put(Object key, Object value);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java
index c4725008..3dc6979c 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyGraphTransformer.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.RepositoryException;
import org.eclipse.aether.graph.DependencyNode;
@@ -30,22 +29,20 @@ import org.eclipse.aether.graph.DependencyNode;
* <em>Warning:</em> Dependency graphs may generally contain cycles. As such a graph transformer that cannot assume for
* sure that cycles have already been eliminated must gracefully handle cyclic graphs, e.g. guard against infinite
* recursion.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getDependencyGraphTransformer()
*/
-public interface DependencyGraphTransformer
-{
+public interface DependencyGraphTransformer {
/**
* Transforms the dependency graph denoted by the specified root node. The transformer may directly change the
* provided input graph or create a new graph, the former is recommended for performance reasons.
- *
+ *
* @param node The root node of the (possibly cyclic!) graph to transform, must not be {@code null}.
* @param context The graph transformation context, must not be {@code null}.
* @return The result graph of the transformation, never {@code null}.
* @throws RepositoryException If the transformation failed.
*/
- DependencyNode transformGraph( DependencyNode node, DependencyGraphTransformationContext context )
- throws RepositoryException;
-
+ DependencyNode transformGraph(DependencyNode node, DependencyGraphTransformationContext context)
+ throws RepositoryException;
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java
index 618f237c..71bfd510 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManagement.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.Collection;
import java.util.Map;
@@ -26,11 +25,10 @@ import org.eclipse.aether.graph.Exclusion;
/**
* The management updates to apply to a dependency.
- *
+ *
* @see DependencyManager#manageDependency(org.eclipse.aether.graph.Dependency)
*/
-public final class DependencyManagement
-{
+public final class DependencyManagement {
private String version;
@@ -45,76 +43,69 @@ public final class DependencyManagement
/**
* Creates an empty management update.
*/
- public DependencyManagement()
- {
+ public DependencyManagement() {
// enables default constructor
}
/**
* Gets the new version to apply to the dependency.
- *
+ *
* @return The new version or {@code null} if the version is not managed and the existing dependency version should
* remain unchanged.
*/
- public String getVersion()
- {
+ public String getVersion() {
return version;
}
/**
* Sets the new version to apply to the dependency.
- *
+ *
* @param version The new version, may be {@code null} if the version is not managed.
* @return This management update for chaining, never {@code null}.
*/
- public DependencyManagement setVersion( String version )
- {
+ public DependencyManagement setVersion(String version) {
this.version = version;
return this;
}
/**
* Gets the new scope to apply to the dependency.
- *
+ *
* @return The new scope or {@code null} if the scope is not managed and the existing dependency scope should remain
* unchanged.
*/
- public String getScope()
- {
+ public String getScope() {
return scope;
}
/**
* Sets the new scope to apply to the dependency.
- *
+ *
* @param scope The new scope, may be {@code null} if the scope is not managed.
* @return This management update for chaining, never {@code null}.
*/
- public DependencyManagement setScope( String scope )
- {
+ public DependencyManagement setScope(String scope) {
this.scope = scope;
return this;
}
/**
* Gets the new optional flag to apply to the dependency.
- *
+ *
* @return The new optional flag or {@code null} if the flag is not managed and the existing optional flag of the
* dependency should remain unchanged.
*/
- public Boolean getOptional()
- {
+ public Boolean getOptional() {
return optional;
}
/**
* Sets the new optional flag to apply to the dependency.
- *
+ *
* @param optional The optional flag, may be {@code null} if the flag is not managed.
* @return This management update for chaining, never {@code null}.
*/
- public DependencyManagement setOptional( Boolean optional )
- {
+ public DependencyManagement setOptional(Boolean optional) {
this.optional = optional;
return this;
}
@@ -123,12 +114,11 @@ public final class DependencyManagement
* Gets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of
* exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged
* with information from dependency management or overridden by it.
- *
+ *
* @return The new exclusions or {@code null} if the exclusions are not managed and the existing dependency
* exclusions should remain unchanged.
*/
- public Collection<Exclusion> getExclusions()
- {
+ public Collection<Exclusion> getExclusions() {
return exclusions;
}
@@ -136,12 +126,11 @@ public final class DependencyManagement
* Sets the new exclusions to apply to the dependency. Note that this collection denotes the complete set of
* exclusions for the dependency, i.e. the dependency manager controls whether any existing exclusions get merged
* with information from dependency management or overridden by it.
- *
+ *
* @param exclusions The new exclusions, may be {@code null} if the exclusions are not managed.
* @return This management update for chaining, never {@code null}.
*/
- public DependencyManagement setExclusions( Collection<Exclusion> exclusions )
- {
+ public DependencyManagement setExclusions(Collection<Exclusion> exclusions) {
this.exclusions = exclusions;
return this;
}
@@ -150,12 +139,11 @@ public final class DependencyManagement
* Gets the new properties to apply to the dependency. Note that this map denotes the complete set of properties,
* i.e. the dependency manager controls whether any existing properties get merged with the information from
* dependency management or overridden by it.
- *
+ *
* @return The new artifact properties or {@code null} if the properties are not managed and the existing properties
* should remain unchanged.
*/
- public Map<String, String> getProperties()
- {
+ public Map<String, String> getProperties() {
return properties;
}
@@ -163,14 +151,12 @@ public final class DependencyManagement
* Sets the new properties to apply to the dependency. Note that this map denotes the complete set of properties,
* i.e. the dependency manager controls whether any existing properties get merged with the information from
* dependency management or overridden by it.
- *
+ *
* @param properties The new artifact properties, may be {@code null} if the properties are not managed.
* @return This management update for chaining, never {@code null}.
*/
- public DependencyManagement setProperties( Map<String, String> properties )
- {
+ public DependencyManagement setProperties(Map<String, String> properties) {
this.properties = properties;
return this;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java
index 993e388b..d24f79c3 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyManager.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.graph.Dependency;
@@ -28,30 +27,28 @@ import org.eclipse.aether.graph.Dependency;
* <p>
* <em>Warning:</em> This hook is called from a hot spot and therefore implementations should pay attention to
* performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getDependencyManager()
* @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
* CollectRequest)
*/
-public interface DependencyManager
-{
+public interface DependencyManager {
/**
* Applies dependency management to the specified dependency.
- *
+ *
* @param dependency The dependency to manage, must not be {@code null}.
* @return The management update to apply to the dependency or {@code null} if the dependency is not managed at all.
*/
- DependencyManagement manageDependency( Dependency dependency );
+ DependencyManagement manageDependency(Dependency dependency);
/**
* Derives a dependency manager for the specified collection context. When calculating the child manager,
* implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
- *
+ *
* @param context The dependency collection context, must not be {@code null}.
* @return The dependency manager for the dependencies of the target node or {@code null} if dependency management
* should no longer be applied.
*/
- DependencyManager deriveChildManager( DependencyCollectionContext context );
-
+ DependencyManager deriveChildManager(DependencyCollectionContext context);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java
index b257ffa4..087a06a3 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencySelector.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.graph.Dependency;
@@ -28,31 +27,29 @@ import org.eclipse.aether.graph.Dependency;
* <p>
* <em>Warning:</em> This hook is called from a hot spot and therefore implementations should pay attention to
* performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getDependencySelector()
* @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
* CollectRequest)
*/
-public interface DependencySelector
-{
+public interface DependencySelector {
/**
* Decides whether the specified dependency should be included in the dependency graph.
- *
+ *
* @param dependency The dependency to check, must not be {@code null}.
* @return {@code false} if the dependency should be excluded from the children of the current node, {@code true}
* otherwise.
*/
- boolean selectDependency( Dependency dependency );
+ boolean selectDependency(Dependency dependency);
/**
* Derives a dependency selector for the specified collection context. When calculating the child selector,
* implementors are strongly advised to simply return the current instance if nothing changed to help save memory.
- *
+ *
* @param context The dependency collection context, must not be {@code null}.
* @return The dependency selector for the target node or {@code null} if dependencies should be unconditionally
* included in the sub graph.
*/
- DependencySelector deriveChildSelector( DependencyCollectionContext context );
-
+ DependencySelector deriveChildSelector(DependencyCollectionContext context);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java
index be1887bf..b70ec635 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/DependencyTraverser.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import org.eclipse.aether.graph.Dependency;
@@ -28,32 +27,30 @@ import org.eclipse.aether.graph.Dependency;
* <p>
* <em>Warning:</em> This hook is called from a hot spot and therefore implementations should pay attention to
* performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getDependencyTraverser()
* @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
* CollectRequest)
*/
-public interface DependencyTraverser
-{
+public interface DependencyTraverser {
/**
* Decides whether the dependencies of the specified dependency should be traversed.
- *
+ *
* @param dependency The dependency to check, must not be {@code null}.
* @return {@code true} if the dependency graph builder should recurse into the specified dependency and process its
* dependencies, {@code false} otherwise.
*/
- boolean traverseDependency( Dependency dependency );
+ boolean traverseDependency(Dependency dependency);
/**
* Derives a dependency traverser that will be used to decide whether the transitive dependencies of the dependency
* given in the collection context shall be traversed. When calculating the child traverser, implementors are
* strongly advised to simply return the current instance if nothing changed to help save memory.
- *
+ *
* @param context The dependency collection context, must not be {@code null}.
* @return The dependency traverser for the target node or {@code null} if dependencies should be unconditionally
* traversed in the sub graph.
*/
- DependencyTraverser deriveChildTraverser( DependencyCollectionContext context );
-
+ DependencyTraverser deriveChildTraverser(DependencyCollectionContext context);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java
index 81353ac2..d2832e08 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/UnsolvableVersionConflictException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.Collection;
import java.util.Collections;
@@ -33,9 +32,7 @@ import org.eclipse.aether.version.VersionConstraint;
/**
* Thrown in case of an unsolvable conflict between different version constraints for a dependency.
*/
-public class UnsolvableVersionConflictException
- extends RepositoryException
-{
+public class UnsolvableVersionConflictException extends RepositoryException {
private final transient Collection<String> versions;
@@ -43,43 +40,34 @@ public class UnsolvableVersionConflictException
/**
* Creates a new exception with the specified paths to conflicting nodes in the dependency graph.
- *
+ *
* @param paths The paths to the dependency nodes that participate in the version conflict, may be {@code null}.
*/
- public UnsolvableVersionConflictException( Collection<? extends List<? extends DependencyNode>> paths )
- {
- super( "Could not resolve version conflict among " + toPaths( paths ) );
- if ( paths == null )
- {
+ public UnsolvableVersionConflictException(Collection<? extends List<? extends DependencyNode>> paths) {
+ super("Could not resolve version conflict among " + toPaths(paths));
+ if (paths == null) {
this.paths = Collections.emptyList();
this.versions = Collections.emptyList();
- }
- else
- {
+ } else {
this.paths = paths;
this.versions = new LinkedHashSet<>();
- for ( List<? extends DependencyNode> path : paths )
- {
- VersionConstraint constraint = path.get( path.size() - 1 ).getVersionConstraint();
- if ( constraint != null && constraint.getRange() != null )
- {
- versions.add( constraint.toString() );
+ for (List<? extends DependencyNode> path : paths) {
+ VersionConstraint constraint = path.get(path.size() - 1).getVersionConstraint();
+ if (constraint != null && constraint.getRange() != null) {
+ versions.add(constraint.toString());
}
}
}
}
- private static String toPaths( Collection<? extends List<? extends DependencyNode>> paths )
- {
+ private static String toPaths(Collection<? extends List<? extends DependencyNode>> paths) {
String result = "";
- if ( paths != null )
- {
+ if (paths != null) {
Collection<String> strings = new LinkedHashSet<>();
- for ( List<? extends DependencyNode> path : paths )
- {
- strings.add( toPath( path ) );
+ for (List<? extends DependencyNode> path : paths) {
+ strings.add(toPath(path));
}
result = strings.toString();
@@ -88,31 +76,26 @@ public class UnsolvableVersionConflictException
return result;
}
- private static String toPath( List<? extends DependencyNode> path )
- {
- StringBuilder buffer = new StringBuilder( 256 );
+ private static String toPath(List<? extends DependencyNode> path) {
+ StringBuilder buffer = new StringBuilder(256);
- for ( Iterator<? extends DependencyNode> it = path.iterator(); it.hasNext(); )
- {
+ for (Iterator<? extends DependencyNode> it = path.iterator(); it.hasNext(); ) {
DependencyNode node = it.next();
- if ( node.getDependency() == null )
- {
+ if (node.getDependency() == null) {
continue;
}
Artifact artifact = node.getDependency().getArtifact();
- buffer.append( artifact.getGroupId() );
- buffer.append( ':' ).append( artifact.getArtifactId() );
- buffer.append( ':' ).append( artifact.getExtension() );
- if ( artifact.getClassifier().length() > 0 )
- {
- buffer.append( ':' ).append( artifact.getClassifier() );
+ buffer.append(artifact.getGroupId());
+ buffer.append(':').append(artifact.getArtifactId());
+ buffer.append(':').append(artifact.getExtension());
+ if (artifact.getClassifier().length() > 0) {
+ buffer.append(':').append(artifact.getClassifier());
}
- buffer.append( ':' ).append( node.getVersionConstraint() );
+ buffer.append(':').append(node.getVersionConstraint());
- if ( it.hasNext() )
- {
- buffer.append( " -> " );
+ if (it.hasNext()) {
+ buffer.append(" -> ");
}
}
@@ -121,22 +104,19 @@ public class UnsolvableVersionConflictException
/**
* Gets the paths leading to the conflicting dependencies.
- *
+ *
* @return The (read-only) paths leading to the conflicting dependencies, never {@code null}.
*/
- public Collection<? extends List<? extends DependencyNode>> getPaths()
- {
+ public Collection<? extends List<? extends DependencyNode>> getPaths() {
return paths;
}
/**
* Gets the conflicting version constraints of the dependency.
- *
+ *
* @return The (read-only) conflicting version constraints, never {@code null}.
*/
- public Collection<String> getVersions()
- {
+ public Collection<String> getVersions() {
return versions;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java
index fb36747f..d9522d44 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/VersionFilter.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.collection;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.collection;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.collection;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.collection;
import java.util.Iterator;
import java.util.List;
@@ -38,41 +37,38 @@ import org.eclipse.aether.version.VersionConstraint;
* <p>
* <em>Warning:</em> This hook is called from a hot spot and therefore implementations should pay attention to
* performance. Among others, implementations should provide a semantic {@link Object#equals(Object) equals()} method.
- *
+ *
* @see org.eclipse.aether.RepositorySystemSession#getVersionFilter()
* @see org.eclipse.aether.RepositorySystem#collectDependencies(org.eclipse.aether.RepositorySystemSession,
* CollectRequest)
*/
-public interface VersionFilter
-{
+public interface VersionFilter {
/**
* A context used during version filtering to hold relevant data.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
- interface VersionFilterContext
- extends Iterable<Version>
- {
+ interface VersionFilterContext extends Iterable<Version> {
/**
* Gets the repository system session during which the version filtering happens.
- *
+ *
* @return The repository system session, never {@code null}.
*/
RepositorySystemSession getSession();
/**
* Gets the dependency whose version range is being filtered.
- *
+ *
* @return The dependency, never {@code null}.
*/
Dependency getDependency();
/**
* Gets the total number of available versions. This count reflects any removals made during version filtering.
- *
+ *
* @return The total number of available versions.
*/
int getCount();
@@ -80,33 +76,32 @@ public interface VersionFilter
/**
* Gets an iterator over the available versions of the dependency. The iterator returns versions in ascending
* order. Use {@link Iterator#remove()} to exclude a version from further consideration in the dependency graph.
- *
+ *
* @return The iterator of available versions, never {@code null}.
*/
Iterator<Version> iterator();
/**
* Gets the version constraint that was parsed from the dependency's version string.
- *
+ *
* @return The parsed version constraint, never {@code null}.
*/
VersionConstraint getVersionConstraint();
/**
* Gets the repository from which the specified version was resolved.
- *
+ *
* @param version The version whose source repository should be retrieved, must not be {@code null}.
* @return The repository from which the version was resolved or {@code null} if unknown.
*/
- ArtifactRepository getRepository( Version version );
+ ArtifactRepository getRepository(Version version);
/**
* Gets the remote repositories from which the versions were resolved.
- *
+ *
* @return The (read-only) list of repositories, never {@code null}.
*/
List<RemoteRepository> getRepositories();
-
}
/**
@@ -115,21 +110,19 @@ public interface VersionFilter
* {@link java.util.Iterator#remove()} to delete unacceptable versions. If no versions remain after all filtering
* has been performed, the dependency collection process will automatically fail, i.e. implementations need not
* handle this situation on their own.
- *
+ *
* @param context The version filter context, must not be {@code null}.
* @throws RepositoryException If the filtering could not be performed.
*/
- void filterVersions( VersionFilterContext context )
- throws RepositoryException;
+ void filterVersions(VersionFilterContext context) throws RepositoryException;
/**
* Derives a version filter for the specified collection context. The derived filter will be used to handle version
* ranges encountered in child dependencies of the current node. When calculating the child filter, implementors are
* strongly advised to simply return the current instance if nothing changed to help save memory.
- *
+ *
* @param context The dependency collection context, must not be {@code null}.
* @return The version filter for the target node or {@code null} if versions should not be filtered any more.
*/
- VersionFilter deriveChildFilter( DependencyCollectionContext context );
-
+ VersionFilter deriveChildFilter(DependencyCollectionContext context);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java
index 414629f6..4b7e55e2 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/collection/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -22,4 +22,3 @@
* graph.
*/
package org.eclipse.aether.collection;
-
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java
index 44bc721a..c5b45c85 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployRequest.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.deployment;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.deployment;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.deployment;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.deployment;
import java.util.ArrayList;
import java.util.Collection;
@@ -30,11 +29,10 @@ import org.eclipse.aether.repository.RemoteRepository;
/**
* A request to deploy artifacts and their accompanying metadata into the a remote repository.
- *
+ *
* @see org.eclipse.aether.RepositorySystem#deploy(org.eclipse.aether.RepositorySystemSession, DeployRequest)
*/
-public final class DeployRequest
-{
+public final class DeployRequest {
private Collection<Artifact> artifacts = Collections.emptyList();
@@ -47,34 +45,27 @@ public final class DeployRequest
/**
* Creates an uninitialized request.
*/
- public DeployRequest()
- {
- }
+ public DeployRequest() {}
/**
* Gets the artifact to deploy.
- *
+ *
* @return The artifacts to deploy, never {@code null}.
*/
- public Collection<Artifact> getArtifacts()
- {
+ public Collection<Artifact> getArtifacts() {
return artifacts;
}
/**
* Sets the artifacts to deploy.
- *
+ *
* @param artifacts The artifacts to deploy, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest setArtifacts( Collection<Artifact> artifacts )
- {
- if ( artifacts == null )
- {
+ public DeployRequest setArtifacts(Collection<Artifact> artifacts) {
+ if (artifacts == null) {
this.artifacts = Collections.emptyList();
- }
- else
- {
+ } else {
this.artifacts = artifacts;
}
return this;
@@ -82,47 +73,39 @@ public final class DeployRequest
/**
* Adds the specified artifacts for deployment.
- *
+ *
* @param artifact The artifact to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest addArtifact( Artifact artifact )
- {
- if ( artifact != null )
- {
- if ( artifacts.isEmpty() )
- {
+ public DeployRequest addArtifact(Artifact artifact) {
+ if (artifact != null) {
+ if (artifacts.isEmpty()) {
artifacts = new ArrayList<>();
}
- artifacts.add( artifact );
+ artifacts.add(artifact);
}
return this;
}
/**
* Gets the metadata to deploy.
- *
+ *
* @return The metadata to deploy, never {@code null}.
*/
- public Collection<Metadata> getMetadata()
- {
+ public Collection<Metadata> getMetadata() {
return metadata;
}
/**
* Sets the metadata to deploy.
- *
+ *
* @param metadata The metadata to deploy, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest setMetadata( Collection<Metadata> metadata )
- {
- if ( metadata == null )
- {
+ public DeployRequest setMetadata(Collection<Metadata> metadata) {
+ if (metadata == null) {
this.metadata = Collections.emptyList();
- }
- else
- {
+ } else {
this.metadata = metadata;
}
return this;
@@ -130,71 +113,62 @@ public final class DeployRequest
/**
* Adds the specified metadata for deployment.
- *
+ *
* @param metadata The metadata to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest addMetadata( Metadata metadata )
- {
- if ( metadata != null )
- {
- if ( this.metadata.isEmpty() )
- {
+ public DeployRequest addMetadata(Metadata metadata) {
+ if (metadata != null) {
+ if (this.metadata.isEmpty()) {
this.metadata = new ArrayList<>();
}
- this.metadata.add( metadata );
+ this.metadata.add(metadata);
}
return this;
}
/**
* Gets the repository to deploy to.
- *
+ *
* @return The repository to deploy to or {@code null} if not set.
*/
- public RemoteRepository getRepository()
- {
+ public RemoteRepository getRepository() {
return repository;
}
/**
* Sets the repository to deploy to.
- *
+ *
* @param repository The repository to deploy to, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest setRepository( RemoteRepository repository )
- {
+ public DeployRequest setRepository(RemoteRepository repository) {
this.repository = repository;
return this;
}
/**
* Gets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @return The trace information about the higher level operation or {@code null} if none.
*/
- public RequestTrace getTrace()
- {
+ public RequestTrace getTrace() {
return trace;
}
/**
* Sets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @param trace The trace information about the higher level operation, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public DeployRequest setTrace( RequestTrace trace )
- {
+ public DeployRequest setTrace(RequestTrace trace) {
this.trace = trace;
return this;
}
@Override
- public String toString()
- {
+ public String toString() {
return getArtifacts() + ", " + getMetadata() + " > " + getRepository();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java
index df37cb62..ed16035b 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeployResult.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.deployment;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.deployment;
* 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
- *
+ *
+ * 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
@@ -18,23 +16,24 @@ package org.eclipse.aether.deployment;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.deployment;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import static java.util.Objects.requireNonNull;
import org.eclipse.aether.RepositorySystem;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.metadata.Metadata;
+import static java.util.Objects.requireNonNull;
+
/**
* The result of deploying artifacts and their accompanying metadata into the a remote repository.
- *
+ *
* @see RepositorySystem#deploy(org.eclipse.aether.RepositorySystemSession, DeployRequest)
*/
-public final class DeployResult
-{
+public final class DeployResult {
private final DeployRequest request;
@@ -47,9 +46,8 @@ public final class DeployResult
*
* @param request The deployment request, must not be {@code null}.
*/
- public DeployResult( DeployRequest request )
- {
- this.request = requireNonNull( request, "deploy request cannot be null" );
+ public DeployResult(DeployRequest request) {
+ this.request = requireNonNull(request, "deploy request cannot be null");
artifacts = Collections.emptyList();
metadata = Collections.emptyList();
}
@@ -59,35 +57,29 @@ public final class DeployResult
*
* @return The deploy request, never {@code null}.
*/
- public DeployRequest getRequest()
- {
+ public DeployRequest getRequest() {
return request;
}
/**
* Gets the artifacts that got deployed.
- *
+ *
* @return The deployed artifacts, never {@code null}.
*/
- public Collection<Artifact> getArtifacts()
- {
+ public Collection<Artifact> getArtifacts() {
return artifacts;
}
/**
* Sets the artifacts that got deployed.
- *
+ *
* @param artifacts The deployed artifacts, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public DeployResult setArtifacts( Collection<Artifact> artifacts )
- {
- if ( artifacts == null )
- {
+ public DeployResult setArtifacts(Collection<Artifact> artifacts) {
+ if (artifacts == null) {
this.artifacts = Collections.emptyList();
- }
- else
- {
+ } else {
this.artifacts = artifacts;
}
return this;
@@ -95,19 +87,16 @@ public final class DeployResult
/**
* Adds the specified artifacts to the result.
- *
+ *
* @param artifact The deployed artifact to add, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public DeployResult addArtifact( Artifact artifact )
- {
- if ( artifact != null )
- {
- if ( artifacts.isEmpty() )
- {
+ public DeployResult addArtifact(Artifact artifact) {
+ if (artifact != null) {
+ if (artifacts.isEmpty()) {
artifacts = new ArrayList<>();
}
- artifacts.add( artifact );
+ artifacts.add(artifact);
}
return this;
}
@@ -115,28 +104,23 @@ public final class DeployResult
/**
* Gets the metadata that got deployed. Note that due to automatically generated metadata, there might have been
* more metadata deployed than originally specified in the deploy request.
- *
+ *
* @return The deployed metadata, never {@code null}.
*/
- public Collection<Metadata> getMetadata()
- {
+ public Collection<Metadata> getMetadata() {
return metadata;
}
/**
* Sets the metadata that got deployed.
- *
+ *
* @param metadata The deployed metadata, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public DeployResult setMetadata( Collection<Metadata> metadata )
- {
- if ( metadata == null )
- {
+ public DeployResult setMetadata(Collection<Metadata> metadata) {
+ if (metadata == null) {
this.metadata = Collections.emptyList();
- }
- else
- {
+ } else {
this.metadata = metadata;
}
return this;
@@ -144,27 +128,22 @@ public final class DeployResult
/**
* Adds the specified metadata to this result.
- *
+ *
* @param metadata The deployed metadata to add, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public DeployResult addMetadata( Metadata metadata )
- {
- if ( metadata != null )
- {
- if ( this.metadata.isEmpty() )
- {
+ public DeployResult addMetadata(Metadata metadata) {
+ if (metadata != null) {
+ if (this.metadata.isEmpty()) {
this.metadata = new ArrayList<>();
}
- this.metadata.add( metadata );
+ this.metadata.add(metadata);
}
return this;
}
@Override
- public String toString()
- {
+ public String toString() {
return getArtifacts() + ", " + getMetadata();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java
index 53252baf..efdbe8cc 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/DeploymentException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.deployment;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.deployment;
* 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
- *
+ *
+ * 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
@@ -18,35 +16,31 @@ package org.eclipse.aether.deployment;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.deployment;
import org.eclipse.aether.RepositoryException;
/**
* Thrown in case of a deployment error like authentication failure.
*/
-public class DeploymentException
- extends RepositoryException
-{
+public class DeploymentException extends RepositoryException {
/**
* Creates a new exception with the specified detail message.
- *
+ *
* @param message The detail message, may be {@code null}.
*/
- public DeploymentException( String message )
- {
- super( message );
+ public DeploymentException(String message) {
+ super(message);
}
/**
* Creates a new exception with the specified detail message and cause.
- *
+ *
* @param message The detail message, may be {@code null}.
* @param cause The exception that caused this one, may be {@code null}.
*/
- public DeploymentException( String message, Throwable cause )
- {
- super( message, cause );
+ public DeploymentException(String message, Throwable cause) {
+ super(message, cause);
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java
index dc50c215..fc919294 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/deployment/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -21,4 +21,3 @@
* The types supporting the publishing of artifacts to a remote repository.
*/
package org.eclipse.aether.deployment;
-
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java
index a2c1c8b0..b746f758 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DefaultDependencyNode.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
import java.util.ArrayList;
import java.util.Collection;
@@ -25,19 +24,18 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import static java.util.Objects.requireNonNull;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.repository.RemoteRepository;
import org.eclipse.aether.version.Version;
import org.eclipse.aether.version.VersionConstraint;
+import static java.util.Objects.requireNonNull;
+
/**
* A node within a dependency graph.
*/
-public final class DefaultDependencyNode
- implements DependencyNode
-{
+public final class DefaultDependencyNode implements DependencyNode {
private List<DependencyNode> children;
@@ -63,14 +61,13 @@ public final class DefaultDependencyNode
/**
* Creates a new node with the specified dependency.
- *
+ *
* @param dependency The dependency associated with this node, may be {@code null} for a root node.
*/
- public DefaultDependencyNode( Dependency dependency )
- {
+ public DefaultDependencyNode(Dependency dependency) {
this.dependency = dependency;
- artifact = ( dependency != null ) ? dependency.getArtifact() : null;
- children = new ArrayList<>( 0 );
+ artifact = (dependency != null) ? dependency.getArtifact() : null;
+ children = new ArrayList<>(0);
aliases = Collections.emptyList();
relocations = Collections.emptyList();
repositories = Collections.emptyList();
@@ -82,13 +79,12 @@ public final class DefaultDependencyNode
* Creates a new root node with the specified artifact as its label. Note that the new node has no dependency, i.e.
* {@link #getDependency()} will return {@code null}. Put differently, the specified artifact will not be subject to
* dependency collection/resolution.
- *
+ *
* @param artifact The artifact to use as label for this node, may be {@code null}.
*/
- public DefaultDependencyNode( Artifact artifact )
- {
+ public DefaultDependencyNode(Artifact artifact) {
this.artifact = artifact;
- children = new ArrayList<>( 0 );
+ children = new ArrayList<>(0);
aliases = Collections.emptyList();
relocations = Collections.emptyList();
repositories = Collections.emptyList();
@@ -99,270 +95,214 @@ public final class DefaultDependencyNode
/**
* Creates a mostly shallow clone of the specified node. The new node has its own copy of any custom data and
* initially no children.
- *
+ *
* @param node The node to copy, must not be {@code null}.
*/
- public DefaultDependencyNode( DependencyNode node )
- {
+ public DefaultDependencyNode(DependencyNode node) {
dependency = node.getDependency();
artifact = node.getArtifact();
- children = new ArrayList<>( 0 );
- setAliases( node.getAliases() );
- setRequestContext( node.getRequestContext() );
- setManagedBits( node.getManagedBits() );
- setRelocations( node.getRelocations() );
- setRepositories( node.getRepositories() );
- setVersion( node.getVersion() );
- setVersionConstraint( node.getVersionConstraint() );
+ children = new ArrayList<>(0);
+ setAliases(node.getAliases());
+ setRequestContext(node.getRequestContext());
+ setManagedBits(node.getManagedBits());
+ setRelocations(node.getRelocations());
+ setRepositories(node.getRepositories());
+ setVersion(node.getVersion());
+ setVersionConstraint(node.getVersionConstraint());
Map<?, ?> data = node.getData();
- setData( data.isEmpty() ? null : new HashMap<>( data ) );
+ setData(data.isEmpty() ? null : new HashMap<>(data));
}
- public List<DependencyNode> getChildren()
- {
+ public List<DependencyNode> getChildren() {
return children;
}
- public void setChildren( List<DependencyNode> children )
- {
- if ( children == null )
- {
- this.children = new ArrayList<>( 0 );
- }
- else
- {
+ public void setChildren(List<DependencyNode> children) {
+ if (children == null) {
+ this.children = new ArrayList<>(0);
+ } else {
this.children = children;
}
}
- public Dependency getDependency()
- {
+ public Dependency getDependency() {
return dependency;
}
- public Artifact getArtifact()
- {
+ public Artifact getArtifact() {
return artifact;
}
- public void setArtifact( Artifact artifact )
- {
- if ( dependency == null )
- {
- throw new IllegalStateException( "node does not have a dependency" );
+ public void setArtifact(Artifact artifact) {
+ if (dependency == null) {
+ throw new IllegalStateException("node does not have a dependency");
}
- dependency = dependency.setArtifact( artifact );
+ dependency = dependency.setArtifact(artifact);
this.artifact = dependency.getArtifact();
}
- public List<? extends Artifact> getRelocations()
- {
+ public List<? extends Artifact> getRelocations() {
return relocations;
}
/**
* Sets the sequence of relocations that was followed to resolve this dependency's artifact.
- *
+ *
* @param relocations The sequence of relocations, may be {@code null}.
*/
- public void setRelocations( List<? extends Artifact> relocations )
- {
- if ( relocations == null || relocations.isEmpty() )
- {
+ public void setRelocations(List<? extends Artifact> relocations) {
+ if (relocations == null || relocations.isEmpty()) {
this.relocations = Collections.emptyList();
- }
- else
- {
+ } else {
this.relocations = relocations;
}
}
- public Collection<? extends Artifact> getAliases()
- {
+ public Collection<? extends Artifact> getAliases() {
return aliases;
}
/**
* Sets the known aliases for this dependency's artifact.
- *
+ *
* @param aliases The known aliases, may be {@code null}.
*/
- public void setAliases( Collection<? extends Artifact> aliases )
- {
- if ( aliases == null || aliases.isEmpty() )
- {
+ public void setAliases(Collection<? extends Artifact> aliases) {
+ if (aliases == null || aliases.isEmpty()) {
this.aliases = Collections.emptyList();
- }
- else
- {
+ } else {
this.aliases = aliases;
}
}
- public VersionConstraint getVersionConstraint()
- {
+ public VersionConstraint getVersionConstraint() {
return versionConstraint;
}
/**
* Sets the version constraint that was parsed from the dependency's version declaration.
- *
+ *
* @param versionConstraint The version constraint for this node, may be {@code null}.
*/
- public void setVersionConstraint( VersionConstraint versionConstraint )
- {
+ public void setVersionConstraint(VersionConstraint versionConstraint) {
this.versionConstraint = versionConstraint;
}
- public Version getVersion()
- {
+ public Version getVersion() {
return version;
}
/**
* Sets the version that was selected for the dependency's target artifact.
- *
+ *
* @param version The parsed version, may be {@code null}.
*/
- public void setVersion( Version version )
- {
+ public void setVersion(Version version) {
this.version = version;
}
- public void setScope( String scope )
- {
- if ( dependency == null )
- {
- throw new IllegalStateException( "node does not have a dependency" );
+ public void setScope(String scope) {
+ if (dependency == null) {
+ throw new IllegalStateException("node does not have a dependency");
}
- dependency = dependency.setScope( scope );
+ dependency = dependency.setScope(scope);
}
- public void setOptional( Boolean optional )
- {
- if ( dependency == null )
- {
- throw new IllegalStateException( "node does not have a dependency" );
+ public void setOptional(Boolean optional) {
+ if (dependency == null) {
+ throw new IllegalStateException("node does not have a dependency");
}
- dependency = dependency.setOptional( optional );
+ dependency = dependency.setOptional(optional);
}
- public int getManagedBits()
- {
+ public int getManagedBits() {
return managedBits;
}
/**
* Sets a bit field indicating which attributes of this node were subject to dependency management.
- *
+ *
* @param managedBits The bit field indicating the managed attributes or {@code 0} if dependency management wasn't
* applied.
*/
- public void setManagedBits( int managedBits )
- {
- this.managedBits = (byte) ( managedBits & 0x1F );
+ public void setManagedBits(int managedBits) {
+ this.managedBits = (byte) (managedBits & 0x1F);
}
- public List<RemoteRepository> getRepositories()
- {
+ public List<RemoteRepository> getRepositories() {
return repositories;
}
/**
* Sets the remote repositories from which this node's artifact shall be resolved.
- *
+ *
* @param repositories The remote repositories to use for artifact resolution, may be {@code null}.
*/
- public void setRepositories( List<RemoteRepository> repositories )
- {
- if ( repositories == null || repositories.isEmpty() )
- {
+ public void setRepositories(List<RemoteRepository> repositories) {
+ if (repositories == null || repositories.isEmpty()) {
this.repositories = Collections.emptyList();
- }
- else
- {
+ } else {
this.repositories = repositories;
}
}
- public String getRequestContext()
- {
+ public String getRequestContext() {
return context;
}
- public void setRequestContext( String context )
- {
- this.context = ( context != null ) ? context : "";
+ public void setRequestContext(String context) {
+ this.context = (context != null) ? context : "";
}
- public Map<Object, Object> getData()
- {
+ public Map<Object, Object> getData() {
return data;
}
- public void setData( Map<Object, Object> data )
- {
- if ( data == null )
- {
+ public void setData(Map<Object, Object> data) {
+ if (data == null) {
this.data = Collections.emptyMap();
- }
- else
- {
+ } else {
this.data = data;
}
}
- public void setData( Object key, Object value )
- {
- requireNonNull( key, "key cannot be null" );
+ public void setData(Object key, Object value) {
+ requireNonNull(key, "key cannot be null");
- if ( value == null )
- {
- if ( !data.isEmpty() )
- {
- data.remove( key );
+ if (value == null) {
+ if (!data.isEmpty()) {
+ data.remove(key);
- if ( data.isEmpty() )
- {
+ if (data.isEmpty()) {
data = Collections.emptyMap();
}
}
- }
- else
- {
- if ( data.isEmpty() )
- {
- data = new HashMap<>( 1, 2 ); // nodes can be numerous so let's be space conservative
+ } else {
+ if (data.isEmpty()) {
+ data = new HashMap<>(1, 2); // nodes can be numerous so let's be space conservative
}
- data.put( key, value );
+ data.put(key, value);
}
}
- public boolean accept( DependencyVisitor visitor )
- {
- if ( visitor.visitEnter( this ) )
- {
- for ( DependencyNode child : children )
- {
- if ( !child.accept( visitor ) )
- {
+ public boolean accept(DependencyVisitor visitor) {
+ if (visitor.visitEnter(this)) {
+ for (DependencyNode child : children) {
+ if (!child.accept(visitor)) {
break;
}
}
}
- return visitor.visitLeave( this );
+ return visitor.visitLeave(this);
}
@Override
- public String toString()
- {
+ public String toString() {
Dependency dep = getDependency();
- if ( dep == null )
- {
- return String.valueOf( getArtifact() );
+ if (dep == null) {
+ return String.valueOf(getArtifact());
}
return dep.toString();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java
index db0efcb3..0dea94e4 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Dependency.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
import java.util.AbstractSet;
import java.util.Collection;
@@ -25,19 +24,18 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.NoSuchElementException;
-import static java.util.Objects.requireNonNull;
-
import java.util.Objects;
import java.util.Set;
import org.eclipse.aether.artifact.Artifact;
+import static java.util.Objects.requireNonNull;
+
/**
* A dependency to some artifact. <em>Note:</em> Instances of this class are immutable and the exposed mutators return
* new objects rather than changing the current instance.
*/
-public final class Dependency
-{
+public final class Dependency {
private final Artifact artifact;
@@ -49,276 +47,235 @@ public final class Dependency
/**
* Creates a mandatory dependency on the specified artifact with the given scope.
- *
+ *
* @param artifact The artifact being depended on, must not be {@code null}.
* @param scope The scope of the dependency, may be {@code null}.
*/
- public Dependency( Artifact artifact, String scope )
- {
- this( artifact, scope, false );
+ public Dependency(Artifact artifact, String scope) {
+ this(artifact, scope, false);
}
/**
* Creates a dependency on the specified artifact with the given scope.
- *
+ *
* @param artifact The artifact being depended on, must not be {@code null}.
* @param scope The scope of the dependency, may be {@code null}.
* @param optional A flag whether the dependency is optional or mandatory, may be {@code null}.
*/
- public Dependency( Artifact artifact, String scope, Boolean optional )
- {
- this( artifact, scope, optional, null );
+ public Dependency(Artifact artifact, String scope, Boolean optional) {
+ this(artifact, scope, optional, null);
}
/**
* Creates a dependency on the specified artifact with the given scope and exclusions.
- *
+ *
* @param artifact The artifact being depended on, must not be {@code null}.
* @param scope The scope of the dependency, may be {@code null}.
* @param optional A flag whether the dependency is optional or mandatory, may be {@code null}.
* @param exclusions The exclusions that apply to transitive dependencies, may be {@code null} if none.
*/
- public Dependency( Artifact artifact, String scope, Boolean optional, Collection<Exclusion> exclusions )
- {
- this( artifact, scope, Exclusions.copy( exclusions ), optional );
+ public Dependency(Artifact artifact, String scope, Boolean optional, Collection<Exclusion> exclusions) {
+ this(artifact, scope, Exclusions.copy(exclusions), optional);
}
- private Dependency( Artifact artifact, String scope, Set<Exclusion> exclusions, Boolean optional )
- {
+ private Dependency(Artifact artifact, String scope, Set<Exclusion> exclusions, Boolean optional) {
// NOTE: This constructor assumes immutability of the provided exclusion collection, for internal use only
- this.artifact = requireNonNull( artifact, "artifact cannot be null" );
- this.scope = ( scope != null ) ? scope : "";
+ this.artifact = requireNonNull(artifact, "artifact cannot be null");
+ this.scope = (scope != null) ? scope : "";
this.optional = optional;
this.exclusions = exclusions;
}
/**
* Gets the artifact being depended on.
- *
+ *
* @return The artifact, never {@code null}.
*/
- public Artifact getArtifact()
- {
+ public Artifact getArtifact() {
return artifact;
}
/**
* Sets the artifact being depended on.
- *
+ *
* @param artifact The artifact, must not be {@code null}.
* @return The new dependency, never {@code null}.
*/
- public Dependency setArtifact( Artifact artifact )
- {
- if ( this.artifact.equals( artifact ) )
- {
+ public Dependency setArtifact(Artifact artifact) {
+ if (this.artifact.equals(artifact)) {
return this;
}
- return new Dependency( artifact, scope, exclusions, optional );
+ return new Dependency(artifact, scope, exclusions, optional);
}
/**
* Gets the scope of the dependency. The scope defines in which context this dependency is relevant.
- *
+ *
* @return The scope or an empty string if not set, never {@code null}.
*/
- public String getScope()
- {
+ public String getScope() {
return scope;
}
/**
* Sets the scope of the dependency, e.g. "compile".
- *
+ *
* @param scope The scope of the dependency, may be {@code null}.
* @return The new dependency, never {@code null}.
*/
- public Dependency setScope( String scope )
- {
- if ( this.scope.equals( scope ) || ( scope == null && this.scope.isEmpty() ) )
- {
+ public Dependency setScope(String scope) {
+ if (this.scope.equals(scope) || (scope == null && this.scope.isEmpty())) {
return this;
}
- return new Dependency( artifact, scope, exclusions, optional );
+ return new Dependency(artifact, scope, exclusions, optional);
}
/**
* Indicates whether this dependency is optional or not. Optional dependencies can be ignored in some contexts.
- *
+ *
* @return {@code true} if the dependency is (definitively) optional, {@code false} otherwise.
*/
- public boolean isOptional()
- {
- return Boolean.TRUE.equals( optional );
+ public boolean isOptional() {
+ return Boolean.TRUE.equals(optional);
}
/**
* Gets the optional flag for the dependency. Note: Most clients will usually call {@link #isOptional()} to
* determine the optional flag, this method is for advanced use cases where three-valued logic is required.
- *
+ *
* @return The optional flag or {@code null} if unspecified.
*/
- public Boolean getOptional()
- {
+ public Boolean getOptional() {
return optional;
}
/**
* Sets the optional flag for the dependency.
- *
+ *
* @param optional {@code true} if the dependency is optional, {@code false} if the dependency is mandatory, may be
* {@code null} if unspecified.
* @return The new dependency, never {@code null}.
*/
- public Dependency setOptional( Boolean optional )
- {
- if ( Objects.equals( this.optional, optional ) )
- {
+ public Dependency setOptional(Boolean optional) {
+ if (Objects.equals(this.optional, optional)) {
return this;
}
- return new Dependency( artifact, scope, exclusions, optional );
+ return new Dependency(artifact, scope, exclusions, optional);
}
/**
* Gets the exclusions for this dependency. Exclusions can be used to remove transitive dependencies during
* resolution.
- *
+ *
* @return The (read-only) exclusions, never {@code null}.
*/
- public Collection<Exclusion> getExclusions()
- {
+ public Collection<Exclusion> getExclusions() {
return exclusions;
}
/**
* Sets the exclusions for the dependency.
- *
+ *
* @param exclusions The exclusions, may be {@code null}.
* @return The new dependency, never {@code null}.
*/
- public Dependency setExclusions( Collection<Exclusion> exclusions )
- {
- if ( hasEquivalentExclusions( exclusions ) )
- {
+ public Dependency setExclusions(Collection<Exclusion> exclusions) {
+ if (hasEquivalentExclusions(exclusions)) {
return this;
}
- return new Dependency( artifact, scope, optional, exclusions );
+ return new Dependency(artifact, scope, optional, exclusions);
}
- private boolean hasEquivalentExclusions( Collection<Exclusion> exclusions )
- {
- if ( exclusions == null || exclusions.isEmpty() )
- {
+ private boolean hasEquivalentExclusions(Collection<Exclusion> exclusions) {
+ if (exclusions == null || exclusions.isEmpty()) {
return this.exclusions.isEmpty();
}
- if ( exclusions instanceof Set )
- {
- return this.exclusions.equals( exclusions );
+ if (exclusions instanceof Set) {
+ return this.exclusions.equals(exclusions);
}
- return exclusions.size() >= this.exclusions.size() && this.exclusions.containsAll( exclusions )
- && exclusions.containsAll( this.exclusions );
+ return exclusions.size() >= this.exclusions.size()
+ && this.exclusions.containsAll(exclusions)
+ && exclusions.containsAll(this.exclusions);
}
@Override
- public String toString()
- {
- return getArtifact() + " (" + getScope() + ( isOptional() ? "?" : "" ) + ")";
+ public String toString() {
+ return getArtifact() + " (" + getScope() + (isOptional() ? "?" : "") + ")";
}
@Override
- public boolean equals( Object obj )
- {
- if ( obj == this )
- {
+ public boolean equals(Object obj) {
+ if (obj == this) {
return true;
- }
- else if ( obj == null || !getClass().equals( obj.getClass() ) )
- {
+ } else if (obj == null || !getClass().equals(obj.getClass())) {
return false;
}
Dependency that = (Dependency) obj;
- return Objects.equals( artifact, that.artifact ) && Objects.equals( scope, that.scope )
- && Objects.equals( optional, that.optional ) && Objects.equals( exclusions, that.exclusions );
+ return Objects.equals(artifact, that.artifact)
+ && Objects.equals(scope, that.scope)
+ && Objects.equals(optional, that.optional)
+ && Objects.equals(exclusions, that.exclusions);
}
@Override
- public int hashCode()
- {
+ public int hashCode() {
int hash = 17;
hash = hash * 31 + artifact.hashCode();
hash = hash * 31 + scope.hashCode();
- hash = hash * 31 + ( optional != null ? optional.hashCode() : 0 );
+ hash = hash * 31 + (optional != null ? optional.hashCode() : 0);
hash = hash * 31 + exclusions.size();
return hash;
}
- private static class Exclusions
- extends AbstractSet<Exclusion>
- {
+ private static class Exclusions extends AbstractSet<Exclusion> {
private final Exclusion[] exclusions;
- public static Set<Exclusion> copy( Collection<Exclusion> exclusions )
- {
- if ( exclusions == null || exclusions.isEmpty() )
- {
+ public static Set<Exclusion> copy(Collection<Exclusion> exclusions) {
+ if (exclusions == null || exclusions.isEmpty()) {
return Collections.emptySet();
}
- return new Exclusions( exclusions );
+ return new Exclusions(exclusions);
}
- private Exclusions( Collection<Exclusion> exclusions )
- {
- if ( exclusions.size() > 1 && !( exclusions instanceof Set ) )
- {
- exclusions = new LinkedHashSet<>( exclusions );
+ private Exclusions(Collection<Exclusion> exclusions) {
+ if (exclusions.size() > 1 && !(exclusions instanceof Set)) {
+ exclusions = new LinkedHashSet<>(exclusions);
}
- this.exclusions = exclusions.toArray( new Exclusion[0] );
+ this.exclusions = exclusions.toArray(new Exclusion[0]);
}
@Override
- public Iterator<Exclusion> iterator()
- {
- return new Iterator<Exclusion>()
- {
+ public Iterator<Exclusion> iterator() {
+ return new Iterator<Exclusion>() {
private int cursor = 0;
- public boolean hasNext()
- {
+ public boolean hasNext() {
return cursor < exclusions.length;
}
- public Exclusion next()
- {
- try
- {
+ public Exclusion next() {
+ try {
Exclusion exclusion = exclusions[cursor];
cursor++;
return exclusion;
- }
- catch ( IndexOutOfBoundsException e )
- {
+ } catch (IndexOutOfBoundsException e) {
throw new NoSuchElementException();
}
}
- public void remove()
- {
+ public void remove() {
throw new UnsupportedOperationException();
}
-
};
}
@Override
- public int size()
- {
+ public int size() {
return exclusions.length;
}
-
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java
index 1076ab81..3a552c86 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyCycle.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
import java.util.List;
@@ -25,17 +24,16 @@ import java.util.List;
* A cycle within a dependency graph, that is a sequence of dependencies d_1, d_2, ..., d_n where d_1 and d_n have the
* same versionless coordinates. In more practical terms, a cycle occurs when a project directly or indirectly depends
* on its own output artifact.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface DependencyCycle
-{
+public interface DependencyCycle {
/**
* Gets the dependencies that lead to the first dependency on the cycle, starting from the root of the dependency
* graph.
- *
+ *
* @return The (read-only) sequence of dependencies that precedes the cycle in the graph, potentially empty but
* never {@code null}.
*/
@@ -45,9 +43,8 @@ public interface DependencyCycle
* Gets the dependencies that actually form the cycle. For example, a -> b -> c -> a, i.e. the last
* dependency in this sequence duplicates the first element and closes the cycle. Hence the length of the cycle is
* the size of the returned sequence minus 1.
- *
+ *
* @return The (read-only) sequence of dependencies that forms the cycle, never {@code null}.
*/
List<Dependency> getCyclicDependencies();
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java
index 41776ff9..585b1f1c 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyFilter.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,18 +16,18 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
import java.util.List;
/**
* A filter to include/exclude dependency nodes during other operations.
*/
-public interface DependencyFilter
-{
+public interface DependencyFilter {
/**
* Indicates whether the specified dependency node shall be included or excluded.
- *
+ *
* @param node The dependency node to filter, must not be {@code null}.
* @param parents The (read-only) chain of parent nodes that leads to the node to be filtered, must not be
* {@code null}. Iterating this (possibly empty) list walks up the dependency graph towards the root
@@ -37,6 +35,5 @@ public interface DependencyFilter
* denotes the zero-based depth of the filtered node.
* @return {@code true} to include the dependency node, {@code false} to exclude it.
*/
- boolean accept( DependencyNode node, List<DependencyNode> parents );
-
+ boolean accept(DependencyNode node, List<DependencyNode> parents);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java
index 25510430..da0baeb1 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyNode.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
import java.util.Collection;
import java.util.List;
@@ -34,44 +33,43 @@ import org.eclipse.aether.version.VersionConstraint;
* discover multiple paths leading to the same node instance unless the input graph is known to be a duplicate-free
* tree. <em>Note:</em> Unless otherwise noted, implementation classes are not thread-safe and dependency nodes should
* not be mutated by concurrent threads.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface DependencyNode
-{
+public interface DependencyNode {
/**
* A bit flag indicating the dependency version was subject to dependency management
- *
+ *
* @see #getManagedBits()
*/
int MANAGED_VERSION = 0x01;
/**
* A bit flag indicating the dependency scope was subject to dependency management
- *
+ *
* @see #getManagedBits()
*/
int MANAGED_SCOPE = 0x02;
/**
* A bit flag indicating the optional flag was subject to dependency management
- *
+ *
* @see #getManagedBits()
*/
int MANAGED_OPTIONAL = 0x04;
/**
* A bit flag indicating the artifact properties were subject to dependency management
- *
+ *
* @see #getManagedBits()
*/
int MANAGED_PROPERTIES = 0x08;
/**
* A bit flag indicating the exclusions were subject to dependency management
- *
+ *
* @see #getManagedBits()
*/
int MANAGED_EXCLUSIONS = 0x10;
@@ -81,23 +79,23 @@ public interface DependencyNode
* same child list instance. Hence clients mutating the child list need to be aware that these changes might affect
* more than this node. Where this is not desired, the child list should be copied before mutation if the client
* cannot be sure whether it might be shared with other nodes in the graph.
- *
+ *
* @return The child nodes of this node, never {@code null}.
*/
List<DependencyNode> getChildren();
/**
* Sets the child nodes of this node.
- *
+ *
* @param children The child nodes, may be {@code null}
*/
- void setChildren( List<DependencyNode> children );
+ void setChildren(List<DependencyNode> children);
/**
* Gets the dependency associated with this node. <em>Note:</em> For dependency graphs that have been constructed
* without a root dependency, this method will yield {@code null} when invoked on the graph's root node. The root
* node of such graphs may however still have a label as returned by {@link #getArtifact()}.
- *
+ *
* @return The dependency or {@code null} if none.
*/
Dependency getDependency();
@@ -106,7 +104,7 @@ public interface DependencyNode
* Gets the artifact associated with this node. If this node is associated with a dependency, this is equivalent to
* {@code getDependency().getArtifact()}. Otherwise the artifact merely provides a label for this node in which case
* the artifact must not be subjected to dependency collection/resolution.
- *
+ *
* @return The associated artifact or {@code null} if none.
*/
Artifact getArtifact();
@@ -115,14 +113,14 @@ public interface DependencyNode
* Updates the artifact of the dependency after resolution. The new artifact must have the same coordinates as the
* original artifact. This method may only be invoked if this node actually has a dependency, i.e. if
* {@link #getDependency()} is not null.
- *
+ *
* @param artifact The artifact satisfying the dependency, must not be {@code null}.
*/
- void setArtifact( Artifact artifact );
+ void setArtifact(Artifact artifact);
/**
* Gets the sequence of relocations that was followed to resolve the artifact referenced by the dependency.
- *
+ *
* @return The (read-only) sequence of relocations, never {@code null}.
*/
List<? extends Artifact> getRelocations();
@@ -131,21 +129,21 @@ public interface DependencyNode
* Gets the known aliases for this dependency's artifact. An alias can be used to mark a patched rebuild of some
* other artifact as such, thereby allowing conflict resolution to consider the patched and the original artifact as
* a conflict.
- *
+ *
* @return The (read-only) set of known aliases, never {@code null}.
*/
Collection<? extends Artifact> getAliases();
/**
* Gets the version constraint that was parsed from the dependency's version declaration.
- *
+ *
* @return The version constraint for this node or {@code null}.
*/
VersionConstraint getVersionConstraint();
/**
* Gets the version that was selected for the dependency's target artifact.
- *
+ *
* @return The parsed version or {@code null}.
*/
Version getVersion();
@@ -153,22 +151,22 @@ public interface DependencyNode
/**
* Sets the scope of the dependency. This method may only be invoked if this node actually has a dependency, i.e. if
* {@link #getDependency()} is not null.
- *
+ *
* @param scope The scope, may be {@code null}.
*/
- void setScope( String scope );
+ void setScope(String scope);
/**
* Sets the optional flag of the dependency. This method may only be invoked if this node actually has a dependency,
* i.e. if {@link #getDependency()} is not null.
- *
+ *
* @param optional The optional flag, may be {@code null}.
*/
- void setOptional( Boolean optional );
+ void setOptional(Boolean optional);
/**
* Gets a bit field indicating which attributes of this node were subject to dependency management.
- *
+ *
* @return A bit field containing any of the bits {@link #MANAGED_VERSION}, {@link #MANAGED_SCOPE},
* {@link #MANAGED_OPTIONAL}, {@link #MANAGED_PROPERTIES} and {@link #MANAGED_EXCLUSIONS} if the
* corresponding attribute was set via dependency management.
@@ -177,56 +175,55 @@ public interface DependencyNode
/**
* Gets the remote repositories from which this node's artifact shall be resolved.
- *
+ *
* @return The (read-only) list of remote repositories to use for artifact resolution, never {@code null}.
*/
List<RemoteRepository> getRepositories();
/**
* Gets the request context in which this dependency node was created.
- *
+ *
* @return The request context, never {@code null}.
*/
String getRequestContext();
/**
* Sets the request context in which this dependency node was created.
- *
+ *
* @param context The context, may be {@code null}.
*/
- void setRequestContext( String context );
+ void setRequestContext(String context);
/**
* Gets the custom data associated with this dependency node. Clients of the repository system can use this data to
* annotate dependency nodes with domain-specific information. Note that the returned map is read-only and
* {@link #setData(Object, Object)} needs to be used to update the custom data.
- *
+ *
* @return The (read-only) key-value mappings, never {@code null}.
*/
Map<?, ?> getData();
/**
* Sets the custom data associated with this dependency node.
- *
+ *
* @param data The new custom data, may be {@code null}.
*/
- void setData( Map<Object, Object> data );
+ void setData(Map<Object, Object> data);
/**
* Associates the specified dependency node data with the given key. <em>Note:</em> This method must not be called
* while {@link #getData()} is being iterated.
- *
+ *
* @param key The key under which to store the data, must not be {@code null}.
* @param value The data to associate with the key, may be {@code null} to remove the mapping.
*/
- void setData( Object key, Object value );
+ void setData(Object key, Object value);
/**
* Traverses this node and potentially its children using the specified visitor.
- *
+ *
* @param visitor The visitor to call back, must not be {@code null}.
* @return {@code true} to visit siblings nodes of this node as well, {@code false} to skip siblings.
*/
- boolean accept( DependencyVisitor visitor );
-
+ boolean accept(DependencyVisitor visitor);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java
index 2a85f2d0..cb611bc5 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/DependencyVisitor.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.graph;
* 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
- *
+ *
+ * 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
@@ -18,30 +16,29 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
/**
* A visitor for nodes of the dependency graph.
- *
+ *
* @see DependencyNode#accept(DependencyVisitor)
*/
-public interface DependencyVisitor
-{
+public interface DependencyVisitor {
/**
* Notifies the visitor of a node visit before its children have been processed.
- *
+ *
* @param node The dependency node being visited, must not be {@code null}.
* @return {@code true} to visit child nodes of the specified node as well, {@code false} to skip children.
*/
- boolean visitEnter( DependencyNode node );
+ boolean visitEnter(DependencyNode node);
/**
* Notifies the visitor of a node visit after its children have been processed. Note that this method is always
* invoked regardless whether any children have actually been visited.
- *
+ *
* @param node The dependency node being visited, must not be {@code null}.
* @return {@code true} to visit siblings nodes of the specified node as well, {@code false} to skip siblings.
*/
- boolean visitLeave( DependencyNode node );
-
+ boolean visitLeave(DependencyNode node);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java
index 6d35b710..ddf5d252 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/Exclusion.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.graph;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -9,7 +7,7 @@ package org.eclipse.aether.graph;
* "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
+ * 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
@@ -18,14 +16,14 @@ package org.eclipse.aether.graph;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.graph;
/**
* An exclusion of one or more transitive dependencies.
*
* @see Dependency#getExclusions()
*/
-public final class Exclusion
-{
+public final class Exclusion {
private final String groupId;
@@ -43,12 +41,11 @@ public final class Exclusion
* @param classifier The classifier, may be {@code null}.
* @param extension The file extension, may be {@code null}.
*/
- public Exclusion( String groupId, String artifactId, String classifier, String extension )
- {
- this.groupId = ( groupId != null ) ? groupId : "";
- this.artifactId = ( artifactId != null ) ? artifactId : "";
- this.classifier = ( classifier != null ) ? classifier : "";
- this.extension = ( extension != null ) ? extension : "";
+ public Exclusion(String groupId, String artifactId, String classifier, String extension) {
+ this.groupId = (groupId != null) ? groupId : "";
+ this.artifactId = (artifactId != null) ? artifactId : "";
+ this.classifier = (classifier != null) ? classifier : "";
+ this.extension = (extension != null) ? extension : "";
}
/**
@@ -56,8 +53,7 @@ public final class Exclusion
*
* @return The group identifier, never {@code null}.
*/
- public String getGroupId()
- {
+ public String getGroupId() {
return groupId;
}
@@ -66,8 +62,7 @@ public final class Exclusion
*
* @return The artifact identifier, never {@code null}.
*/
- public String getArtifactId()
- {
+ public String getArtifactId() {
return artifactId;
}
@@ -76,8 +71,7 @@ public final class Exclusion
*
* @return The classifier, never {@code null}.
*/
- public String getClassifier()
- {
+ public String getClassifier() {
return classifier;
}
@@ -86,39 +80,38 @@ public final class Exclusion
*
* @return The file extension of artifacts to exclude, never {@code null}.
*/
- public String getExtension()
- {
+ public String getExtension() {
return extension;
}
@Override
- public String toString()
- {
- return getGroupId() + ':' + getArtifactId() + ':' + getExtension()
- + ( getClassifier().length() > 0 ? ':' + getClassifier() : "" );
+ public String toString() {
+ return getGroupId()
+ + ':'
+ + getArtifactId()
+ + ':'
+ + getExtension()
+ + (getClassifier().length() > 0 ? ':' + getClassifier() : "");
}
@Override
- public boolean equals( Object obj )
- {
- if ( obj == this )
- {
+ public boolean equals(Object obj) {
+ if (obj == this) {
return true;
- }
- else if ( obj == null || !getClass().equals( obj.getClass() ) )
- {
+ } else if (obj == null || !getClass().equals(obj.getClass())) {
return false;
}
Exclusion that = (Exclusion) obj;
- return artifactId.equals( that.artifactId ) && groupId.equals( that.groupId )
- && extension.equals( that.extension ) && classifier.equals( that.classifier );
+ return artifactId.equals(that.artifactId)
+ && groupId.equals(that.groupId)
+ && extension.equals(that.extension)
+ && classifier.equals(that.classifier);
}
@Override
- public int hashCode()
- {
+ public int hashCode() {
int hash = 17;
hash = hash * 31 + artifactId.hashCode();
hash = hash * 31 + groupId.hashCode();
@@ -126,5 +119,4 @@ public final class Exclusion
hash = hash * 31 + extension.hashCode();
return hash;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java
index c3ba9db1..ac30e4b8 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/graph/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -21,4 +21,3 @@
* The representation of a dependency graph by means of connected dependency nodes.
*/
package org.eclipse.aether.graph;
-
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java
index a7f00cf0..fd4567aa 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallRequest.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.installation;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.installation;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.installation;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.installation;
import java.util.ArrayList;
import java.util.Collection;
@@ -30,11 +29,10 @@ import org.eclipse.aether.metadata.Metadata;
/**
* A request to install artifacts and their accompanying metadata into the local repository.
- *
+ *
* @see RepositorySystem#install(RepositorySystemSession, InstallRequest)
*/
-public final class InstallRequest
-{
+public final class InstallRequest {
private Collection<Artifact> artifacts = Collections.emptyList();
@@ -45,34 +43,27 @@ public final class InstallRequest
/**
* Creates an uninitialized request.
*/
- public InstallRequest()
- {
- }
+ public InstallRequest() {}
/**
* Gets the artifact to install.
- *
+ *
* @return The artifacts to install, never {@code null}.
*/
- public Collection<Artifact> getArtifacts()
- {
+ public Collection<Artifact> getArtifacts() {
return artifacts;
}
/**
* Sets the artifacts to install.
- *
+ *
* @param artifacts The artifacts to install, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public InstallRequest setArtifacts( Collection<Artifact> artifacts )
- {
- if ( artifacts == null )
- {
+ public InstallRequest setArtifacts(Collection<Artifact> artifacts) {
+ if (artifacts == null) {
this.artifacts = Collections.emptyList();
- }
- else
- {
+ } else {
this.artifacts = artifacts;
}
return this;
@@ -80,47 +71,39 @@ public final class InstallRequest
/**
* Adds the specified artifacts for installation.
- *
+ *
* @param artifact The artifact to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public InstallRequest addArtifact( Artifact artifact )
- {
- if ( artifact != null )
- {
- if ( artifacts.isEmpty() )
- {
+ public InstallRequest addArtifact(Artifact artifact) {
+ if (artifact != null) {
+ if (artifacts.isEmpty()) {
artifacts = new ArrayList<>();
}
- artifacts.add( artifact );
+ artifacts.add(artifact);
}
return this;
}
/**
* Gets the metadata to install.
- *
+ *
* @return The metadata to install, never {@code null}.
*/
- public Collection<Metadata> getMetadata()
- {
+ public Collection<Metadata> getMetadata() {
return metadata;
}
/**
* Sets the metadata to install.
- *
+ *
* @param metadata The metadata to install.
* @return This request for chaining, never {@code null}.
*/
- public InstallRequest setMetadata( Collection<Metadata> metadata )
- {
- if ( metadata == null )
- {
+ public InstallRequest setMetadata(Collection<Metadata> metadata) {
+ if (metadata == null) {
this.metadata = Collections.emptyList();
- }
- else
- {
+ } else {
this.metadata = metadata;
}
return this;
@@ -128,49 +111,42 @@ public final class InstallRequest
/**
* Adds the specified metadata for installation.
- *
+ *
* @param metadata The metadata to add, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public InstallRequest addMetadata( Metadata metadata )
- {
- if ( metadata != null )
- {
- if ( this.metadata.isEmpty() )
- {
+ public InstallRequest addMetadata(Metadata metadata) {
+ if (metadata != null) {
+ if (this.metadata.isEmpty()) {
this.metadata = new ArrayList<>();
}
- this.metadata.add( metadata );
+ this.metadata.add(metadata);
}
return this;
}
/**
* Gets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @return The trace information about the higher level operation or {@code null} if none.
*/
- public RequestTrace getTrace()
- {
+ public RequestTrace getTrace() {
return trace;
}
/**
* Sets the trace information that describes the higher level request/operation in which this request is issued.
- *
+ *
* @param trace The trace information about the higher level operation, may be {@code null}.
* @return This request for chaining, never {@code null}.
*/
- public InstallRequest setTrace( RequestTrace trace )
- {
+ public InstallRequest setTrace(RequestTrace trace) {
this.trace = trace;
return this;
}
@Override
- public String toString()
- {
+ public String toString() {
return getArtifacts() + ", " + getMetadata();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java
index cfb9b6fc..fcef5ce3 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallResult.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.installation;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.installation;
* 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
- *
+ *
+ * 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
@@ -18,22 +16,23 @@ package org.eclipse.aether.installation;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.installation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
-import static java.util.Objects.requireNonNull;
import org.eclipse.aether.artifact.Artifact;
import org.eclipse.aether.metadata.Metadata;
+import static java.util.Objects.requireNonNull;
+
/**
* The result of installing artifacts and their accompanying metadata into the a remote repository.
- *
+ *
* @see org.eclipse.aether.RepositorySystem#install(org.eclipse.aether.RepositorySystemSession, InstallRequest)
*/
-public final class InstallResult
-{
+public final class InstallResult {
private final InstallRequest request;
@@ -46,9 +45,8 @@ public final class InstallResult
*
* @param request The installation request, must not be {@code null}.
*/
- public InstallResult( InstallRequest request )
- {
- this.request = requireNonNull( request, "install request cannot be null" );
+ public InstallResult(InstallRequest request) {
+ this.request = requireNonNull(request, "install request cannot be null");
artifacts = Collections.emptyList();
metadata = Collections.emptyList();
}
@@ -58,35 +56,29 @@ public final class InstallResult
*
* @return The install request, never {@code null}.
*/
- public InstallRequest getRequest()
- {
+ public InstallRequest getRequest() {
return request;
}
/**
* Gets the artifacts that got installed.
- *
+ *
* @return The installed artifacts, never {@code null}.
*/
- public Collection<Artifact> getArtifacts()
- {
+ public Collection<Artifact> getArtifacts() {
return artifacts;
}
/**
* Sets the artifacts that got installed.
- *
+ *
* @param artifacts The installed artifacts, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public InstallResult setArtifacts( Collection<Artifact> artifacts )
- {
- if ( artifacts == null )
- {
+ public InstallResult setArtifacts(Collection<Artifact> artifacts) {
+ if (artifacts == null) {
this.artifacts = Collections.emptyList();
- }
- else
- {
+ } else {
this.artifacts = artifacts;
}
return this;
@@ -94,19 +86,16 @@ public final class InstallResult
/**
* Adds the specified artifacts to the result.
- *
+ *
* @param artifact The installed artifact to add, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public InstallResult addArtifact( Artifact artifact )
- {
- if ( artifact != null )
- {
- if ( artifacts.isEmpty() )
- {
+ public InstallResult addArtifact(Artifact artifact) {
+ if (artifact != null) {
+ if (artifacts.isEmpty()) {
artifacts = new ArrayList<>();
}
- artifacts.add( artifact );
+ artifacts.add(artifact);
}
return this;
}
@@ -114,28 +103,23 @@ public final class InstallResult
/**
* Gets the metadata that got installed. Note that due to automatically generated metadata, there might have been
* more metadata installed than originally specified in the install request.
- *
+ *
* @return The installed metadata, never {@code null}.
*/
- public Collection<Metadata> getMetadata()
- {
+ public Collection<Metadata> getMetadata() {
return metadata;
}
/**
* Sets the metadata that got installed.
- *
+ *
* @param metadata The installed metadata, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public InstallResult setMetadata( Collection<Metadata> metadata )
- {
- if ( metadata == null )
- {
+ public InstallResult setMetadata(Collection<Metadata> metadata) {
+ if (metadata == null) {
this.metadata = Collections.emptyList();
- }
- else
- {
+ } else {
this.metadata = metadata;
}
return this;
@@ -143,27 +127,22 @@ public final class InstallResult
/**
* Adds the specified metadata to this result.
- *
+ *
* @param metadata The installed metadata to add, may be {@code null}.
* @return This result for chaining, never {@code null}.
*/
- public InstallResult addMetadata( Metadata metadata )
- {
- if ( metadata != null )
- {
- if ( this.metadata.isEmpty() )
- {
+ public InstallResult addMetadata(Metadata metadata) {
+ if (metadata != null) {
+ if (this.metadata.isEmpty()) {
this.metadata = new ArrayList<>();
}
- this.metadata.add( metadata );
+ this.metadata.add(metadata);
}
return this;
}
@Override
- public String toString()
- {
+ public String toString() {
return getArtifacts() + ", " + getMetadata();
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java
index 9a556bb6..9d003a93 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/InstallationException.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.installation;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.installation;
* 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
- *
+ *
+ * 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
@@ -18,35 +16,31 @@ package org.eclipse.aether.installation;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.installation;
import org.eclipse.aether.RepositoryException;
/**
* Thrown in case of an installation error like an IO error.
*/
-public class InstallationException
- extends RepositoryException
-{
+public class InstallationException extends RepositoryException {
/**
* Creates a new exception with the specified detail message.
- *
+ *
* @param message The detail message, may be {@code null}.
*/
- public InstallationException( String message )
- {
- super( message );
+ public InstallationException(String message) {
+ super(message);
}
/**
* Creates a new exception with the specified detail message and cause.
- *
+ *
* @param message The detail message, may be {@code null}.
* @param cause The exception that caused this one, may be {@code null}.
*/
- public InstallationException( String message, Throwable cause )
- {
- super( message, cause );
+ public InstallationException(String message, Throwable cause) {
+ super(message, cause);
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java
index d4ac0775..27c04eb7 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/installation/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -21,4 +21,3 @@
* The types supporting the publishing of artifacts to a local repository.
*/
package org.eclipse.aether.installation;
-
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java
index 3c0706a3..bbb07f9e 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/AbstractMetadata.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.metadata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.metadata;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.metadata;
import java.io.File;
import java.util.Collections;
@@ -28,132 +27,109 @@ import java.util.Objects;
/**
* A skeleton class for metadata.
*/
-public abstract class AbstractMetadata
- implements Metadata
-{
+public abstract class AbstractMetadata implements Metadata {
- private Metadata newInstance( Map<String, String> properties, File file )
- {
- return new DefaultMetadata( getGroupId(), getArtifactId(), getVersion(), getType(), getNature(), file,
- properties );
+ private Metadata newInstance(Map<String, String> properties, File file) {
+ return new DefaultMetadata(
+ getGroupId(), getArtifactId(), getVersion(), getType(), getNature(), file, properties);
}
- public Metadata setFile( File file )
- {
+ public Metadata setFile(File file) {
File current = getFile();
- if ( Objects.equals( current, file ) )
- {
+ if (Objects.equals(current, file)) {
return this;
}
- return newInstance( getProperties(), file );
+ return newInstance(getProperties(), file);
}
- public Metadata setProperties( Map<String, String> properties )
- {
+ public Metadata setProperties(Map<String, String> properties) {
Map<String, String> current = getProperties();
- if ( current.equals( properties ) || ( properties == null && current.isEmpty() ) )
- {
+ if (current.equals(properties) || (properties == null && current.isEmpty())) {
return this;
}
- return newInstance( copyProperties( properties ), getFile() );
+ return newInstance(copyProperties(properties), getFile());
}
- public String getProperty( String key, String defaultValue )
- {
- String value = getProperties().get( key );
- return ( value != null ) ? value : defaultValue;
+ public String getProperty(String key, String defaultValue) {
+ String value = getProperties().get(key);
+ return (value != null) ? value : defaultValue;
}
/**
* Copies the specified metadata properties. This utility method should be used when creating new metadata instances
* with caller-supplied properties.
- *
+ *
* @param properties The properties to copy, may be {@code null}.
* @return The copied and read-only properties, never {@code null}.
*/
- protected static Map<String, String> copyProperties( Map<String, String> properties )
- {
- if ( properties != null && !properties.isEmpty() )
- {
- return Collections.unmodifiableMap( new HashMap<>( properties ) );
- }
- else
- {
+ protected static Map<String, String> copyProperties(Map<String, String> properties) {
+ if (properties != null && !properties.isEmpty()) {
+ return Collections.unmodifiableMap(new HashMap<>(properties));
+ } else {
return Collections.emptyMap();
}
}
@Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder( 128 );
- if ( getGroupId().length() > 0 )
- {
- buffer.append( getGroupId() );
+ public String toString() {
+ StringBuilder buffer = new StringBuilder(128);
+ if (getGroupId().length() > 0) {
+ buffer.append(getGroupId());
}
- if ( getArtifactId().length() > 0 )
- {
- buffer.append( ':' ).append( getArtifactId() );
+ if (getArtifactId().length() > 0) {
+ buffer.append(':').append(getArtifactId());
}
- if ( getVersion().length() > 0 )
- {
- buffer.append( ':' ).append( getVersion() );
+ if (getVersion().length() > 0) {
+ buffer.append(':').append(getVersion());
}
- buffer.append( '/' ).append( getType() );
+ buffer.append('/').append(getType());
return buffer.toString();
}
/**
* Compares this metadata with the specified object.
- *
+ *
* @param obj The object to compare this metadata against, may be {@code null}.
* @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates,
* type, nature, properties and file, {@code false} otherwise.
*/
@Override
- public boolean equals( Object obj )
- {
- if ( obj == this )
- {
+ public boolean equals(Object obj) {
+ if (obj == this) {
return true;
- }
- else if ( !( obj instanceof Metadata ) )
- {
+ } else if (!(obj instanceof Metadata)) {
return false;
}
Metadata that = (Metadata) obj;
- return Objects.equals( getArtifactId(), that.getArtifactId() )
- && Objects.equals( getGroupId(), that.getGroupId() )
- && Objects.equals( getVersion(), that.getVersion() )
- && Objects.equals( getType(), that.getType() )
- && Objects.equals( getNature(), that.getNature() )
- && Objects.equals( getFile(), that.getFile() )
- && Objects.equals( getProperties(), that.getProperties() );
+ return Objects.equals(getArtifactId(), that.getArtifactId())
+ && Objects.equals(getGroupId(), that.getGroupId())
+ && Objects.equals(getVersion(), that.getVersion())
+ && Objects.equals(getType(), that.getType())
+ && Objects.equals(getNature(), that.getNature())
+ && Objects.equals(getFile(), that.getFile())
+ && Objects.equals(getProperties(), that.getProperties());
}
/**
* Returns a hash code for this metadata.
- *
+ *
* @return A hash code for the metadata.
*/
@Override
- public int hashCode()
- {
+ public int hashCode() {
int hash = 17;
hash = hash * 31 + getGroupId().hashCode();
hash = hash * 31 + getArtifactId().hashCode();
hash = hash * 31 + getType().hashCode();
hash = hash * 31 + getNature().hashCode();
hash = hash * 31 + getVersion().hashCode();
- hash = hash * 31 + hash( getFile() );
+ hash = hash * 31 + hash(getFile());
return hash;
}
- private static int hash( Object obj )
- {
- return ( obj != null ) ? obj.hashCode() : 0;
+ private static int hash(Object obj) {
+ return (obj != null) ? obj.hashCode() : 0;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java
index 16bcd619..036ced33 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/DefaultMetadata.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.metadata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.metadata;
* 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
- *
+ *
+ * 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
@@ -18,18 +16,18 @@ package org.eclipse.aether.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.metadata;
import java.io.File;
import java.util.Map;
+
import static java.util.Objects.requireNonNull;
/**
* A basic metadata instance. <em>Note:</em> Instances of this class are immutable and the exposed mutators return new
* objects rather than changing the current instance.
*/
-public final class DefaultMetadata
- extends AbstractMetadata
-{
+public final class DefaultMetadata extends AbstractMetadata {
private final String groupId;
@@ -47,57 +45,53 @@ public final class DefaultMetadata
/**
* Creates a new metadata for the repository root with the specific type and nature.
- *
+ *
* @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}.
* @param nature The nature of the metadata, must not be {@code null}.
*/
- public DefaultMetadata( String type, Nature nature )
- {
- this( "", "", "", type, nature, null, (File) null );
+ public DefaultMetadata(String type, Nature nature) {
+ this("", "", "", type, nature, null, (File) null);
}
/**
* Creates a new metadata for the groupId level with the specific type and nature.
- *
+ *
* @param groupId The group identifier to which this metadata applies, may be {@code null}.
* @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}.
* @param nature The nature of the metadata, must not be {@code null}.
*/
- public DefaultMetadata( String groupId, String type, Nature nature )
- {
- this( groupId, "", "", type, nature, null, (File) null );
+ public DefaultMetadata(String groupId, String type, Nature nature) {
+ this(groupId, "", "", type, nature, null, (File) null);
}
/**
* Creates a new metadata for the groupId:artifactId level with the specific type and nature.
- *
+ *
* @param groupId The group identifier to which this metadata applies, may be {@code null}.
* @param artifactId The artifact identifier to which this metadata applies, may be {@code null}.
* @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}.
* @param nature The nature of the metadata, must not be {@code null}.
*/
- public DefaultMetadata( String groupId, String artifactId, String type, Nature nature )
- {
- this( groupId, artifactId, "", type, nature, null, (File) null );
+ public DefaultMetadata(String groupId, String artifactId, String type, Nature nature) {
+ this(groupId, artifactId, "", type, nature, null, (File) null);
}
/**
* Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
- *
+ *
* @param groupId The group identifier to which this metadata applies, may be {@code null}.
* @param artifactId The artifact identifier to which this metadata applies, may be {@code null}.
* @param version The version to which this metadata applies, may be {@code null}.
* @param type The type of the metadata, e.g. "maven-metadata.xml", may be {@code null}.
* @param nature The nature of the metadata, must not be {@code null}.
*/
- public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature )
- {
- this( groupId, artifactId, version, type, nature, null, (File) null );
+ public DefaultMetadata(String groupId, String artifactId, String version, String type, Nature nature) {
+ this(groupId, artifactId, version, type, nature, null, (File) null);
}
/**
* Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
- *
+ *
* @param groupId The group identifier to which this metadata applies, may be {@code null}.
* @param artifactId The artifact identifier to which this metadata applies, may be {@code null}.
* @param version The version to which this metadata applies, may be {@code null}.
@@ -105,14 +99,13 @@ public final class DefaultMetadata
* @param nature The nature of the metadata, must not be {@code null}.
* @param file The resolved file of the metadata, may be {@code null}.
*/
- public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file )
- {
- this( groupId, artifactId, version, type, nature, null, file );
+ public DefaultMetadata(String groupId, String artifactId, String version, String type, Nature nature, File file) {
+ this(groupId, artifactId, version, type, nature, null, file);
}
/**
* Creates a new metadata for the groupId:artifactId:version level with the specific type and nature.
- *
+ *
* @param groupId The group identifier to which this metadata applies, may be {@code null}.
* @param artifactId The artifact identifier to which this metadata applies, may be {@code null}.
* @param version The version to which this metadata applies, may be {@code null}.
@@ -121,69 +114,70 @@ public final class DefaultMetadata
* @param properties The properties of the metadata, may be {@code null} if none.
* @param file The resolved file of the metadata, may be {@code null}.
*/
- public DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature,
- Map<String, String> properties, File file )
- {
- this.groupId = emptify( groupId );
- this.artifactId = emptify( artifactId );
- this.version = emptify( version );
- this.type = emptify( type );
- this.nature = requireNonNull( nature, "metadata nature cannot be null" );
+ public DefaultMetadata(
+ String groupId,
+ String artifactId,
+ String version,
+ String type,
+ Nature nature,
+ Map<String, String> properties,
+ File file) {
+ this.groupId = emptify(groupId);
+ this.artifactId = emptify(artifactId);
+ this.version = emptify(version);
+ this.type = emptify(type);
+ this.nature = requireNonNull(nature, "metadata nature cannot be null");
this.file = file;
- this.properties = copyProperties( properties );
+ this.properties = copyProperties(properties);
}
- DefaultMetadata( String groupId, String artifactId, String version, String type, Nature nature, File file,
- Map<String, String> properties )
- {
+ DefaultMetadata(
+ String groupId,
+ String artifactId,
+ String version,
+ String type,
+ Nature nature,
+ File file,
+ Map<String, String> properties) {
// NOTE: This constructor assumes immutability of the provided properties, for internal use only
- this.groupId = emptify( groupId );
- this.artifactId = emptify( artifactId );
- this.version = emptify( version );
- this.type = emptify( type );
+ this.groupId = emptify(groupId);
+ this.artifactId = emptify(artifactId);
+ this.version = emptify(version);
+ this.type = emptify(type);
this.nature = nature;
this.file = file;
this.properties = properties;
}
- private static String emptify( String str )
- {
- return ( str == null ) ? "" : str;
+ private static String emptify(String str) {
+ return (str == null) ? "" : str;
}
- public String getGroupId()
- {
+ public String getGroupId() {
return groupId;
}
- public String getArtifactId()
- {
+ public String getArtifactId() {
return artifactId;
}
- public String getVersion()
- {
+ public String getVersion() {
return version;
}
- public String getType()
- {
+ public String getType() {
return type;
}
- public Nature getNature()
- {
+ public Nature getNature() {
return nature;
}
- public File getFile()
- {
+ public File getFile() {
return file;
}
- public Map<String, String> getProperties()
- {
+ public Map<String, String> getProperties() {
return properties;
}
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java
index deaff701..96ab2ee9 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/MergeableMetadata.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.metadata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.metadata;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.metadata;
import java.io.File;
@@ -26,26 +25,22 @@ import org.eclipse.aether.RepositoryException;
/**
* A piece of metadata that needs to be merged with any current metadata before installation/deployment.
*/
-public interface MergeableMetadata
- extends Metadata
-{
+public interface MergeableMetadata extends Metadata {
/**
* Merges this metadata into the current metadata (if any). Note that this method will be invoked regardless whether
* metadata currently exists or not.
- *
+ *
* @param current The path to the current metadata file, may not exist but must not be {@code null}.
* @param result The path to the result file where the merged metadata should be stored, must not be {@code null}.
* @throws RepositoryException If the metadata could not be merged.
*/
- void merge( File current, File result )
- throws RepositoryException;
+ void merge(File current, File result) throws RepositoryException;
/**
* Indicates whether this metadata has been merged.
- *
+ *
* @return {@code true} if the metadata has been merged, {@code false} otherwise.
*/
boolean isMerged();
-
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java
index 84e92123..e957919a 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/Metadata.java
@@ -1,5 +1,3 @@
-package org.eclipse.aether.metadata;
-
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
@@ -8,9 +6,9 @@ package org.eclipse.aether.metadata;
* 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
- *
+ *
+ * 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
@@ -18,6 +16,7 @@ package org.eclipse.aether.metadata;
* specific language governing permissions and limitations
* under the License.
*/
+package org.eclipse.aether.metadata;
import java.io.File;
import java.util.Map;
@@ -29,18 +28,16 @@ import java.util.Map;
* returns a new metadata instance and leaves the original instance unchanged. Implementors are strongly advised to obey
* this contract. <em>Note:</em> Implementors are strongly advised to inherit from {@link AbstractMetadata} instead of
* directly implementing this interface.
- *
+ *
* @noimplement This interface is not intended to be implemented by clients.
* @noextend This interface is not intended to be extended by clients.
*/
-public interface Metadata
-{
+public interface Metadata {
/**
* The nature of the metadata.
*/
- enum Nature
- {
+ enum Nature {
/**
* The metadata refers to release artifacts only.
*/
@@ -59,7 +56,7 @@ public interface Metadata
/**
* Gets the group identifier of this metadata.
- *
+ *
* @return The group identifier or an empty string if the metadata applies to the entire repository, never
* {@code null}.
*/
@@ -67,7 +64,7 @@ public interface Metadata
/**
* Gets the artifact identifier of this metadata.
- *
+ *
* @return The artifact identifier or an empty string if the metadata applies to the groupId level only, never
* {@code null}.
*/
@@ -75,7 +72,7 @@ public interface Metadata
/**
* Gets the version of this metadata.
- *
+ *
* @return The version or an empty string if the metadata applies to the groupId:artifactId level only, never
* {@code null}.
*/
@@ -83,56 +80,55 @@ public interface Metadata
/**
* Gets the type of the metadata, e.g. "maven-metadata.xml".
- *
+ *
* @return The type of the metadata, never {@code null}.
*/
String getType();
/**
* Gets the nature of this metadata. The nature indicates to what artifact versions the metadata refers.
- *
+ *
* @return The nature, never {@code null}.
*/
Nature getNature();
/**
* Gets the file of this metadata. Note that only resolved metadata has a file associated with it.
- *
+ *
* @return The file or {@code null} if none.
*/
File getFile();
/**
* Sets the file of the metadata.
- *
+ *
* @param file The file of the metadata, may be {@code null}
* @return The new metadata, never {@code null}.
*/
- Metadata setFile( File file );
+ Metadata setFile(File file);
/**
* Gets the specified property.
- *
+ *
* @param key The name of the property, must not be {@code null}.
* @param defaultValue The default value to return in case the property is not set, may be {@code null}.
* @return The requested property value or {@code null} if the property is not set and no default value was
* provided.
*/
- String getProperty( String key, String defaultValue );
+ String getProperty(String key, String defaultValue);
/**
* Gets the properties of this metadata.
- *
+ *
* @return The (read-only) properties, never {@code null}.
*/
Map<String, String> getProperties();
/**
* Sets the properties for the metadata.
- *
+ *
* @param properties The properties for the metadata, may be {@code null}.
* @return The new metadata, never {@code null}.
*/
- Metadata setProperties( Map<String, String> properties );
-
+ Metadata setProperties(Map<String, String> properties);
}
diff --git a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java
index e41f98e9..beff9b6a 100644
--- a/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java
+++ b/maven-resolver-api/src/main/java/org/eclipse/aether/metadata/package-info.java
@@ -7,9 +7,9 @@
* 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
@@ -21,4 +21,3 @@
* The definition of metadata, that is an auxiliary entity managed by the repository system to locate artifacts.
*/
package org.eclipse.aether.metadata;
-
... 107324 lines suppressed ...