protected void mergeLicense_Url( License target, License 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 mergeLicense_Name( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getName(); if ( src != null ) { if ( sourceDominant || target.getName() == null ) { target.setName( src ); target.setLocation( "name", source.getLocation( "name" ) ); } } }
protected void mergeLicense_Distribution( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getDistribution(); if ( src != null ) { if ( sourceDominant || target.getDistribution() == null ) { target.setDistribution( src ); target.setLocation( "distribution", source.getLocation( "distribution" ) ); } } }
protected void mergeLicense_Comments( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getComments(); if ( src != null ) { if ( sourceDominant || target.getComments() == null ) { target.setComments( src ); target.setLocation( "comments", source.getLocation( "comments" ) ); } } }
@Override public void invoke(MavenProject mavenProject, Map<String, Object> models, ResultCollector resultCollector) { final List<License> licenses = mavenProject.getLicenses(); if (licenses.isEmpty()) { InputLocation location = mavenProject.getOriginalModel().getLocation("licences"); resultCollector.addViolation(mavenProject, this, "missing <licenses/> information", location == null ? getEmptyLocation(mavenProject) : location); } else { for (License license : licenses) { if (StringUtils.isEmpty(license.getName())) { resultCollector.addViolation(mavenProject, this, "missing <name> in <license/> information", license.getLocation("")); } if (StringUtils.isEmpty(license.getUrl())) { resultCollector.addViolation(mavenProject, this, "missing <url> in <license/> information", license.getLocation("")); } } } }
protected void mergeLicense_Name( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getName(); if ( src != null ) { if ( sourceDominant || target.getName() == null ) { target.setName( src ); target.setLocation( "name", source.getLocation( "name" ) ); } } }
protected void mergeLicense_Url( License target, License 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 mergeLicense_Distribution( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getDistribution(); if ( src != null ) { if ( sourceDominant || target.getDistribution() == null ) { target.setDistribution( src ); target.setLocation( "distribution", source.getLocation( "distribution" ) ); } } }
protected void mergeLicense_Comments( License target, License source, boolean sourceDominant, Map<Object, Object> context ) { String src = source.getComments(); if ( src != null ) { if ( sourceDominant || target.getComments() == null ) { target.setComments( src ); target.setLocation( "comments", source.getLocation( "comments" ) ); } } }