protected void mergeModel_Scm( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { Scm src = source.getScm(); if ( src != null ) { Scm tgt = target.getScm(); if ( tgt == null ) { tgt = new Scm(); tgt.setTag( null ); target.setScm( tgt ); } mergeScm( tgt, src, sourceDominant, context ); } }
public static Scm cloneScm( Scm src ) { if ( src == null ) { return null; } Scm result = new Scm(); result.setConnection( src.getConnection() ); result.setDeveloperConnection( src.getDeveloperConnection() ); result.setTag( src.getTag() ); result.setUrl( src.getUrl() ); return result; }
private void assembleScmInheritance( Model child, Model parent, String childPathAdjustment, boolean appendPaths ) { if ( parent.getScm() != null ) { Scm parentScm = parent.getScm(); Scm childScm = child.getScm(); if ( childScm == null ) { childScm = new Scm(); child.setScm( childScm ); } if ( StringUtils.isEmpty( childScm.getConnection() ) && !StringUtils.isEmpty( parentScm.getConnection() ) ) { childScm.setConnection( appendPath( parentScm.getConnection(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) && !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) ) { childScm .setDeveloperConnection( appendPath( parentScm.getDeveloperConnection(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } if ( StringUtils.isEmpty( childScm.getUrl() ) && !StringUtils.isEmpty( parentScm.getUrl() ) ) { childScm.setUrl( appendPath( parentScm.getUrl(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } } }
private void assembleScmInheritance( Model child, Model parent, String childPathAdjustment, boolean appendPaths ) { if ( parent.getScm() != null ) { Scm parentScm = parent.getScm(); Scm childScm = child.getScm(); if ( childScm == null ) { childScm = new Scm(); child.setScm( childScm ); } if ( StringUtils.isEmpty( childScm.getConnection() ) && !StringUtils.isEmpty( parentScm.getConnection() ) ) { childScm.setConnection( appendPath( parentScm.getConnection(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } if ( StringUtils.isEmpty( childScm.getDeveloperConnection() ) && !StringUtils.isEmpty( parentScm.getDeveloperConnection() ) ) { childScm .setDeveloperConnection( appendPath( parentScm.getDeveloperConnection(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } if ( StringUtils.isEmpty( childScm.getUrl() ) && !StringUtils.isEmpty( parentScm.getUrl() ) ) { childScm.setUrl( appendPath( parentScm.getUrl(), child.getArtifactId(), childPathAdjustment, appendPaths ) ); } } }
Scm scm = new Scm(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
Scm scm = new Scm(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
Scm scm = new Scm(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
Scm scm = new Scm(); scm.setConnection(this.scm.getConnection()); scm.setDeveloperConnection(this.scm.getDeveloperConnection());
private void addScm() throws MojoExecutionException { Scm scm = new Scm(); String githubUser = wizard.promptForValueIfMissing(null, "your GitHub username"); String githubRepo = wizard.promptForValueIfMissing(null, "your GitHub repository"); scm.setConnection(String.format(SCM_TMPL_CONNECTION, githubUser, githubRepo)); scm.setDeveloperConnection(String.format(SCM_TMPL_DEV_CONNECTION, githubUser, githubRepo)); scm.setUrl(String.format(SCM_TMPL_URL, githubUser, githubRepo)); scm.setTag(SCM_TAG); mavenProject.setScm(scm); }
public Scm getTrimmedScm(Scm scm) { String trimmedDeveloperConnection = getTrimmedScmUrl(scm.getDeveloperConnection()); String trimmedConnection = getTrimmedScmUrl(scm.getConnection()); String trimmedUrl = scm.getUrl().trim(); Scm trimmedScm = new Scm(); trimmedScm.setDeveloperConnection(trimmedDeveloperConnection); trimmedScm.setConnection(trimmedConnection); trimmedScm.setUrl(trimmedUrl); return trimmedScm; }
protected void mergeModel_Scm( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { Scm src = source.getScm(); if ( src != null ) { Scm tgt = target.getScm(); if ( tgt == null ) { tgt = new Scm(); tgt.setTag( null ); target.setScm( tgt ); } mergeScm( tgt, src, sourceDominant, context ); } }
private Scm translateScm( org.apache.maven.model.v3_0_0.Model v3Model ) { Scm scm = null; org.apache.maven.model.v3_0_0.Repository repo = v3Model.getRepository(); if ( repo != null ) { scm = new Scm(); scm.setConnection( repo.getConnection() ); scm.setDeveloperConnection( repo.getDeveloperConnection() ); scm.setUrl( repo.getUrl() ); } return scm; }
Scm scmTarget = new Scm();
scmRoot = new Scm();
/** * * @param model */ private static void setScmDevUrl(Model model){ model.setScm(new Scm()); model.getScm().setConnection(Constants.OPEN_LIBERTY_SCM_CONNECTION); model.getScm().setDeveloperConnection(Constants.OPEN_LIBERTY_SCM_CONNECTION); model.getScm().setUrl(Constants.OPEN_LIBRETY_SCM_URL); model.getScm().setTag(Constants.OPEN_LIBERTY_SCM_TAG); model.setUrl(Constants.OPEN_LIBERTY_URL); Developer dev = new Developer(); dev.setId(Constants.DEV_ID); dev.setName(Constants.DEV_NAME); dev.setEmail(Constants.DEV_EMAIL); List<Developer> developers = new ArrayList<Developer>(); developers.add(dev); model.setDevelopers(developers); }
/** * For SONAR-3676 */ private static void convertMavenLinksToProperties(ProjectDefinition definition, MavenProject pom) { setPropertyIfNotAlreadyExists(definition, CoreProperties.LINKS_HOME_PAGE, pom.getUrl()); Scm scm = pom.getScm(); if (scm == null) { scm = new Scm(); } setPropertyIfNotAlreadyExists(definition, CoreProperties.LINKS_SOURCES, scm.getUrl()); setPropertyIfNotAlreadyExists(definition, CoreProperties.LINKS_SOURCES_DEV, scm.getDeveloperConnection()); CiManagement ci = pom.getCiManagement(); if (ci == null) { ci = new CiManagement(); } setPropertyIfNotAlreadyExists(definition, CoreProperties.LINKS_CI, ci.getUrl()); IssueManagement issues = pom.getIssueManagement(); if (issues == null) { issues = new IssueManagement(); } setPropertyIfNotAlreadyExists(definition, CoreProperties.LINKS_ISSUE_TRACKER, issues.getUrl()); }
/** * For SONAR-3676 */ private static void convertMavenLinksToProperties(Map<String, String> props, MavenProject pom) { setPropertyIfNotAlreadyExists(props, LINKS_HOME_PAGE, pom.getUrl()); Scm scm = pom.getScm(); if (scm == null) { scm = new Scm(); } setPropertyIfNotAlreadyExists(props, LINKS_SOURCES, scm.getUrl()); setPropertyIfNotAlreadyExists(props, LINKS_SOURCES_DEV, scm.getDeveloperConnection()); CiManagement ci = pom.getCiManagement(); if (ci == null) { ci = new CiManagement(); } setPropertyIfNotAlreadyExists(props, LINKS_CI, ci.getUrl()); IssueManagement issues = pom.getIssueManagement(); if (issues == null) { issues = new IssueManagement(); } setPropertyIfNotAlreadyExists(props, LINKS_ISSUE_TRACKER, issues.getUrl()); }
Scm scm = new Scm(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
protected Scm buildScm( MavenProject project ) { Scm scm; if ( project.getOriginalModel().getScm() == null ) { scm = null; } else { scm = new Scm(); scm.setConnection( project.getOriginalModel().getScm().getConnection() ); scm.setDeveloperConnection( project.getOriginalModel().getScm().getDeveloperConnection() ); scm.setTag( project.getOriginalModel().getScm().getTag() ); scm.setUrl( project.getOriginalModel().getScm().getUrl() ); } return scm; } }
private Scm createReleaseScm( Scm scm, ScmTranslator scmTranslator, ReleaseDescriptor releaseDescriptor ) { // TODO: share with RewritePomsForReleasePhase.translateScm String tag = releaseDescriptor.getScmReleaseLabel(); String tagBase = releaseDescriptor.getScmTagBase(); Scm releaseScm = new Scm(); if ( scm.getConnection() != null ) { String value = scmTranslator.translateTagUrl( scm.getConnection(), tag, tagBase ); releaseScm.setConnection( value ); } if ( scm.getDeveloperConnection() != null ) { String value = scmTranslator.translateTagUrl( scm.getDeveloperConnection(), tag, tagBase ); releaseScm.setDeveloperConnection( value ); } if ( scm.getUrl() != null ) { String value = scmTranslator.translateTagUrl( scm.getUrl(), tag, tagBase ); releaseScm.setUrl( value ); } if ( scm.getTag() != null ) { String value = scmTranslator.resolveTag( scm.getTag() ); releaseScm.setTag( value ); } return releaseScm; }