private void getSnapshotDependency( DependencyDescriptor dd, BuildableModuleVersionMetaDataResolveResult result) { final ModuleRevisionId dependencyRevisionId = dd.getDependencyRevisionId(); final String uniqueSnapshotVersion = findUniqueSnapshotVersion(dependencyRevisionId); if (uniqueSnapshotVersion != null) { DependencyDescriptor enrichedDependencyDescriptor = enrichDependencyDescriptorWithSnapshotVersionInfo( dd, dependencyRevisionId, uniqueSnapshotVersion); super.getDependency(enrichedDependencyDescriptor, result); if (result.getState() == BuildableModuleVersionMetaDataResolveResult.State.Resolved) { result.setModuleSource(new TimestampedModuleSource(uniqueSnapshotVersion)); } } else { super.getDependency(dd, result); } }
public MavenResolver( String name, URI rootUri, RepositoryTransport transport, LocallyAvailableResourceFinder<ArtifactRevisionId> locallyAvailableResourceFinder, MetaDataParser metaDataParser, ModuleMetadataProcessor metadataProcessor) { super( name, transport.getRepository(), new ChainedVersionLister( new MavenVersionLister(transport.getRepository()), new ResourceVersionLister(transport.getRepository())), locallyAvailableResourceFinder, metaDataParser, metadataProcessor); transport.configureCacheManager(this); this.mavenMetaDataLoader = new MavenMetadataLoader(transport.getRepository()); this.transport = transport; this.root = transport.convertToPath(rootUri); super.setM2compatible(true); // SNAPSHOT revisions are changing revisions setChangingMatcher(PatternMatcher.REGEXP); setChangingPattern(".*-SNAPSHOT"); updatePatterns(); }
public void getDependency( DependencyDescriptor dd, BuildableModuleVersionMetaDataResolveResult result) { if (isSnapshotVersion(dd)) { getSnapshotDependency(dd, result); } else { super.getDependency(dd, result); } }