Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/github/GitHubMojo.java Tue Jun 16 19:29:09 2015 @@ -38,8 +38,7 @@ import java.util.Map; import java.util.ResourceBundle; /** - * Goal which downloads issues from GitHub and generates a - * report. + * Goal which downloads issues from GitHub and generates a report. * * @author Bryan Baugher * @since 2.8 @@ -52,31 +51,27 @@ public class GitHubMojo /** * Valid Github columns. */ - @SuppressWarnings( "checkstyle:staticvariablename" ) - private static Map<String, Integer> GITHUB_COLUMNS = new HashMap<String, Integer>(); + private static Map<String, Integer> githubColumns = new HashMap<String, Integer>(); static { - GITHUB_COLUMNS.put( "Assignee", IssuesReportHelper.COLUMN_ASSIGNEE ); - GITHUB_COLUMNS.put( "Created", IssuesReportHelper.COLUMN_CREATED ); - GITHUB_COLUMNS.put( "Fix Version", IssuesReportHelper.COLUMN_FIX_VERSION ); - GITHUB_COLUMNS.put( "Id", IssuesReportHelper.COLUMN_ID ); - GITHUB_COLUMNS.put( "Reporter", IssuesReportHelper.COLUMN_REPORTER ); - GITHUB_COLUMNS.put( "Status", IssuesReportHelper.COLUMN_STATUS ); - GITHUB_COLUMNS.put( "Summary", IssuesReportHelper.COLUMN_SUMMARY ); - GITHUB_COLUMNS.put( "Type", IssuesReportHelper.COLUMN_TYPE ); - GITHUB_COLUMNS.put( "Updated", IssuesReportHelper.COLUMN_UPDATED ); + githubColumns.put( "Assignee", IssuesReportHelper.COLUMN_ASSIGNEE ); + githubColumns.put( "Created", IssuesReportHelper.COLUMN_CREATED ); + githubColumns.put( "Fix Version", IssuesReportHelper.COLUMN_FIX_VERSION ); + githubColumns.put( "Id", IssuesReportHelper.COLUMN_ID ); + githubColumns.put( "Reporter", IssuesReportHelper.COLUMN_REPORTER ); + githubColumns.put( "Status", IssuesReportHelper.COLUMN_STATUS ); + githubColumns.put( "Summary", IssuesReportHelper.COLUMN_SUMMARY ); + githubColumns.put( "Type", IssuesReportHelper.COLUMN_TYPE ); + githubColumns.put( "Updated", IssuesReportHelper.COLUMN_UPDATED ); } /** - * Sets the column names that you want to show in the report. The columns - * will appear in the report in the same order as you specify them here. - * Multiple values can be separated by commas. + * Sets the column names that you want to show in the report. The columns will appear in the report in the same + * order as you specify them here. Multiple values can be separated by commas. * <p> - * Valid columns are: <code>Assignee</code>, <code>Created</code>, - * <code>Fix Version</code>, <code>Id</code>, <code>Reporter</code>, - * <code>Status</code>, <code>Summary</code>, <code>Type</code> and - * <code>Updated</code>. + * Valid columns are: <code>Assignee</code>, <code>Created</code>, <code>Fix Version</code>, <code>Id</code>, + * <code>Reporter</code>, <code>Status</code>, <code>Summary</code>, <code>Type</code> and <code>Updated</code>. * </p> */ @Parameter( defaultValue = "Id,Type,Summary,Assignee,Reporter,Status,Created,Updated,Fix Version" ) @@ -120,9 +115,8 @@ public class GitHubMojo private boolean onlyMilestoneIssues; /** - * If you only want to show issues for the current version in the report. - * The current version being used is <code>${project.version}</code> minus - * any "-SNAPSHOT" suffix. + * If you only want to show issues for the current version in the report. The current version being used is + * <code>${project.version}</code> minus any "-SNAPSHOT" suffix. */ @Parameter( defaultValue = "false" ) private boolean onlyCurrentVersion; @@ -143,7 +137,7 @@ public class GitHubMojo } /* --------------------------------------------------------------------- */ - /* Public methods */ + /* Public methods */ /* --------------------------------------------------------------------- */ /** @@ -166,12 +160,12 @@ public class GitHubMojo { // Validate parameters - List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, GITHUB_COLUMNS ); + List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, githubColumns ); if ( columnIds.size() == 0 ) { // This can happen if the user has configured column names and they are all invalid - throw new MavenReportException( - "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." ); + throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames + + "' are valid." ); } try @@ -215,7 +209,7 @@ public class GitHubMojo } /* --------------------------------------------------------------------- */ - /* Private methods */ + /* Private methods */ /* --------------------------------------------------------------------- */ private ResourceBundle getBundle( Locale locale )
Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/AbstractIssueManagementSystem.java Tue Jun 16 19:29:09 2015 @@ -31,9 +31,8 @@ import org.apache.maven.plugin.changes.I * modularity for support of multiple systems.<br> * Initially, all it provides is a structure for mapping from per-IMS issue types to the three categories defined in * {@link org.apache.maven.plugin.changes.IssueAdapter}. <br/> - * Note that the map in here is <strong>not</strong> immutable. It contains the default - * configuration for an IMS. Users are expected to add entries to the map via configuration - * to reflect their customizations. + * Note that the map in here is <strong>not</strong> immutable. It contains the default configuration for an IMS. Users + * are expected to add entries to the map via configuration to reflect their customizations. * * @version $Id$ */ @@ -47,20 +46,23 @@ public abstract class AbstractIssueManag issueTypeMap = new HashMap<String, IssueType>(); } - /* (non-Javadoc) + /* + * (non-Javadoc) * @see org.apache.maven.plugin.issues.IssueManagementSystem#getIssueTypeMap() */ public Map<String, IssueType> getIssueTypeMap() { return issueTypeMap; } - - /* (non-Javadoc) + + /* + * (non-Javadoc) * @see org.apache.maven.plugin.issues.IssueManagementSystem#getName() */ public abstract String getName(); - /* (non-Javadoc) + /* + * (non-Javadoc) * @see org.apache.maven.plugin.issues.IssueManagementSystem#applyConfiguration(java.util.Map) */ public void applyConfiguration( Map<String, String> issueTypes ) @@ -75,7 +77,7 @@ public abstract class AbstractIssueManag } String imsTypes = me.getValue(); String[] imsTypeArray = imsTypes.split( "," ); - for ( String imsType : imsTypeArray ) + for ( String imsType : imsTypeArray ) { issueTypeMap.put( imsType, type ); } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/Issue.java Tue Jun 16 19:29:09 2015 @@ -254,10 +254,7 @@ public class Issue public String toString() { - return this.getClass().getSimpleName() - + "[id='" + this.getId() + "'" - + ", title='" + this.getTitle() + "'" - + ", fixVersions='" + this.getFixVersions() + "'" - + "]"; + return this.getClass().getSimpleName() + "[id='" + this.getId() + "'" + ", title='" + this.getTitle() + "'" + + ", fixVersions='" + this.getFixVersions() + "'" + "]"; } } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueManagementSystem.java Tue Jun 16 19:29:09 2015 @@ -53,7 +53,7 @@ public interface IssueManagementSystem * Configure this issue management system. * * @param issueTypes The mapping of issue types used in this issue management system to the ones used in a - * changes.xml file + * changes.xml file * @throws MojoExecutionException If the configuration fails */ void applyConfiguration( Map<String, String> issueTypes ) Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssueUtils.java Tue Jun 16 19:29:09 2015 @@ -41,8 +41,7 @@ public class IssueUtils * @param issues A list of issues * @param prefix The prefix of the "Fix Version" that should match * @return A <code>List</code> of issues fixed in versions that match the supplied prefix - * @throws org.apache.maven.plugin.MojoExecutionException - * If no issues could be found for the supplied prefix + * @throws org.apache.maven.plugin.MojoExecutionException If no issues could be found for the supplied prefix */ public static List<Issue> filterIssuesWithVersionPrefix( List<Issue> issues, String prefix ) throws MojoExecutionException @@ -78,16 +77,14 @@ public class IssueUtils } /** - * Find the issues for only the supplied version, by matching the "Fix for" - * version in the supplied list of issues with the supplied version. - * If the supplied version is a SNAPSHOT, then that part of the version - * will be removed prior to the matching. + * Find the issues for only the supplied version, by matching the "Fix for" version in the supplied list of issues + * with the supplied version. If the supplied version is a SNAPSHOT, then that part of the version will be removed + * prior to the matching. * * @param issues A list of issues * @param version The version that issues should be returned for * @return A <code>List</code> of issues for the supplied version - * @throws org.apache.maven.plugin.MojoExecutionException - * If no issues could be found for the supplied version + * @throws org.apache.maven.plugin.MojoExecutionException If no issues could be found for the supplied version */ public static List<Issue> getIssuesForVersion( List<Issue> issues, String version ) throws MojoExecutionException Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportGenerator.java Tue Jun 16 19:29:09 2015 @@ -34,7 +34,8 @@ import java.util.ResourceBundle; * @version $Id$ * @since 2.4 */ -public class IssuesReportGenerator extends AbstractIssuesReportGenerator +public class IssuesReportGenerator + extends AbstractIssuesReportGenerator { /** * Fallback value that is used if date field are not available. @@ -42,8 +43,7 @@ public class IssuesReportGenerator exten private static final String NOT_AVAILABLE = "n/a"; /** - * Holds the id:s for the columns to include in the report, in the order - * that they should appear in the report. + * Holds the id:s for the columns to include in the report, in the order that they should appear in the report. */ private int[] columns; @@ -68,7 +68,7 @@ public class IssuesReportGenerator exten sinkEndReport( sink ); } - public void doGenerateReport( ResourceBundle bundle, Sink sink, List issueList ) + public void doGenerateReport( ResourceBundle bundle, Sink sink, List<Issue> issueList ) { sinkBeginReport( sink, bundle ); @@ -82,7 +82,7 @@ public class IssuesReportGenerator exten sinkEndReport( sink ); } - private void constructHeaderRow( Sink sink, List issueList, ResourceBundle bundle ) + private void constructHeaderRow( Sink sink, List<Issue> issueList, ResourceBundle bundle ) { if ( issueList == null ) { @@ -162,20 +162,18 @@ public class IssuesReportGenerator exten sink.tableRow_(); } - private void constructDetailRows( Sink sink, List issueList, ResourceBundle bundle, Locale locale ) + private void constructDetailRows( Sink sink, List<Issue> issueList, ResourceBundle bundle, Locale locale ) { if ( issueList == null ) { return; } - for ( Object anIssueList : issueList ) + for ( Issue issue : issueList ) { // Use a DateFormat based on the Locale DateFormat df = DateFormat.getDateInstance( DateFormat.SHORT, locale ); - Issue issue = (Issue) anIssueList; - sink.tableRow(); for ( int column : columns ) Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/issues/IssuesReportHelper.java Tue Jun 16 19:29:09 2015 @@ -77,10 +77,9 @@ public class IssuesReportHelper } /** - * Get a list of id:s for the columns that are to be included in the report. - * This method also handles deprecated column names, which will still work. - * If deprecated column names are used they generate a warning, indicating - * the replacement column name. + * Get a list of id:s for the columns that are to be included in the report. This method also handles deprecated + * column names, which will still work. If deprecated column names are used they generate a warning, indicating the + * replacement column name. * * @param columnNames The names of the columns * @param allColumns A mapping from column name to column id @@ -115,7 +114,7 @@ public class IssuesReportHelper if ( log != null ) { log.warn( "The columnName '" + columnName + "' has been deprecated." + " Please use " - + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." ); + + "the columnName '" + bidiColumns.getKey( columnId ) + "' instead." ); } } } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AbstractJiraDownloader.java Tue Jun 16 19:29:09 2015 @@ -34,8 +34,8 @@ import java.net.URL; import java.util.List; /** - * Abstract API, more or less, to retrieving issue information from JIRA. - * Intended to have subclasses for the old (RSS) and new (REST) ways of doing things. + * Abstract API, more or less, to retrieving issue information from JIRA. Intended to have subclasses for the old (RSS) + * and new (REST) ways of doing things. * * @author mfran...@xebia.com * @author jr...@exist.com @@ -47,53 +47,80 @@ public abstract class AbstractJiraDownlo /** Log for debug output. */ protected Log log; + /** Output file for xml document. */ protected File output; + /** The maximum number of entries to show. */ protected int nbEntriesMax; + /** The filter to apply to query to JIRA. */ protected String filter; + /** Ids of fix versions to show, as comma separated string. */ protected String fixVersionIds; + /** Ids of status to show, as comma separated string. */ protected String statusIds; + /** Ids of resolution to show, as comma separated string. */ protected String resolutionIds; + /** Ids of priority to show, as comma separated string. */ protected String priorityIds; + /** The component to show. */ protected String component; + /** Ids of types to show, as comma separated string. */ protected String typeIds; + /** Column names to sort by, as comma separated string. */ protected String sortColumnNames; + /** The username to log into JIRA. */ protected String jiraUser; + /** The password to log into JIRA. */ protected String jiraPassword; + /** The username to log into webserver. */ protected String webUser; + /** The password to log into webserver. */ protected String webPassword; + /** The maven project. */ protected MavenProject project; + /** The maven settings. */ protected Settings settings; - /** Use JQL, JIRA query language, instead of URL parameter based queries. - * Note that this is down here to make it easier for the mojo to deal with - * both new and old flavors. */ + + /** + * Use JQL, JIRA query language, instead of URL parameter based queries. Note that this is down here to make it + * easier for the mojo to deal with both new and old flavors. + */ protected boolean useJql; + /** Filter the JIRA query based on the current version */ protected boolean onlyCurrentVersion; + /** The versionPrefix to apply to the POM version */ protected String versionPrefix; + /** The pattern used to parse dates from the JIRA xml file. */ protected String jiraDatePattern; + protected String proxyHost; + protected int proxyPort; + protected String proxyUser; + protected String proxyPass; + protected int connectionTimeout; + protected int receiveTimout; /** @@ -101,8 +128,8 @@ public abstract class AbstractJiraDownlo * * @throws Exception on error */ - public abstract void doExecute() throws Exception; - + public abstract void doExecute() + throws Exception; /** * Check to see if we think that JIRA authentication is needed. @@ -114,7 +141,6 @@ public abstract class AbstractJiraDownlo return ( jiraUser != null ) && ( jiraUser.length() > 0 ) && ( jiraPassword != null ); } - protected void getProxyInfo( String jiraUrl ) { // see whether there is any proxy defined in maven @@ -157,7 +183,7 @@ public abstract class AbstractJiraDownlo // Validation of proxy method copied from org.apache.maven.wagon.proxy.ProxyUtils. // @todo Can use original when maven-changes-plugin requires a more recent version of Maven - //if ( ProxyUtils.validateNonProxyHosts( proxyInfo, jiraHost ) ) + // if ( ProxyUtils.validateNonProxyHosts( proxyInfo, jiraHost ) ) if ( JiraHelper.validateNonProxyHosts( proxyInfo, jiraHost ) ) { return; @@ -200,8 +226,8 @@ public abstract class AbstractJiraDownlo } } - - public abstract List<Issue> getIssueList() throws MojoExecutionException; + public abstract List<Issue> getIssueList() + throws MojoExecutionException; public void setJiraDatePattern( String jiraDatePattern ) { @@ -226,7 +252,7 @@ public abstract class AbstractJiraDownlo /** * Sets the project. * - * @param thisProject The project to set + * @param thisProject The project to set */ public void setMavenProject( Object thisProject ) { @@ -236,7 +262,7 @@ public abstract class AbstractJiraDownlo /** * Sets the maximum number of Issues to show. * - * @param nbEntries The maximum number of Issues + * @param nbEntries The maximum number of Issues */ public void setNbEntries( final int nbEntries ) { @@ -246,7 +272,7 @@ public abstract class AbstractJiraDownlo /** * Sets the statusIds. * - * @param thisStatusIds The id(s) of the status to show, as comma separated string + * @param thisStatusIds The id(s) of the status to show, as comma separated string */ public void setStatusIds( String thisStatusIds ) { @@ -256,7 +282,7 @@ public abstract class AbstractJiraDownlo /** * Sets the priorityIds. * - * @param thisPriorityIds The id(s) of the priority to show, as comma separated string + * @param thisPriorityIds The id(s) of the priority to show, as comma separated string */ public void setPriorityIds( String thisPriorityIds ) { @@ -266,7 +292,7 @@ public abstract class AbstractJiraDownlo /** * Sets the resolutionIds. * - * @param thisResolutionIds The id(s) of the resolution to show, as comma separated string + * @param thisResolutionIds The id(s) of the resolution to show, as comma separated string */ public void setResolutionIds( String thisResolutionIds ) { @@ -286,7 +312,7 @@ public abstract class AbstractJiraDownlo /** * Sets the password for authentication against the webserver. * - * @param thisWebPassword The password of the webserver + * @param thisWebPassword The password of the webserver */ public void setWebPassword( String thisWebPassword ) { @@ -296,7 +322,7 @@ public abstract class AbstractJiraDownlo /** * Sets the username for authentication against the webserver. * - * @param thisWebUser The username of the webserver + * @param thisWebUser The username of the webserver */ public void setWebUser( String thisWebUser ) { @@ -306,7 +332,7 @@ public abstract class AbstractJiraDownlo /** * Sets the password to log into a secured JIRA. * - * @param thisJiraPassword The password for JIRA + * @param thisJiraPassword The password for JIRA */ public void setJiraPassword( final String thisJiraPassword ) { @@ -316,7 +342,7 @@ public abstract class AbstractJiraDownlo /** * Sets the username to log into a secured JIRA. * - * @param thisJiraUser The username for JIRA + * @param thisJiraUser The username for JIRA */ public void setJiraUser( String thisJiraUser ) { @@ -326,7 +352,7 @@ public abstract class AbstractJiraDownlo /** * Sets the filter to apply to query to JIRA. * - * @param thisFilter The filter to query JIRA + * @param thisFilter The filter to query JIRA */ public void setFilter( String thisFilter ) { @@ -336,7 +362,7 @@ public abstract class AbstractJiraDownlo /** * Sets the component(s) to apply to query JIRA. * - * @param theseComponents The id(s) of components to show, as comma separated string + * @param theseComponents The id(s) of components to show, as comma separated string */ public void setComponent( String theseComponents ) { @@ -356,7 +382,7 @@ public abstract class AbstractJiraDownlo /** * Sets the typeIds. * - * @param theseTypeIds The id(s) of the types to show, as comma separated string + * @param theseTypeIds The id(s) of the types to show, as comma separated string */ public void setTypeIds( String theseTypeIds ) { Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/AdaptiveJiraDownloader.java Tue Jun 16 19:29:09 2015 @@ -25,17 +25,15 @@ import org.apache.maven.plugin.issues.Is import java.util.List; /** - * Jira downloader that uses REST or RSS, depending. - * This code is not very attractive. However, JIRA has - * supported REST for a very long time, and so the - * fallback is only relevant for people with very old - * copies of JIRA. + * Jira downloader that uses REST or RSS, depending. This code is not very attractive. However, JIRA has supported REST + * for a very long time, and so the fallback is only relevant for people with very old copies of JIRA. */ -public class AdaptiveJiraDownloader extends AbstractJiraDownloader +public class AdaptiveJiraDownloader + extends AbstractJiraDownloader { private AbstractJiraDownloader effectiveDownloader; - private boolean forceClassic; + private boolean forceClassic; public void doExecute() throws Exception @@ -54,7 +52,7 @@ public class AdaptiveJiraDownloader exte effectiveDownloader.doExecute(); } } - + private void copySettings( AbstractJiraDownloader target ) { target.setLog( getLog() ); @@ -82,7 +80,6 @@ public class AdaptiveJiraDownloader exte target.setReceiveTimout( receiveTimout ); } - public List<Issue> getIssueList() throws MojoExecutionException { Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ClassicJiraDownloader.java Tue Jun 16 19:29:09 2015 @@ -75,7 +75,7 @@ public final class ClassicJiraDownloader // MCHANGES-89 Allow circular redirects HttpClientParams clientParams = client.getParams(); clientParams.setBooleanParameter( HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true ); - clientParams.setCookiePolicy( CookiePolicy.BROWSER_COMPATIBILITY ); //MCHANGES-237 + clientParams.setCookiePolicy( CookiePolicy.BROWSER_COMPATIBILITY ); // MCHANGES-237 HttpState state = new HttpState(); @@ -148,25 +148,19 @@ public final class ClassicJiraDownloader } else { + // CHECKSTYLE_OFF: LineLength // create the URL for getting the proper issues from JIRA - String jqlQuery = new JqlQueryBuilder( log ) - .project( jiraProject ) - .fixVersion( getFixFor() ) - .fixVersionIds( fixVersionIds ) - .statusIds( statusIds ) - .priorityIds( priorityIds ) - .resolutionIds( resolutionIds ) - .components( component ) - .typeIds( typeIds ) - .sortColumnNames( sortColumnNames ) - .build(); - - String url = new UrlBuilder( jiraUrl, "sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml" ) - .addParameter( "tempMax", nbEntriesMax ) - .addParameter( "reset", "true" ) - .addParameter( "jqlQuery", jqlQuery ) - .build(); + String jqlQuery = + new JqlQueryBuilder( log ).project( jiraProject ).fixVersion( getFixFor() ).fixVersionIds( fixVersionIds ).statusIds( statusIds ).priorityIds( priorityIds ).resolutionIds( resolutionIds ).components( component ).typeIds( typeIds ).sortColumnNames( sortColumnNames ).build(); + String url = + new UrlBuilder( jiraUrl, + "sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml" ).addParameter( "tempMax", + nbEntriesMax ).addParameter( "reset", + "true" ).addParameter( "jqlQuery", + jqlQuery ).build(); + + // CHECKSTYLE_ON: LineLength return url; } } @@ -180,14 +174,14 @@ public final class ClassicJiraDownloader if ( jiraId == null || jiraId.length() == 0 ) { log.debug( "The JIRA URL " + project.getIssueManagement().getUrl() - + " doesn't include a pid, trying to extract it from JIRA." ); + + " doesn't include a pid, trying to extract it from JIRA." ); jiraId = JiraHelper.getPidFromJira( log, project.getIssueManagement().getUrl(), client ); } if ( jiraId == null ) { throw new RuntimeException( "The issue management URL in the POM does not include a pid," - + " and it was not possible to extract it from the page at that URL." ); + + " and it was not possible to extract it from the page at that URL." ); } else { @@ -199,16 +193,10 @@ public final class ClassicJiraDownloader fullURL += "&fixfor=" + getFixFor(); } - String createdFilter = new ParameterQueryBuilder( log ) - .fixVersionIds( fixVersionIds ) - .statusIds( statusIds ) - .priorityIds( priorityIds ) - .resolutionIds( resolutionIds ) - .components( component ) - .typeIds( typeIds ) - .sortColumnNames( sortColumnNames ) - .filter( filter ) - .build(); + // CHECKSTYLE_OFF: LineLength + String createdFilter = + new ParameterQueryBuilder( log ).fixVersionIds( fixVersionIds ).statusIds( statusIds ).priorityIds( priorityIds ).resolutionIds( resolutionIds ).components( component ).typeIds( typeIds ).sortColumnNames( sortColumnNames ).filter( filter ).build(); + // CHECKSTYLE_ON: LineLength if ( createdFilter.charAt( 0 ) != '&' ) { @@ -243,12 +231,11 @@ public final class ClassicJiraDownloader } /** - * Authenticate against JIRA. This method relies on jiraUser and - * jiraPassword being set. You can check this by calling - * isJiraAuthenticationConfigured(). + * Authenticate against JIRA. This method relies on jiraUser and jiraPassword being set. You can check this by + * calling isJiraAuthenticationConfigured(). * - * @param client the HttpClient - * @param jiraUrl the JIRA installation + * @param client the HttpClient + * @param jiraUrl the JIRA installation * @return <code>true</code> if the authentication was successful, otherwise <code>false</code> */ private boolean doJiraAuthentication( HttpClient client, final String jiraUrl ) @@ -305,8 +292,8 @@ public final class ClassicJiraDownloader } /** - * Evaluate if the login attempt to JIRA was successful or not. We can't - * use the status code because JIRA returns 200 even if the login fails. + * Evaluate if the login attempt to JIRA was successful or not. We can't use the status code because JIRA returns + * 200 even if the login fails. * * @param loginGet The method that was executed * @return <code>false</code> if we find an error message in the response body, otherwise <code>true</code> @@ -323,7 +310,7 @@ public final class ClassicJiraDownloader /** * Setup proxy access if we have to. * - * @param client the HttpClient + * @param client the HttpClient */ private void determineProxy( String jiraUrl, HttpClient client ) { @@ -341,10 +328,9 @@ public final class ClassicJiraDownloader { getLog().debug( "Using proxy user: " + proxyUser ); - client.getState().setProxyCredentials( - new AuthScope( null, AuthScope.ANY_PORT, null, - AuthScope.ANY_SCHEME ), - new UsernamePasswordCredentials( proxyUser, proxyPass ) ); + client.getState().setProxyCredentials( new AuthScope( null, AuthScope.ANY_PORT, null, + AuthScope.ANY_SCHEME ), + new UsernamePasswordCredentials( proxyUser, proxyPass ) ); } } } @@ -352,8 +338,8 @@ public final class ClassicJiraDownloader /** * Downloads the given link using the configured HttpClient, possibly following redirects. * - * @param cl the HttpClient - * @param link the URL to JIRA + * @param cl the HttpClient + * @param link the URL to JIRA */ private void download( final HttpClient cl, final String link ) { Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JIRAIssueManagmentSystem.java Tue Jun 16 19:29:09 2015 @@ -31,7 +31,9 @@ public class JIRAIssueManagmentSystem extends AbstractIssueManagementSystem { private static final String DEFAULT_ADD_TYPE = "New Feature"; + private static final String DEFAULT_FIX_TYPE = "Bug"; + private static final String DEFAULT_UPDATE_TYPE = "Improvement"; public JIRAIssueManagmentSystem() Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraHelper.java Tue Jun 16 19:29:09 2015 @@ -38,11 +38,10 @@ import org.apache.maven.wagon.proxy.Prox */ public class JiraHelper { - private static final String PID = "?pid="; //MCHANGES-281 addd ? + private static final String PID = "?pid="; // MCHANGES-281 addd ? /** - * Parse out the base URL for JIRA and the JIRA project id from the issue - * management URL. + * Parse out the base URL for JIRA and the JIRA project id from the issue management URL. * * @param issueManagementUrl The URL to the issue management system * @return A <code>Map</code> containing the URL and project id @@ -99,9 +98,9 @@ public class JiraHelper /** * Try to get a JIRA pid from the issue management URL. * - * @param log Used to tell the user what happened + * @param log Used to tell the user what happened * @param issueManagementUrl The URL to the issue management system - * @param client The client used to connect to JIRA + * @param client The client used to connect to JIRA * @return The JIRA id for the project, or null if it can't be found */ public static String getPidFromJira( Log log, String issueManagementUrl, HttpClient client ) @@ -148,10 +147,10 @@ public class JiraHelper /** * Check if the specified host is in the list of non proxy hosts. * <p/> - * Method copied from org.apache.maven.wagon.proxy.ProxyUtils. Can be deleted when maven-changes-plugin - * references a more recent version of maven-project + * Method copied from org.apache.maven.wagon.proxy.ProxyUtils. Can be deleted when maven-changes-plugin references a + * more recent version of maven-project * - * @param proxy the proxy info object contains set of properties. + * @param proxy the proxy info object contains set of properties. * @param targetHost the target hostname * @return true if the hostname is in the list of non proxy hosts, false otherwise. */ @@ -192,9 +191,8 @@ public class JiraHelper } /** - * Parse out the base URL for JIRA and the JIRA project name from the issue - * management URL. - * The issue management URL is assumed to be of the format http(s)://host:port/browse/{projectname} + * Parse out the base URL for JIRA and the JIRA project name from the issue management URL. The issue management URL + * is assumed to be of the format http(s)://host:port/browse/{projectname} * * @param issueManagementUrl The URL to the issue management system * @return A <code>Map</code> containing the URL and project name @@ -217,12 +215,12 @@ public class JiraHelper if ( indexProject != -1 ) { - //Project name has trailing '/' + // Project name has trailing '/' project = issueManagementUrl.substring( indexBrowseEnd, indexProject ); } else { - //Project name without trailing '/' + // Project name without trailing '/' project = issueManagementUrl.substring( indexBrowseEnd ); } } @@ -243,7 +241,7 @@ public class JiraHelper */ public static String getBaseUrl( String url ) { - int index = url.indexOf( "/", 8 ); //Ignore http:// or https:// + int index = url.indexOf( "/", 8 ); // Ignore http:// or https:// return url.substring( 0, index ); } } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JiraMojo.java Tue Jun 16 19:29:09 2015 @@ -72,15 +72,12 @@ public class JiraMojo } /** - * Sets the names of the columns that you want in the report. The columns - * will appear in the report in the same order as you specify them here. - * Multiple values can be separated by commas. + * Sets the names of the columns that you want in the report. The columns will appear in the report in the same + * order as you specify them here. Multiple values can be separated by commas. * <p> - * Valid columns are: <code>Assignee</code>, <code>Component</code>, - * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>, - * <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, - * <code>Resolution</code>, <code>Status</code>, <code>Summary</code>, - * <code>Type</code>, <code>Updated</code> and <code>Version</code>. + * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>, + * <code>Id</code>, <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>, + * <code>Status</code>, <code>Summary</code>, <code>Type</code>, <code>Updated</code> and <code>Version</code>. * </p> * * @since 2.0 @@ -89,9 +86,9 @@ public class JiraMojo private String columnNames; /** - * Use the JIRA query language instead of the JIRA query based on HTTP parameters. - * From JIRA 5.1 and up only JQL is supported. JIRA 4.4 supports both JQL and URL parameter based queries. - * From 5.1.1 this is obsolete, since REST queries only use JQL. + * Use the JIRA query language instead of the JIRA query based on HTTP parameters. From JIRA 5.1 and up only JQL is + * supported. JIRA 4.4 supports both JQL and URL parameter based queries. From 5.1.1 this is obsolete, since REST + * queries only use JQL. * * @since 2.8 */ @@ -99,36 +96,33 @@ public class JiraMojo private boolean useJql; /** - * Since JIRA 5.1.1, it is no longer possible to construct a URL that downloads RSS. Meanwhile - * JIRA added a REST API in 4.2. By default, this plugin uses the REST API if available. - * Setting this parameter to true forces it to attempt to use RSS. + * Since JIRA 5.1.1, it is no longer possible to construct a URL that downloads RSS. Meanwhile JIRA added a REST API + * in 4.2. By default, this plugin uses the REST API if available. Setting this parameter to true forces it to + * attempt to use RSS. * * @since 2.9 */ @Parameter( defaultValue = "false" ) private boolean forceRss; - + /** - * Sets the component(s) that you want to limit your report to include. - * Multiple values can be separated by commas (such as 10011,10012). - * If this is set to empty - that means all components will be included. + * Sets the component(s) that you want to limit your report to include. Multiple values can be separated by commas + * (such as 10011,10012). If this is set to empty - that means all components will be included. */ @Parameter( defaultValue = "" ) private String component; /** - * Defines the filter parameters to restrict which issues are retrieved - * from JIRA. The filter parameter uses the same format of url - * parameters that is used in a JIRA search. + * Defines the filter parameters to restrict which issues are retrieved from JIRA. The filter parameter uses the + * same format of url parameters that is used in a JIRA search. */ @Parameter( defaultValue = "" ) private String filter; /** - * Sets the fix version id(s) that you want to limit your report to include. - * These are JIRA's internal version ids, <b>NOT</b> the human readable display ones. - * Multiple fix versions can be separated by commas. - * If this is set to empty - that means all fix versions will be included. + * Sets the fix version id(s) that you want to limit your report to include. These are JIRA's internal version ids, + * <b>NOT</b> the human readable display ones. Multiple fix versions can be separated by commas. If this is set to + * empty - that means all fix versions will be included. * * @since 2.0 */ @@ -136,8 +130,7 @@ public class JiraMojo private String fixVersionIds; /** - * The pattern used by dates in the JIRA XML-file. This is used to parse - * the Created and Updated fields. + * The pattern used by dates in the JIRA XML-file. This is used to parse the Created and Updated fields. * * @since 2.4 */ @@ -169,9 +162,8 @@ public class JiraMojo private int maxEntries; /** - * If you only want to show issues for the current version in the report. - * The current version being used is <code>${project.version}</code> minus - * any "-SNAPSHOT" suffix. + * If you only want to show issues for the current version in the report. The current version being used is + * <code>${project.version}</code> minus any "-SNAPSHOT" suffix. * * @since 2.0 */ @@ -179,24 +171,19 @@ public class JiraMojo private boolean onlyCurrentVersion; /** - * Sets the priority(s) that you want to limit your report to include. - * Valid statuses are <code>Blocker</code>, <code>Critical</code>, - * <code>Major</code>, <code>Minor</code> and <code>Trivial</code>. - * Multiple values can be separated by commas. - * If this is set to empty - that means all priorities will be included. + * Sets the priority(s) that you want to limit your report to include. Valid statuses are <code>Blocker</code>, + * <code>Critical</code>, <code>Major</code>, <code>Minor</code> and <code>Trivial</code>. Multiple values can be + * separated by commas. If this is set to empty - that means all priorities will be included. */ @Parameter( defaultValue = "" ) private String priorityIds; /** - * Sets the resolution(s) that you want to fetch from JIRA. - * Valid resolutions are: <code>Unresolved</code>, <code>Fixed</code>, - * <code>Won't Fix</code>, <code>Duplicate</code>, <code>Incomplete</code> - * and <code>Cannot Reproduce</code>. - * Multiple values can be separated by commas. + * Sets the resolution(s) that you want to fetch from JIRA. Valid resolutions are: <code>Unresolved</code>, + * <code>Fixed</code>, <code>Won't Fix</code>, <code>Duplicate</code>, <code>Incomplete</code> and + * <code>Cannot Reproduce</code>. Multiple values can be separated by commas. * <p> - * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no - * default value. + * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no default value. * </p> */ @Parameter( defaultValue = "Fixed" ) @@ -217,30 +204,22 @@ public class JiraMojo private boolean skip; /** - * Sets the column names that you want to sort the report by. Add - * <code>DESC</code> following the column name - * to specify <i>descending</i> sequence. For - * example <code>Fix Version DESC, Type</code> sorts first by - * the Fix Version in descending order and then by Type in - * ascending order. By default sorting is done in ascending order, but is - * possible to specify <code>ASC</code> for consistency. The previous - * example would then become <code>Fix Version DESC, Type ASC</code>. + * Sets the column names that you want to sort the report by. Add <code>DESC</code> following the column name to + * specify <i>descending</i> sequence. For example <code>Fix Version DESC, Type</code> sorts first by the Fix + * Version in descending order and then by Type in ascending order. By default sorting is done in ascending order, + * but is possible to specify <code>ASC</code> for consistency. The previous example would then become + * <code>Fix Version DESC, Type ASC</code>. * <p> - * Valid columns are: <code>Assignee</code>, <code>Component</code>, - * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>, - * <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, - * <code>Resolution</code>, <code>Status</code>, <code>Summary</code>, - * <code>Type</code>, <code>Updated</code> and <code>Version</code>. + * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>, + * <code>Id</code>, <code>Key</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>, + * <code>Status</code>, <code>Summary</code>, <code>Type</code>, <code>Updated</code> and <code>Version</code>. * </p> * <p> - * <strong>Note:</strong> If you are using JIRA 4 you need to put your - * sort column names in the reverse order. The handling of this changed - * between JIRA 3 and JIRA 4. The current default value is suitable for - * JIRA 3. This may change in the future, so please configure your sort - * column names in an order that works for your own JIRA version. If you - * use JQL, by setting the <code>useJql</code> parameter to - * <code>true</code>, then the order of the fields are in normal order - * again. Starting with JIRA 5.1 you have to use JQL. + * <strong>Note:</strong> If you are using JIRA 4 you need to put your sort column names in the reverse order. The + * handling of this changed between JIRA 3 and JIRA 4. The current default value is suitable for JIRA 3. This may + * change in the future, so please configure your sort column names in an order that works for your own JIRA + * version. If you use JQL, by setting the <code>useJql</code> parameter to <code>true</code>, then the order of the + * fields are in normal order again. Starting with JIRA 5.1 you have to use JQL. * </p> * * @since 2.0 @@ -249,35 +228,27 @@ public class JiraMojo private String sortColumnNames; /** - * Sets the status(es) that you want to fetch from JIRA. - * Valid statuses are: <code>Open</code>, <code>In Progress</code>, - * <code>Reopened</code>, <code>Resolved</code> and <code>Closed</code>. - * Multiple values can be separated by commas. + * Sets the status(es) that you want to fetch from JIRA. Valid statuses are: <code>Open</code>, + * <code>In Progress</code>, <code>Reopened</code>, <code>Resolved</code> and <code>Closed</code>. Multiple values + * can be separated by commas. * <p> - * If your installation of JIRA uses custom status IDs, you can reference - * them here by their numeric values. - * You can obtain them on the Statuses page - * (in 4.0.2 it's under Administration > Issue Settings > Statuses) - * - just hover over the Edit link for the status you want and - * you'll see something like - * <your JIRA URL>/secure/admin/EditStatus!default.jspa?id=12345; - * in this case the value is 12345. + * If your installation of JIRA uses custom status IDs, you can reference them here by their numeric values. You can + * obtain them on the Statuses page (in 4.0.2 it's under Administration > Issue Settings > Statuses) - just hover + * over the Edit link for the status you want and you'll see something like <your JIRA + * URL>/secure/admin/EditStatus!default.jspa?id=12345; in this case the value is 12345. * </p> * <p> - * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no - * default value. + * <b>Note:</b> In versions 2.0-beta-3 and earlier this parameter had no default value. * </p> */ @Parameter( defaultValue = "Closed" ) private String statusIds; /** - * Sets the types(s) that you want to limit your report to include. - * Valid types are: <code>Bug</code>, <code>New Feature</code>, - * <code>Task</code>, <code>Improvement</code>, <code>Wish</code>, - * <code>Test</code> and <code>Sub-task</code>. - * Multiple values can be separated by commas. - * If this is set to empty - that means all types will be included. + * Sets the types(s) that you want to limit your report to include. Valid types are: <code>Bug</code>, + * <code>New Feature</code>, <code>Task</code>, <code>Improvement</code>, <code>Wish</code>, <code>Test</code> and + * <code>Sub-task</code>. Multiple values can be separated by commas. If this is set to empty - that means all types + * will be included. * * @since 2.0 */ @@ -287,11 +258,9 @@ public class JiraMojo /** * The prefix used when naming versions in JIRA. * <p> - * If you have a project in JIRA with several components that have different - * release cycles, it is an often used pattern to prefix the version with - * the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues - * from JIRA for a release of the "maven-filtering" component you would need - * to set this parameter to "maven-filtering-". + * If you have a project in JIRA with several components that have different release cycles, it is an often used + * pattern to prefix the version with the name of the component, e.g. maven-filtering-1.0 etc. To fetch issues from + * JIRA for a release of the "maven-filtering" component you would need to set this parameter to "maven-filtering-". * </p> * * @since 2.4 @@ -310,14 +279,14 @@ public class JiraMojo */ @Parameter( defaultValue = "" ) private String webUser; - + /* * Used for tests. */ private AbstractJiraDownloader mockDownloader; /* --------------------------------------------------------------------- */ - /* Public methods */ + /* Public methods */ /* --------------------------------------------------------------------- */ /** @@ -335,7 +304,7 @@ public class JiraMojo { return false; } - if ( mockDownloader != null ) + if ( mockDownloader != null ) { return true; } @@ -350,8 +319,8 @@ public class JiraMojo if ( columnIds.isEmpty() ) { // This can happen if the user has configured column names and they are all invalid - throw new MavenReportException( - "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." ); + throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames + + "' are valid." ); } try @@ -422,7 +391,7 @@ public class JiraMojo } /* --------------------------------------------------------------------- */ - /* Private methods */ + /* Private methods */ /* --------------------------------------------------------------------- */ private ResourceBundle getBundle( Locale locale ) @@ -469,9 +438,9 @@ public class JiraMojo issueDownloader.setSettings( settings ); issueDownloader.setUseJql( useJql ); - + issueDownloader.setOnlyCurrentVersion( onlyCurrentVersion ); - + issueDownloader.setVersionPrefix( versionPrefix ); } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/JqlQueryBuilder.java Tue Jun 16 19:29:09 2015 @@ -27,8 +27,7 @@ import java.util.List; import java.util.Locale; /** - * Builder for a JIRA query using the JIRA query language. - * Only a limited set of JQL is supported. + * Builder for a JIRA query using the JIRA query language. Only a limited set of JQL is supported. * * @author ton.sw...@finalist.com * @version $Id$ @@ -38,6 +37,7 @@ public class JqlQueryBuilder implements JiraQueryBuilder { private String filter = ""; + private boolean urlEncode = true; /** @@ -107,8 +107,8 @@ public class JqlQueryBuilder } /** - * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably - * end up with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion + * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably end up + * with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion * * @param fixVersion a single fix version * @return @@ -120,8 +120,8 @@ public class JqlQueryBuilder } /** - * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably - * end up with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion + * When both {@link #fixVersion(String)} and {@link #fixVersionIds(String)} are used then you will probably end up + * with a JQL query that is valid, but returns nothing. Unless they both only reference the same fixVersion * * @param fixVersionIds a comma-separated list of version ids. * @return @@ -134,6 +134,7 @@ public class JqlQueryBuilder /** * Add a sequence of version IDs already in a list. + * * @param fixVersionIds the version ids. * @return */ @@ -208,7 +209,6 @@ public class JqlQueryBuilder return this; } - public JiraQueryBuilder typeIds( String typeIds ) { addCommaSeparatedValues( "type", typeIds ); @@ -233,7 +233,7 @@ public class JqlQueryBuilder } /* --------------------------------------------------------------------- */ - /* Private methods */ + /* Private methods */ /* --------------------------------------------------------------------- */ private void addCommaSeparatedValues( String key, String values ) @@ -275,7 +275,7 @@ public class JqlQueryBuilder trimAndQuoteValue( values.get( i ) ); query.append( ", " ); } - trimAndQuoteValue( values.get ( values.size() - 1 ) ); + trimAndQuoteValue( values.get( values.size() - 1 ) ); query.append( ")" ); } } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/ParameterQueryBuilder.java Tue Jun 16 19:29:09 2015 @@ -37,16 +37,21 @@ public class ParameterQueryBuilder implements JiraQueryBuilder { private String filter = ""; + /** Log for debug output. */ private Log log; + private StringBuilder query = new StringBuilder(); /** Mapping containing all allowed JIRA priority values. */ private final Map<String, String> priorityMap = new HashMap<String, String>( 8 ); + /** Mapping containing all allowed JIRA resolution values. */ private final Map<String, String> resolutionMap = new HashMap<String, String>( 8 ); + /** Mapping containing all allowed JIRA status values. */ private final Map<String, String> statusMap = new HashMap<String, String>( 8 ); + /** Mapping containing all allowed JIRA type values. */ private final Map<String, String> typeMap = new HashMap<String, String>( 8 ); @@ -320,16 +325,15 @@ public class ParameterQueryBuilder else { // Error in the configuration - getLog().error( - "maven-changes-plugin: The configured value '" + lowerColumnName - + "' for sortColumnNames is not correct." ); + getLog().error( "maven-changes-plugin: The configured value '" + lowerColumnName + + "' for sortColumnNames is not correct." ); } } if ( validSortColumnNames == 0 ) { // Error in the configuration getLog().error( "maven-changes-plugin: None of the configured sortColumnNames '" + sortColumnNames - + "' are correct." ); + + "' are correct." ); } } return this; Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/RestJiraDownloader.java Tue Jun 16 19:29:09 2015 @@ -52,23 +52,28 @@ import java.util.List; import java.util.Map; /** - * Use the JIRA REST API to implement the download. - * - * This class assumes that the URL points to a copy of JIRA that implements the REST API. - * A static function may be forthcoming in here to probe and see if a given URL supports it. - * + * Use the JIRA REST API to implement the download. This class assumes that the URL points to a copy of JIRA that + * implements the REST API. A static function may be forthcoming in here to probe and see if a given URL supports it. */ -public class RestJiraDownloader extends AbstractJiraDownloader +public class RestJiraDownloader + extends AbstractJiraDownloader { private List<Issue> issueList; + private JsonFactory jsonFactory; + private SimpleDateFormat dateFormat; private List<String> resolvedFixVersionIds; + private List<String> resolvedStatusIds; + private List<String> resolvedComponentIds; + private List<String> resolvedTypeIds; + private List<String> resolvedResolutionIds; + private List<String> resolvedPriorityIds; private String jiraProject; @@ -79,10 +84,11 @@ public class RestJiraDownloader extends public static class NoRest extends Exception { - public NoRest( ) + public NoRest() { // blank on purpose. } + public NoRest( String message ) { super( message ); @@ -91,15 +97,15 @@ public class RestJiraDownloader extends public RestJiraDownloader() { - jsonFactory = new MappingJsonFactory( ); - //2012-07-17T06:26:47.723-0500 + jsonFactory = new MappingJsonFactory(); + // 2012-07-17T06:26:47.723-0500 dateFormat = new SimpleDateFormat( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ); - resolvedFixVersionIds = new ArrayList<String>( ); - resolvedStatusIds = new ArrayList<String>( ); - resolvedComponentIds = new ArrayList<String>( ); - resolvedTypeIds = new ArrayList<String>( ); - resolvedResolutionIds = new ArrayList<String>( ); - resolvedPriorityIds = new ArrayList<String>( ); + resolvedFixVersionIds = new ArrayList<String>(); + resolvedStatusIds = new ArrayList<String>(); + resolvedComponentIds = new ArrayList<String>(); + resolvedTypeIds = new ArrayList<String>(); + resolvedResolutionIds = new ArrayList<String>(); + resolvedPriorityIds = new ArrayList<String>(); } public void doExecute() @@ -114,7 +120,7 @@ public class RestJiraDownloader extends ClassLoader ccl = Thread.currentThread().getContextClassLoader(); try { - Thread.currentThread().setContextClassLoader( WebClient.class.getClassLoader( ) ); + Thread.currentThread().setContextClassLoader( WebClient.class.getClassLoader() ); WebClient client = setupWebClient( jiraUrl ); // We use version 2 of the REST API, that first appeared in JIRA 5 @@ -134,10 +140,10 @@ public class RestJiraDownloader extends resolveIds( client, jiraProject ); - String jqlQuery = new JqlQueryBuilder( log ).urlEncode( false ).project( jiraProject ).fixVersion( - getFixFor() ).fixVersionIds( resolvedFixVersionIds ).statusIds( resolvedStatusIds ).priorityIds( - resolvedPriorityIds ).resolutionIds( resolvedResolutionIds ).components( resolvedComponentIds ).typeIds( - resolvedTypeIds ).sortColumnNames( sortColumnNames ).build(); + // CHECKSTYLE_OFF: LineLength + String jqlQuery = + new JqlQueryBuilder( log ).urlEncode( false ).project( jiraProject ).fixVersion( getFixFor() ).fixVersionIds( resolvedFixVersionIds ).statusIds( resolvedStatusIds ).priorityIds( resolvedPriorityIds ).resolutionIds( resolvedResolutionIds ).components( resolvedComponentIds ).typeIds( resolvedTypeIds ).sortColumnNames( sortColumnNames ).build(); + // CHECKSTYLE_ON: LineLength StringWriter searchParamStringWriter = new StringWriter(); JsonGenerator gen = jsonFactory.createGenerator( searchParamStringWriter ); @@ -188,7 +194,7 @@ public class RestJiraDownloader extends JsonNode messages = errorTree.get( "errorMessages" ); if ( messages != null ) { - for ( int mx = 0; mx < messages.size(); mx ++ ) + for ( int mx = 0; mx < messages.size(); mx++ ) { getLog().error( messages.get( mx ).asText() ); } @@ -208,7 +214,7 @@ public class RestJiraDownloader extends private void resolveIds( WebClient client, String jiraProject ) throws IOException, MojoExecutionException, MojoFailureException { - resolveList( resolvedComponentIds, client, "components", component, "/rest/api/2/project/{key}/components", + resolveList( resolvedComponentIds, client, "components", component, "/rest/api/2/project/{key}/components", jiraProject ); resolveList( resolvedFixVersionIds, client, "fixVersions", fixVersionIds, "/rest/api/2/project/{key}/versions", jiraProject ); @@ -220,7 +226,7 @@ public class RestJiraDownloader extends private void resolveList( List<String> targetList, WebClient client, String what, String input, String listRestUrlPattern, String... listUrlArgs ) - throws IOException, MojoExecutionException, MojoFailureException + throws IOException, MojoExecutionException, MojoFailureException { if ( input == null || input.length() == 0 ) { @@ -254,7 +260,7 @@ public class RestJiraDownloader extends private String resolveOneItem( JsonNode items, String what, String nameOrId ) throws IOException, MojoExecutionException, MojoFailureException { - for ( int cx = 0; cx < items.size(); cx ++ ) + for ( int cx = 0; cx < items.size(); cx++ ) { JsonNode item = items.get( cx ); if ( nameOrId.equals( item.get( "id" ).asText() ) ) @@ -271,13 +277,13 @@ public class RestJiraDownloader extends private MediaType getResponseMediaType( Response response ) { - String header = (String) response.getMetadata().getFirst( HttpHeaders.CONTENT_TYPE ) ; + String header = (String) response.getMetadata().getFirst( HttpHeaders.CONTENT_TYPE ); return header == null ? null : MediaType.valueOf( header ); } private void buildIssues( JsonNode issuesNode, String jiraUrl, String jiraProject ) { - issueList = new ArrayList<Issue>( ); + issueList = new ArrayList<Issue>(); for ( int ix = 0; ix < issuesNode.size(); ix++ ) { JsonNode issueNode = issuesNode.get( ix ); @@ -355,10 +361,10 @@ public class RestJiraDownloader extends private void processVersions( Issue issue, JsonNode val ) { - StringBuilder sb = new StringBuilder( ); + StringBuilder sb = new StringBuilder(); if ( val != null ) { - for ( int vx = 0; vx < val.size(); vx ++ ) + for ( int vx = 0; vx < val.size(); vx++ ) { sb.append( val.get( vx ).get( "name" ).asText() ); sb.append( ", " ); @@ -527,7 +533,7 @@ public class RestJiraDownloader extends { client.replacePath( "/rest/auth/1/session" ); client.type( MediaType.APPLICATION_JSON_TYPE ); - StringWriter jsWriter = new StringWriter( ); + StringWriter jsWriter = new StringWriter(); JsonGenerator gen = jsonFactory.createGenerator( jsWriter ); gen.writeStartObject(); gen.writeStringField( "username", jiraUser ); @@ -560,8 +566,8 @@ public class RestJiraDownloader extends if ( getLog().isDebugEnabled() ) { - clientConfiguration.getInInterceptors().add( new LoggingInInterceptor( ) ); - clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor( ) ); + clientConfiguration.getInInterceptors().add( new LoggingInInterceptor() ); + clientConfiguration.getOutInterceptors().add( new LoggingOutInterceptor() ); } HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy(); @@ -605,7 +611,8 @@ public class RestJiraDownloader extends return client; } - public List<Issue> getIssueList() throws MojoExecutionException + public List<Issue> getIssueList() + throws MojoExecutionException { return issueList; } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/jira/UrlBuilder.java Tue Jun 16 19:29:09 2015 @@ -29,6 +29,7 @@ package org.apache.maven.plugin.jira; public class UrlBuilder { private static final String AMPERSAND = "&"; + private static final String QUESTION_MARK = "?"; private StringBuilder query = new StringBuilder(); Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/resource/loader/ProjectResourceLoader.java Tue Jun 16 19:29:09 2015 @@ -48,9 +48,8 @@ public class ProjectResourceLoader private List<String> paths = null; /** - * Used to map the path that a template was found on - * so that we can properly check the modification - * times of the files. + * Used to map the path that a template was found on so that we can properly check the modification times of the + * files. */ private Hashtable<String, String> templatePaths = new Hashtable<String, String>(); @@ -64,11 +63,11 @@ public class ProjectResourceLoader + "resources" + separator; rsvc.getLog().info( "path :" + path ); - + paths = new ArrayList<String>(); paths.add( path ); - + for ( String path1 : paths ) { rsvc.getLog().info( "ProjectResourceLoader : adding path '" + path1 + "'" ); @@ -77,13 +76,11 @@ public class ProjectResourceLoader } /** - * Get an InputStream so that the Runtime can build a - * template with it. + * Get an InputStream so that the Runtime can build a template with it. * * @param templateName name of template to get * @return InputStream containing the template - * @throws ResourceNotFoundException if template not found - * in the file template path. + * @throws ResourceNotFoundException if template not found in the file template path. */ public synchronized InputStream getResourceStream( String templateName ) throws ResourceNotFoundException @@ -94,8 +91,7 @@ public class ProjectResourceLoader if ( templateName == null || templateName.length() == 0 ) { /* - * If we don't get a properly formed templateName then - * there's not much we can do. So we'll forget about + * If we don't get a properly formed templateName then there's not much we can do. So we'll forget about * trying to search any more paths for the template. */ throw new ResourceNotFoundException( "Need to specify a file name or file path!" ); @@ -113,13 +109,13 @@ public class ProjectResourceLoader } /* - * if a / leads off, then just nip that :) + * if a / leads off, then just nip that :) */ if ( template.startsWith( "/" ) ) { template = template.substring( 1 ); } - + // MCHANGES-118 adding the basedir path paths.add( (String) rsvc.getApplicationAttribute( "baseDirectory" ) ); @@ -130,9 +126,7 @@ public class ProjectResourceLoader if ( inputStream != null ) { /* - * Store the path that this template came - * from so that we can check its modification - * time. + * Store the path that this template came from so that we can check its modification time. */ templatePaths.put( templateName, path ); @@ -141,9 +135,7 @@ public class ProjectResourceLoader } /* - * We have now searched all the paths for - * templates and we didn't find anything so - * throw an exception. + * We have now searched all the paths for templates and we didn't find anything so throw an exception. */ String msg = "ProjectResourceLoader Error: cannot find resource " + template; @@ -155,14 +147,13 @@ public class ProjectResourceLoader * * @param path a normalized path * @return InputStream input stream that will be parsed - * */ private InputStream findTemplate( String path, String template ) { try { File file = new File( path, template ); - + if ( file.canRead() ) { return new BufferedInputStream( new FileInputStream( file.getAbsolutePath() ) ); @@ -175,26 +166,22 @@ public class ProjectResourceLoader catch ( FileNotFoundException fnfe ) { /* - * log and convert to a general Velocity ResourceNotFoundException + * log and convert to a general Velocity ResourceNotFoundException */ return null; } } /** - * How to keep track of all the modified times - * across the paths. Note that a file might have - * appeared in a directory which is earlier in the - * path; so we should search the path and see if - * the file we find that way is the same as the one - * that we have cached. + * How to keep track of all the modified times across the paths. Note that a file might have appeared in a directory + * which is earlier in the path; so we should search the path and see if the file we find that way is the same as + * the one that we have cached. */ public boolean isSourceModified( Resource resource ) { /* - * we assume that the file needs to be reloaded; - * if we find the original file and it's unchanged, - * then we'll flip this. + * we assume that the file needs to be reloaded; if we find the original file and it's unchanged, then we'll + * flip this. */ boolean modified = true; @@ -215,21 +202,16 @@ public class ProjectResourceLoader if ( currentFile == null || !file.exists() ) { /* - * noop: if the file is missing now (either the cached - * file is gone, or the file can no longer be found) - * then we leave modified alone (it's set to true); a - * reload attempt will be done, which will either use - * a new template or fail with an appropriate message - * about how the file couldn't be found. + * noop: if the file is missing now (either the cached file is gone, or the file can no longer be found) + * then we leave modified alone (it's set to true); a reload attempt will be done, which will either use a + * new template or fail with an appropriate message about how the file couldn't be found. */ } else if ( currentFile.equals( file ) && file.canRead() ) { /* - * if only if currentFile is the same as file and - * file.lastModified() is the same as - * resource.getLastModified(), then we should use the - * cached version. + * if only if currentFile is the same as file and file.lastModified() is the same as + * resource.getLastModified(), then we should use the cached version. */ modified = ( file.lastModified() != resource.getLastModified() ); } Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracDownloader.java Tue Jun 16 19:29:09 2015 @@ -49,10 +49,13 @@ public class TracDownloader { /** The Maven project. */ private MavenProject project; + /** The Trac query for searching for tickets. */ private String query; + /** The password for authentication into a private Trac installation. */ private String tracPassword; + /** The username for authentication into a private Trac installation. */ private String tracUser; @@ -93,7 +96,8 @@ public class TracDownloader return issue; } - public List<Issue> getIssueList() throws MalformedURLException, XmlRpcException + public List<Issue> getIssueList() + throws MalformedURLException, XmlRpcException { // Create and configure an XML-RPC client XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl(); @@ -123,7 +127,7 @@ public class TracDownloader qstr = query; } - Object[] params = new Object[] {qstr}; + Object[] params = new Object[] { qstr }; Object[] queryResult; ArrayList<Issue> issueList = new ArrayList<Issue>(); try @@ -132,7 +136,7 @@ public class TracDownloader for ( Object aQueryResult : queryResult ) { - params = new Object[]{aQueryResult}; + params = new Object[] { aQueryResult }; Object[] ticketGetResult; ticketGetResult = (Object[]) client.execute( "ticket.get", params ); issueList.add( createIssue( ticketGetResult ) ); Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracIssueManagmentSystem.java Tue Jun 16 19:29:09 2015 @@ -31,7 +31,9 @@ public class TracIssueManagmentSystem extends AbstractIssueManagementSystem { private static final String DEFAULT_ADD_TYPE = "New Feature"; + private static final String DEFAULT_FIX_TYPE = "Bug"; + private static final String DEFAULT_UPDATE_TYPE = "Improvement"; public TracIssueManagmentSystem() Modified: maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java?rev=1685894&r1=1685893&r2=1685894&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/main/java/org/apache/maven/plugin/trac/TracMojo.java Tue Jun 16 19:29:09 2015 @@ -28,6 +28,7 @@ import java.util.ResourceBundle; import org.apache.maven.plugin.changes.AbstractChangesReport; import org.apache.maven.plugin.changes.ProjectUtils; +import org.apache.maven.plugin.issues.Issue; import org.apache.maven.plugin.issues.IssuesReportGenerator; import org.apache.maven.plugin.issues.IssuesReportHelper; import org.apache.maven.plugins.annotations.Mojo; @@ -36,8 +37,7 @@ import org.apache.maven.reporting.MavenR import org.apache.xmlrpc.XmlRpcException; /** - * Goal which downloads issues from the Issue Tracking System and generates a - * report. + * Goal which downloads issues from the Issue Tracking System and generates a report. * * @author Noriko Kinugasa * @version $Id$ @@ -89,15 +89,12 @@ public class TracMojo } /** - * Sets the column names that you want to show in the report. The columns - * will appear in the report in the same order as you specify them here. - * Multiple values can be separated by commas. + * Sets the column names that you want to show in the report. The columns will appear in the report in the same + * order as you specify them here. Multiple values can be separated by commas. * <p> - * Valid columns are: <code>Assignee</code>, <code>Component</code>, - * <code>Created</code>, <code>Fix Version</code>, <code>Id</code>, - * <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>, - * <code>Status</code>, <code>Summary</code>, <code>Type</code> and - * <code>Updated</code>. + * Valid columns are: <code>Assignee</code>, <code>Component</code>, <code>Created</code>, <code>Fix Version</code>, + * <code>Id</code>, <code>Priority</code>, <code>Reporter</code>, <code>Resolution</code>, <code>Status</code>, + * <code>Summary</code>, <code>Type</code> and <code>Updated</code>. * </p> * * @since 2.2 @@ -112,21 +109,19 @@ public class TracMojo private String query; /** - * Defines the Trac password for authentication into a private Trac - * installation. + * Defines the Trac password for authentication into a private Trac installation. */ @Parameter( defaultValue = "" ) private String tracPassword; /** - * Defines the Trac username for authentication into a private Trac - * installation. + * Defines the Trac username for authentication into a private Trac installation. */ @Parameter( defaultValue = "" ) private String tracUser; /* --------------------------------------------------------------------- */ - /* Public methods */ + /* Public methods */ /* --------------------------------------------------------------------- */ /** @@ -147,13 +142,13 @@ public class TracMojo throws MavenReportException { // Validate parameters - List<Integer> columnIds = IssuesReportHelper.getColumnIds( columnNames, TRAC_COLUMNS, DEPRECATED_TRAC_COLUMNS, - getLog() ); + List<Integer> columnIds = + IssuesReportHelper.getColumnIds( columnNames, TRAC_COLUMNS, DEPRECATED_TRAC_COLUMNS, getLog() ); if ( columnIds.size() == 0 ) { // This can happen if the user has configured column names and they are all invalid - throw new MavenReportException( - "maven-changes-plugin: None of the configured columnNames '" + columnNames + "' are valid." ); + throw new MavenReportException( "maven-changes-plugin: None of the configured columnNames '" + columnNames + + "' are valid." ); } try @@ -162,7 +157,7 @@ public class TracMojo TracDownloader issueDownloader = new TracDownloader(); configureIssueDownloader( issueDownloader ); - List issueList = issueDownloader.getIssueList(); + List<Issue> issueList = issueDownloader.getIssueList(); // Generate the report IssuesReportGenerator report = new IssuesReportGenerator( IssuesReportHelper.toIntArray( columnIds ) ); @@ -209,7 +204,7 @@ public class TracMojo } /* --------------------------------------------------------------------- */ - /* Private methods */ + /* Private methods */ /* --------------------------------------------------------------------- */ private ResourceBundle getBundle( Locale locale )