protected void mergeIssueManagement_Url( IssueManagement target, IssueManagement 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 mergeIssueManagement_System( IssueManagement target, IssueManagement 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_IssueManagement( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { IssueManagement src = source.getIssueManagement(); if ( src != null ) { IssueManagement tgt = target.getIssueManagement(); if ( tgt == null ) { tgt = new IssueManagement(); tgt.setLocation( "", src.getLocation( "" ) ); target.setIssueManagement( tgt ); mergeIssueManagement( tgt, src, sourceDominant, context ); } } }
protected void mergeIssueManagement_System( IssueManagement target, IssueManagement 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 mergeIssueManagement_Url( IssueManagement target, IssueManagement 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" ) ); } } }
@Override public void invoke(MavenProject mavenProject, Map<String, Object> models, ResultCollector resultCollector) { IssueManagement management = mavenProject.getIssueManagement(); 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 <issueManagement/> section", location); } else { if (StringUtils.isEmpty(management.getSystem())) { resultCollector.addViolation(mavenProject, this, "missing <system/> entry in <issueManagement/> section", management.getLocation("")); } if (StringUtils.isEmpty(management.getUrl())) { resultCollector.addViolation(mavenProject, this, "missing <url/> entry in <issueManagement/> section", management.getLocation("")); } } } }
@Override protected void mergeModel_IssueManagement( Model target, Model source, boolean sourceDominant, Map<Object, Object> context ) { IssueManagement src = source.getIssueManagement(); if ( src != null ) { IssueManagement tgt = target.getIssueManagement(); if ( tgt == null ) { tgt = new IssueManagement(); tgt.setLocation( "", src.getLocation( "" ) ); target.setIssueManagement( tgt ); mergeIssueManagement( tgt, src, sourceDominant, context ); } } }