if ( ciManagement.getSystem() != null ) serializer.startTag( NAMESPACE, "system" ).text( ciManagement.getSystem() ).endTag( NAMESPACE, "system" ); if ( ciManagement.getUrl() != null ) serializer.startTag( NAMESPACE, "url" ).text( ciManagement.getUrl() ).endTag( NAMESPACE, "url" ); if ( ( ciManagement.getNotifiers() != null ) && ( ciManagement.getNotifiers().size() > 0 ) ) for ( Iterator iter = ciManagement.getNotifiers().iterator(); iter.hasNext(); )
public static CiManagement cloneCiManagement( CiManagement src ) { if ( src == null ) { return null; } CiManagement result = new CiManagement(); List notifiers = null; if ( src.getNotifiers() != null ) { notifiers = new ArrayList( src.getNotifiers().size() ); for ( Iterator it = src.getNotifiers().iterator(); it.hasNext(); ) { notifiers.add( cloneNotifier( (Notifier) it.next() ) ); } } result.setNotifiers( cloneList( src.getNotifiers(), NOTIFIER_CLONER ) ); result.setSystem( src.getSystem() ); result.setUrl( src.getUrl() ); return result; }
protected void mergeCiManagement_System( CiManagement target, CiManagement source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getSystem(); if ( src != null ) { if ( sourceDominant || target.getSystem() == null ) { target.setSystem( src ); target.setLocation( "system", source.getLocation( "system" ) ); } } }
protected void mergeCiManagement_Url( CiManagement target, CiManagement source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getUrl(); if ( src != null ) { if ( sourceDominant || target.getUrl() == null ) { target.setUrl( src ); target.setLocation( "url", source.getLocation( "url" ) ); } } }
private org.apache.archiva.metadata.model.CiManagement convertCiManagement( CiManagement ciManagement ) { org.apache.archiva.metadata.model.CiManagement ci = null; if ( ciManagement != null ) { ci = new org.apache.archiva.metadata.model.CiManagement(); ci.setSystem( ciManagement.getSystem() ); ci.setUrl( ciManagement.getUrl() ); } return ci; }
CiManagement ciManagement = new CiManagement(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) ciManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) ); ciManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) ); ciManagement.setNotifiers( notifiers ); while ( parser.nextTag() == XmlPullParser.START_TAG )
if ((ciMgmt != null) && (ciMgmt.getSystem()==null || ciMgmt.getSystem().equals("hudson"))) { Notifier mailNotifier = null; for (Notifier n : (List<Notifier>)ciMgmt.getNotifiers()) { if (n.getType().equals("mail")) { mailNotifier = n;
/** * Method removeNotifier. * * @param notifier */ public void removeNotifier( Notifier notifier ) { getNotifiers().remove( notifier ); } //-- void removeNotifier( Notifier )
@Override public void invoke(MavenProject mavenProject, Map<String, Object> models, ResultCollector resultCollector) { CiManagement management = mavenProject.getCiManagement(); if (null == management) { final InputSource source = new InputSource(); source.setLocation(mavenProject.getOriginalModel().getPomFile() + ""); InputLocation location = new InputLocation(0, 0, source); resultCollector.addViolation(mavenProject, this, "missing <ciManagement/> section", location); } else { if (StringUtils.isEmpty(management.getSystem())) { resultCollector.addViolation(mavenProject, this, "missing <system/> entry in <ciManagement/> section", management.getLocation("")); } if (StringUtils.isEmpty(management.getUrl())) { resultCollector.addViolation(mavenProject, this, "missing <url/> entry in <ciManagement/> section", management.getLocation("")); } } } }
/** * 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()); }
protected void mergeCiManagement_Notifiers( CiManagement target, CiManagement source, boolean sourceDominant, Map<Object, Object> context ) { List<Notifier> src = source.getNotifiers(); if ( !src.isEmpty() ) { List<Notifier> tgt = target.getNotifiers(); Map<Object, Notifier> merged = new LinkedHashMap<>( ( src.size() + tgt.size() ) * 2 ); for ( Notifier element : tgt ) { Object key = getNotifierKey( element ); merged.put( key, element ); } for ( Notifier element : src ) { Object key = getNotifierKey( element ); if ( sourceDominant || !merged.containsKey( key ) ) { merged.put( key, element ); } } target.setNotifiers( new ArrayList<>( merged.values() ) ); } }
@Override protected void mergeModel_CiManagement( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { CiManagement src = source.getCiManagement(); if ( src != null ) { CiManagement tgt = target.getCiManagement(); if ( tgt == null ) { tgt = new CiManagement(); tgt.setLocation( "", src.getLocation( "" ) ); target.setCiManagement( tgt ); mergeCiManagement( tgt, src, sourceDominant, context ); } } }
protected void mergeModel_CiManagement( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { CiManagement src = source.getCiManagement(); if ( src != null ) { CiManagement tgt = target.getCiManagement(); if ( tgt == null ) { tgt = new CiManagement(); target.setCiManagement( tgt ); } mergeCiManagement( tgt, src, sourceDominant, context ); } }
private CiManagement translateCiManagementInfo( org.apache.maven.model.v3_0_0.Build v3Build ) { CiManagement ciMgmt = null; if ( v3Build != null ) { String nagEmailAddress = v3Build.getNagEmailAddress(); if ( StringUtils.isNotEmpty( nagEmailAddress ) ) { Notifier notifier = new Notifier(); notifier.setType( "mail" ); notifier.addConfiguration( "address", nagEmailAddress ); ciMgmt = new CiManagement(); ciMgmt.addNotifier( notifier ); } } return ciMgmt; }
private org.apache.archiva.metadata.model.CiManagement convertCiManagement( CiManagement ciManagement ) { org.apache.archiva.metadata.model.CiManagement ci = null; if ( ciManagement != null ) { ci = new org.apache.archiva.metadata.model.CiManagement(); ci.setSystem( ciManagement.getSystem() ); ci.setUrl( ciManagement.getUrl() ); } return ci; }
CiManagement ciManagement = new CiManagement(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); ciManagement.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) ciManagement.setLocation( "system", _location ); ciManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) ); ciManagement.setLocation( "url", _location ); ciManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) ); ciManagement.setNotifiers( notifiers ); while ( parser.nextTag() == XmlPullParser.START_TAG )
if ((ciMgmt != null) && (ciMgmt.getSystem()==null || ciMgmt.getSystem().equals("hudson"))) { Notifier mailNotifier = null; for (Notifier n : ciMgmt.getNotifiers()) { if (n.getType().equals("mail")) { mailNotifier = n;
/** * Method addNotifier. * * @param notifier */ public void addNotifier( Notifier notifier ) { getNotifiers().add( notifier ); } //-- void addNotifier( Notifier )
protected void mergeCiManagement_Url( CiManagement target, CiManagement source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getUrl(); if ( src != null ) { if ( sourceDominant || target.getUrl() == null ) { target.setUrl( src ); target.setLocation( "url", source.getLocation( "url" ) ); } } }
/** * 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()); }