public boolean isSnapshot() { for ( final VersionSpec spec : specs ) { if ( spec.isSnapshot() ) { return true; } } return false; }
@Override public boolean isSnapshot() { return getVersionSpec().isSnapshot(); }
@Override public boolean isSnapshot() { return getVersionSpec().isSnapshot(); }
private void initLocalRepo(GalleyMaven galley, Path scmDir) throws IOException { Set<Path> poms = getAllPoms(scmDir); for (Path pomFile : poms) { PomPeek peek = new PomPeek(pomFile.toFile()); final ProjectVersionRef key = peek.getKey(); if (key == null) { log.warn("Could not parse " + pomFile.toAbsolutePath()); continue; } try { String artifactPath = ArtifactPathUtils.formatArtifactPath(key.asPomArtifact(), galley.getTypeMapper()); Path p = path.resolve(artifactPath); Files.createDirectories(p.getParent()); if (key.getVersionSpec().isSnapshot()) { initSnapshot(key, pomFile, p); } else { Files.copy(pomFile, p); } } catch (TransferException | RuntimeException ex) { log.warn("Could not parse " + pomFile.toAbsolutePath(), ex); } catch (FileAlreadyExistsException ex) { log.error("File already exists. This is because there are multiple file with same " + "GAV. This ususaly happens when there are pom files in tests and is " + "harmless in this case.", ex); } } }
@Override public boolean contains( final VersionSpec version ) { if ( version.isSingle() ) { final SingleVersion sv = version.getSingleVersion(); if ( !getBaseVersion().equals( sv.getBaseVersion() ) ) { // if my base version doesn't match the other's base version, there's no way I can contain it. return false; } if ( isLocalSnapshot() ) { // if I'm a local snapshot, then I can contain any other single snapshot. return version.isSnapshot(); } else if ( sv.isLocalSnapshot() ) { // either I'm a release or a timestamped snapshot. // if the other one is a local snapshot, I DON'T contain it. return false; } return true; } return false; }