private void ResyncArtifactsImpl( ArtifactResyncSource artifactResyncSource) { EnsureInitialized(); GetReferencesFromPom(artifactResyncSource); }
private void ResyncArtifactsImpl( NPanday.Logging.Logger logger, ArtifactResyncSource artifactResyncSource) { EnsureInitialized(); GetReferencesFromPom(logger, artifactResyncSource); }
void GetReferencesFromPom(NPanday.Logging.Logger logger, ArtifactResyncSource artifactResyncSource) { Artifact.ArtifactRepository repository = new NPanday.Artifact.ArtifactContext().GetArtifactRepository(); NPanday.Model.Pom.Model m = NPanday.Utils.PomHelperUtility.ReadPomAsModel(new FileInfo(pomFile)); if (m.dependencies != null) { foreach (Dependency d in m.dependencies) { // check if intra-project reference and copy artifacts if (!IsIntraProject(m, d) && d.classifier == null) { Artifact.Artifact artifact = repository.GetArtifact(d); CopyArtifactImpl(artifact, logger, artifactResyncSource); } } } }
private void CopyArtifactImpl( Artifact.Artifact artifact, ArtifactResyncSource artifactResyncSource) { EnsureInitialized(); bool isSnapshot = ArtifactUtils.IsSnapshot(artifact); bool resyncFromRemoteRepo = artifactResyncSource == ArtifactResyncSource.RemoteRepository; if (!ArtifactUtils.Exists(artifact) || (isSnapshot && resyncFromRemoteRepo)) { if (!ArtifactUtils.DownloadFromRemoteRepository(artifact)) { RaiseError("Unable to get the artifact {0} from any of your repositories.", artifact.ArtifactId); return; } } CopyToReferenceFolder(artifact, referenceFolder); }
void GetReferencesFromPom(ArtifactResyncSource artifactResyncSource) { Artifact.ArtifactRepository repository = new NPanday.Artifact.ArtifactContext().GetArtifactRepository(); NPanday.Model.Pom.Model m = NPanday.Utils.PomHelperUtility.ReadPomAsModel(new FileInfo(pomFile)); if (m.dependencies != null) { foreach (Dependency d in m.dependencies) { // check if intra-project reference and copy artifacts if (!IsIntraProject(m, d) && d.classifier == null) { Artifact.Artifact artifact = repository.GetArtifact(d); CopyArtifactImpl(artifact, artifactResyncSource); } } } }