/** * Method writeIssueManagement. * * @param issueManagement * @param serializer * @param tagName * @throws java.io.IOException */ private void writeIssueManagement( IssueManagement issueManagement, String tagName, XmlSerializer serializer ) throws java.io.IOException { serializer.startTag( NAMESPACE, tagName ); if ( issueManagement.getSystem() != null ) { serializer.startTag( NAMESPACE, "system" ).text( issueManagement.getSystem() ).endTag( NAMESPACE, "system" ); } if ( issueManagement.getUrl() != null ) { serializer.startTag( NAMESPACE, "url" ).text( issueManagement.getUrl() ).endTag( NAMESPACE, "url" ); } serializer.endTag( NAMESPACE, tagName ); } //-- void writeIssueManagement( IssueManagement, String, XmlSerializer )
public static IssueManagement cloneIssueManagement( IssueManagement src ) { if ( src == null ) { return null; } IssueManagement result = new IssueManagement(); result.setSystem( src.getSystem() ); result.setUrl( src.getUrl() ); return result; }
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 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("")); } } } }
/** * 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()); }
public void actionPerformed(ActionEvent event) { IssueManagement im= ActionsUtil.readMavenProject(artifact).getIssueManagement(); try { URLDisplayer.getDefault().showURL(new URL(im.getUrl())); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } }
IssueManagement issueManagement = new IssueManagement(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) issueManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) ); issueManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
IssueManagement issueManagement = new IssueManagement(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); issueManagement.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) issueManagement.setLocation( "system", _location ); issueManagement.setSystem( interpolatedTrimmed( parser.nextText(), "system" ) ); issueManagement.setLocation( "url", _location ); issueManagement.setUrl( interpolatedTrimmed( parser.nextText(), "url" ) );
@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 ); } } }
private IssueManagement translateIssueManagement( org.apache.maven.model.v3_0_0.Model v3Model ) { IssueManagement issueMgmt = null; String issueTrackingUrl = v3Model.getIssueTrackingUrl(); if ( StringUtils.isNotEmpty( issueTrackingUrl ) ) { issueMgmt = new IssueManagement(); issueMgmt.setUrl( issueTrackingUrl ); } return issueMgmt; }
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(); 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" ) ); } } }
/** * 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()); }
public ViewBugTrackerAction(Artifact artifact) { this.artifact = artifact; putValue(Action.NAME, NbBundle.getMessage(ViewBugTrackerAction.class, "LBL_View_BugTracker")); MavenProject mp = ActionsUtil.readMavenProject(artifact); //enable only if url persent setEnabled(mp!=null && mp.getIssueManagement() != null&& mp.getIssueManagement().getUrl()!=null); } public void actionPerformed(ActionEvent event) {
IssueManagement issueManagement = new IssueManagement(); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) issueManagement.setSystem( getTrimmedValue( value ) ); issueManagement.setUrl( getTrimmedValue( value ) );
IssueManagement issueManagement = new IssueManagement(); InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); issueManagement.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) issueManagement.setLocation( "system", _location ); issueManagement.setSystem( getTrimmedValue( parser.nextText() ) ); issueManagement.setLocation( "url", _location ); issueManagement.setUrl( getTrimmedValue( parser.nextText() ) );
@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 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(); target.setIssueManagement( tgt ); } mergeIssueManagement( tgt, src, sourceDominant, context ); } }