private Relocation getRelocation( Model model ) { Relocation relocation = null; DistributionManagement distMgmt = model.getDistributionManagement(); if ( distMgmt != null ) { relocation = distMgmt.getRelocation(); } return relocation; }
if ( pDistMgmt.getRelocation() != null ) mDistMgmt.setRelocation( pDistMgmt.getRelocation() );
if ( distMgmt != null ) relocation = distMgmt.getRelocation();
if ( distributionManagement.getRelocation() != null ) writeRelocation( (Relocation) distributionManagement.getRelocation(), "relocation", serializer );
if ( distMgmt != null ) relocation = distMgmt.getRelocation();
public static DistributionManagement cloneDistributionManagement( DistributionManagement src ) { if ( src == null ) { return null; } DistributionManagement result = new DistributionManagement(); result.setDownloadUrl( src.getDownloadUrl() ); result.setRelocation( cloneRelocation( src.getRelocation() ) ); result.setRepository( cloneDeploymentRepository( src.getRepository() ) ); result.setSite( cloneSite( src.getSite() ) ); result.setSnapshotRepository( cloneDeploymentRepository( src.getSnapshotRepository() ) ); result.setStatus( src.getStatus() ); return result; }
if ( distributionManagement.getRelocation() != null ) writeRelocation( (Relocation) distributionManagement.getRelocation(), "relocation", serializer );
private Relocation getRelocation( Model model ) { Relocation relocation = null; DistributionManagement distMngt = model.getDistributionManagement(); if ( distMngt != null ) { relocation = distMngt.getRelocation(); } return relocation; }
private Relocation getRelocation( final Model model ) { Relocation relocation = null; final DistributionManagement distMngt = model.getDistributionManagement(); if ( distMngt != null ) { relocation = distMngt.getRelocation(); } return relocation; }
private Relocation getRelocation( Model model ) { Relocation relocation = null; DistributionManagement distMngt = model.getDistributionManagement(); if ( distMngt != null ) { relocation = distMngt.getRelocation(); } return relocation; }
private Relocation getRelocation( Model model ) { Relocation relocation = null; DistributionManagement distMngt = model.getDistributionManagement(); if ( distMngt != null ) { relocation = distMngt.getRelocation(); } return relocation; }
private Relocation getRelocation( Model model ) { Relocation relocation = null; DistributionManagement distMgmt = model.getDistributionManagement(); if ( distMgmt != null ) { relocation = distMgmt.getRelocation(); } return relocation; }
private ArtifactRevisionIdentifier applyRelocation(ArtifactRevisionIdentifier id, MavenProject mavenProject) { if (mavenProject.getDistributionManagement() != null) { Relocation relocation = mavenProject.getDistributionManagement().getRelocation(); if (relocation != null) { String groupId = relocation.getGroupId() != null ? relocation.getGroupId() : id.getGroupId(); String artifactId = relocation.getArtifactId() != null ? relocation.getArtifactId() : id.getArtifactId(); String version = relocation.getVersion() != null ? relocation.getVersion() : id.getVersion(); return new ArtifactRevisionIdentifier(artifactId, groupId, version, id.getClassifier()); } } return id; }
/** * Method updateDistributionManagement. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement(DistributionManagement value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); updateDeploymentRepository( value.getRepository(), "repository", innerCount, root); updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root); updateSite( value.getSite(), "site", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "downloadUrl", value.getDownloadUrl(), null); updateRelocation( value.getRelocation(), "relocation", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "status", value.getStatus(), null); } } //-- void updateDistributionManagement(DistributionManagement, String, Counter, Element)
/** * Method updateDistributionManagement * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement( DistributionManagement value, String xmlTag, Counter counter, Element element ) { boolean shouldExist = value != null; Element root = updateElement( counter, element, xmlTag, shouldExist ); if ( shouldExist ) { Counter innerCount = new Counter( counter.getDepth() + 1 ); updateDeploymentRepository( value.getRepository(), "repository", innerCount, root ); updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root ); updateSite( value.getSite(), "site", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "downloadUrl", value.getDownloadUrl(), null ); updateRelocation( value.getRelocation(), "relocation", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "status", value.getStatus(), null ); } } // -- void updateDistributionManagement(DistributionManagement, String, Counter, Element)
/** * Method updateDistributionManagement. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement(DistributionManagement value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); updateDeploymentRepository(value.getRepository(), "repository", innerCount, root); updateDeploymentRepository(value.getSnapshotRepository(), "snapshotRepository", innerCount, root); updateSite(value.getSite(), "site", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "downloadUrl", value.getDownloadUrl(), null); updateRelocation(value.getRelocation(), "relocation", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "status", value.getStatus(), null); } } // -- void updateDistributionManagement(DistributionManagement, String, // Counter, Element)
/** * Method updateDistributionManagement. * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement( DistributionManagement value, String xmlTag, Counter counter, Element element ) { boolean shouldExist = value != null; Element root = updateElement( counter, element, xmlTag, shouldExist ); if ( shouldExist ) { Counter innerCount = new Counter( counter.getDepth() + 1 ); updateDeploymentRepository( value.getRepository(), "repository", innerCount, root ); updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root ); updateSite( value.getSite(), "site", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "downloadUrl", value.getDownloadUrl(), null ); updateRelocation( value.getRelocation(), "relocation", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "status", value.getStatus(), null ); } } // -- void updateDistributionManagement(DistributionManagement, String, Counter, Element)
/** * Method updateDistributionManagement * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement(DistributionManagement value, String xmlTag, Counter counter, Element element) { boolean shouldExist = value != null; Element root = updateElement(counter, element, xmlTag, shouldExist); if (shouldExist) { Counter innerCount = new Counter(counter.getDepth() + 1); updateDeploymentRepository( value.getRepository(), "repository", innerCount, root); updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root); updateSite( value.getSite(), "site", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "downloadUrl", value.getDownloadUrl(), null); updateRelocation( value.getRelocation(), "relocation", innerCount, root); findAndReplaceSimpleElement(innerCount, root, "status", value.getStatus(), null); } } //-- void updateDistributionManagement(DistributionManagement, String, Counter, Element)
/** * Method updateDistributionManagement * * @param value * @param element * @param counter * @param xmlTag */ protected void updateDistributionManagement( DistributionManagement value, String xmlTag, Counter counter, Element element ) { boolean shouldExist = value != null; Element root = updateElement( counter, element, xmlTag, shouldExist ); if ( shouldExist ) { Counter innerCount = new Counter( counter.getDepth() + 1 ); updateDeploymentRepository( value.getRepository(), "repository", innerCount, root ); updateDeploymentRepository( value.getSnapshotRepository(), "snapshotRepository", innerCount, root ); updateSite( value.getSite(), "site", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "downloadUrl", value.getDownloadUrl(), null ); updateRelocation( value.getRelocation(), "relocation", innerCount, root ); findAndReplaceSimpleElement( innerCount, root, "status", value.getStatus(), null ); } } // -- void updateDistributionManagement(DistributionManagement, String, Counter, Element)
private boolean relocateIfNeeded(final MavenArtifact mart){ Model model = mart.getPom(); if (model.getDistributionManagement() != null) { final Relocation relocation = model.getDistributionManagement() .getRelocation(); if (relocation != null) { String newGroupId = relocation.getGroupId() == null ? mart.getCoordinates().getGroupId() : relocation.getGroupId(); String newArtifactId = relocation.getArtifactId() == null ? mart.getCoordinates().getArtifactId() : relocation.getArtifactId(); String newVersion = relocation.getVersion() == null ? mart.getCoordinates().getVersion() : relocation.getVersion(); Dependency dep = new Dependency(); dep.setArtifactId(newArtifactId); dep.setGroupId(newGroupId); dep.setVersion(newVersion); dep.setType(model.getPackaging()); model.getDependencies().clear(); model.addDependency(dep); model.setPackaging("pom"); return true; } } return false; }