private void injectMirror( ArtifactRepository repository, Mirror mirror ) { if ( mirror != null ) { ArtifactRepository original = createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), repository.getSnapshots(), repository.getReleases() ); repository.setMirroredRepositories( Collections.singletonList( original ) ); repository.setId( mirror.getId() ); repository.setUrl( mirror.getUrl() ); if ( StringUtils.isNotEmpty( mirror.getLayout() ) ) { repository.setLayout( getLayout( mirror.getLayout() ) ); } } }
private void injectMirror( ArtifactRepository repository, Mirror mirror ) { if ( mirror != null ) { ArtifactRepository original = createArtifactRepository( repository.getId(), repository.getUrl(), repository.getLayout(), repository.getSnapshots(), repository.getReleases() ); repository.setMirroredRepositories( Collections.singletonList( original ) ); repository.setId( mirror.getId() ); repository.setUrl( mirror.getUrl() ); if ( StringUtils.isNotEmpty( mirror.getLayout() ) ) { repository.setLayout( getLayout( mirror.getLayout() ) ); } } }
public void setUrl( String url ) { artifactRepository.setUrl( url ); } public String getBasedir()
public void setUrl( String url ) { artifactRepository.setUrl( url ); } public String getBasedir()
@PostConstruct public void init() { // setting the artifact version to a release version temporarily since the dist repository checks for a snapshot // version of the artifact. Maybe this can be implemented in a different manner but then we would have to setup the // repository manually org.apache.maven.artifact.Artifact projectArtifact = this.project.getArtifact(); String oldVersion = projectArtifact.getVersion(); projectArtifact.setVersion("1"); // replace properties in remote repository URL and getting the remote repo ArtifactRepository artifactRepository = this.project.getDistributionManagementArtifactRepository(); if (artifactRepository != null) { PomPropertyResolver propertyResolver = new PomPropertyResolver(this.project, this.settings, this.profiles, this.releaseArgs); artifactRepository.setUrl(propertyResolver.expandPropertyReferences(artifactRepository.getUrl())); this.deploymentRepository = RepositoryUtils.toRepo(artifactRepository); } // resetting the artifact version projectArtifact.setVersion(oldVersion); for (MavenProject p : this.reactorProjects) { // puts the initial module artifact coordinates into the cache addArtifactCoordinates(ProjectToCoordinates.POM.apply(p), ReleasePhase.PRE_RELEASE); // caching of SCM settings of every POM in order to go back to it before setting next dev version this.cachedScmSettings.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), p.getModel().getScm()); Optional<Document> parsedPOM = PomUtil.parsePOM(p); if (parsedPOM.isPresent()) { this.originalPOMs.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), parsedPOM.get()); } } }
@PostConstruct public void init() { // setting the artifact version to a release version temporarily since the dist repository checks for a snapshot // version of the artifact. Maybe this can be implemented in a different manner but then we would have to setup the // repository manually org.apache.maven.artifact.Artifact projectArtifact = this.project.getArtifact(); String oldVersion = projectArtifact.getVersion(); projectArtifact.setVersion("1"); // replace properties in remote repository URL and getting the remote repo ArtifactRepository artifactRepository = this.project.getDistributionManagementArtifactRepository(); if (artifactRepository != null) { PomPropertyResolver propertyResolver = new PomPropertyResolver(this.project, this.settings, this.profiles, this.releaseArgs); artifactRepository.setUrl(propertyResolver.expandPropertyReferences(artifactRepository.getUrl())); this.deploymentRepository = RepositoryUtils.toRepo(artifactRepository); } // resetting the artifact version projectArtifact.setVersion(oldVersion); for (MavenProject p : this.reactorProjects) { // puts the initial module artifact coordinates into the cache addArtifactCoordinates(ProjectToCoordinates.POM.apply(p), ReleasePhase.PRE_RELEASE); // caching of SCM settings of every POM in order to go back to it before setting next dev version this.cachedScmSettings.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), p.getModel().getScm()); Optional<Document> parsedPOM = PomUtil.parsePOM(p); if (parsedPOM.isPresent()) { this.originalPOMs.put(ProjectToCoordinates.EMPTY_VERSION.apply(p), parsedPOM.get()); } } }