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" ) ); } } }
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" ) ); } } }
@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 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" ) ); } } }
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" ) ); } } }
@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("")); } } } }
@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 ); } } }