CPD Results
The following document contains the results of PMD's CPD 6.55.0.
Duplications
File | Line |
---|---|
org\apache\maven\shared\release\phase\RewritePomsForBranchPhase.java | 63 |
org\apache\maven\shared\release\phase\RewritePomsForReleasePhase.java | 63 |
} @Override protected void transformScm( MavenProject project, Model modelTarget, ReleaseDescriptor releaseDescriptor, String projectId, ScmRepository scmRepository, ReleaseResult result) throws ReleaseExecutionException { // If SCM is null in original model, it is inherited, no mods needed if (project.getScm() != null) { Scm scmRoot = modelTarget.getScm(); if (scmRoot != null) { try { translateScm(project, releaseDescriptor, scmRoot, scmRepository, result); } catch (IOException e) { throw new ReleaseExecutionException(e.getMessage(), e); } } else { MavenProject parent = project.getParent(); if (parent != null) { // If the SCM element is not present, only add it if the parent was not mapped (ie, it's external to // the release process and so has not been modified, so the values will not be correct on the tag), String parentId = ArtifactUtils.versionlessKey(parent.getGroupId(), parent.getArtifactId()); if (!releaseDescriptor.hasOriginalScmInfo(parentId)) { |
File | Line |
---|---|
org\apache\maven\shared\release\phase\ScmBranchPhase.java | 75 |
org\apache\maven\shared\release\phase\ScmTagPhase.java | 86 |
logInfo(relResult, "Branching release with the label " + releaseDescriptor.getScmReleaseLabel() + "..."); ReleaseDescriptor basedirAlignedReleaseDescriptor = ReleaseUtil.createBasedirAlignedReleaseDescriptor(releaseDescriptor, reactorProjects); ScmRepository repository; ScmProvider provider; try { repository = scmRepositoryConfigurator.getConfiguredRepository( basedirAlignedReleaseDescriptor.getScmSourceUrl(), releaseDescriptor, releaseEnvironment.getSettings()); repository.getProviderRepository().setPushChanges(releaseDescriptor.isPushChanges()); repository.getProviderRepository().setWorkItem(releaseDescriptor.getWorkItem()); provider = scmRepositoryConfigurator.getRepositoryProvider(repository); } catch (ScmRepositoryException e) { throw new ReleaseScmRepositoryException(e.getMessage(), e.getValidationMessages()); } catch (NoSuchScmProviderException e) { throw new ReleaseExecutionException("Unable to configure SCM repository: " + e.getMessage(), e); } |
File | Line |
---|---|
org\apache\maven\shared\release\phase\RewritePomsForBranchPhase.java | 204 |
org\apache\maven\shared\release\phase\RewritePomsForReleasePhase.java | 201 |
String value = translator.resolveTag(branchName); if (value != null && !value.equals(scm.getTag())) { scmTarget.setTag(value); result = true; } } } else { String message = "No SCM translator found - skipping rewrite"; relResult.appendDebug(message); getLogger().debug(message); } return result; } @Override protected String getOriginalVersion(ReleaseDescriptor releaseDescriptor, String projectKey, boolean simulate) { return releaseDescriptor.getProjectOriginalVersion(projectKey); } @Override protected String getNextVersion(ReleaseDescriptor releaseDescriptor, String key) { return releaseDescriptor.getProjectReleaseVersion(key); } @Override protected String getResolvedSnapshotVersion(String artifactVersionlessKey, ReleaseDescriptor releaseDescriptor) { return releaseDescriptor.getDependencyReleaseVersion(artifactVersionlessKey); } } |
File | Line |
---|---|
org\apache\maven\shared\release\phase\RemoveScmTagPhase.java | 75 |
org\apache\maven\shared\release\phase\ScmBranchPhase.java | 75 |
org\apache\maven\shared\release\phase\ScmTagPhase.java | 86 |
logInfo(releaseResult, "Removing tag with the label " + releaseDescriptor.getScmReleaseLabel() + " ..."); ReleaseDescriptor basedirAlignedReleaseDescriptor = ReleaseUtil.createBasedirAlignedReleaseDescriptor(releaseDescriptor, reactorProjects); ScmRepository repository; ScmProvider provider; try { repository = scmRepositoryConfigurator.getConfiguredRepository( basedirAlignedReleaseDescriptor.getScmSourceUrl(), releaseDescriptor, releaseEnvironment.getSettings()); repository.getProviderRepository().setPushChanges(releaseDescriptor.isPushChanges()); repository.getProviderRepository().setWorkItem(releaseDescriptor.getWorkItem()); provider = scmRepositoryConfigurator.getRepositoryProvider(repository); } catch (ScmRepositoryException e) { throw new ReleaseScmRepositoryException(e.getMessage(), e.getValidationMessages()); } catch (NoSuchScmProviderException e) { throw new ReleaseExecutionException("Unable to configure SCM repository: " + e.getMessage(), e); } |
File | Line |
---|---|
org\apache\maven\shared\release\transform\jdom2\JDomBuild.java | 248 |
org\apache\maven\shared\release\transform\jdom2\JDomPluginManagement.java | 59 |
List<Element> pluginElms = pluginsElm.getChildren("plugin", build.getNamespace()); List<Plugin> plugins = new ArrayList<>(pluginElms.size()); for (Element pluginElm : pluginElms) { plugins.add(new JDomPlugin(pluginElm)); } return plugins; } } @Override public void removePlugin(Plugin plugin) { throw new UnsupportedOperationException(); } @Override public void setPlugins(List<Plugin> plugins) { throw new UnsupportedOperationException(); } @Override public void flushPluginMap() { throw new UnsupportedOperationException(); } @Override public Map<String, Plugin> getPluginsAsMap() { throw new UnsupportedOperationException(); } } |
File | Line |
---|---|
org\apache\maven\shared\release\phase\RewritePomsForBranchPhase.java | 98 |
org\apache\maven\shared\release\phase\RewritePomsForReleasePhase.java | 97 |
modelTarget.setScm(scmRoot); } } catch (IOException e) { throw new ReleaseExecutionException(e.getMessage(), e); } } } } } } private boolean translateScm( MavenProject project, ReleaseDescriptor releaseDescriptor, Scm scmTarget, ScmRepository scmRepository, ReleaseResult relResult) throws IOException { ScmTranslator translator = getScmTranslators().get(scmRepository.getProvider()); boolean result = false; if (translator != null) { Scm scm = project.getOriginalModel().getScm(); if (scm == null) { scm = project.getScm(); } String branchName = releaseDescriptor.getScmReleaseLabel(); |