This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch MCHANGES-451
in repository https://gitbox.apache.org/repos/asf/maven-changes-plugin.git

commit 4bbc44cab9f21b9282205fcc9848393fb9b78263
Author: Slawomir Jaranowski <s.jaranow...@gmail.com>
AuthorDate: Sun Dec 1 23:31:22 2024 +0100

    [MCHANGES-451] Remove items which was deprecated in 2.x
---
 .../changes/announcement/AnnouncementMailMojo.java | 14 --------
 .../changes/announcement/AnnouncementMojo.java     | 41 ----------------------
 .../maven/plugins/changes/github/GitHubReport.java | 22 ++++++------
 .../plugins/changes/issues/IssuesReportHelper.java | 31 ----------------
 .../maven/plugins/changes/trac/TracReport.java     | 20 +----------
 5 files changed, 12 insertions(+), 116 deletions(-)

diff --git 
a/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMailMojo.java
 
b/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMailMojo.java
index 1f37e2d..4ab9f76 100644
--- 
a/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMailMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMailMojo.java
@@ -188,15 +188,6 @@ public class AnnouncementMailMojo extends 
AbstractAnnouncementMojo {
     @Parameter(property = "changes.templateEncoding", defaultValue = 
"${project.build.sourceEncoding}")
     private String templateEncoding;
 
-    /**
-     * Directory which contains the template for announcement email.
-     *
-     * @deprecated Starting with version 2.10 this parameter is no longer 
used. You must use
-     *             {@link #announcementDirectory} instead.
-     */
-    @Parameter
-    private File templateOutputDirectory;
-
     /**
      * Recipient email address.
      */
@@ -228,11 +219,6 @@ public class AnnouncementMailMojo extends 
AbstractAnnouncementMojo {
     private ProjectJavamailMailSender mailer = new ProjectJavamailMailSender();
 
     public void execute() throws MojoExecutionException {
-        // Fail build fast if it is using deprecated parameters
-        if (templateOutputDirectory != null) {
-            throw new MojoExecutionException("You are using the old parameter 
'templateOutputDirectory'. "
-                    + "You must use 'announcementDirectory' instead.");
-        }
 
         // Run only at the execution root
         if (runOnlyAtExecutionRoot && !isThisTheExecutionRoot()) {
diff --git 
a/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMojo.java
 
b/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMojo.java
index 82d72bd..7e4cb51 100644
--- 
a/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMojo.java
+++ 
b/src/main/java/org/apache/maven/plugins/changes/announcement/AnnouncementMojo.java
@@ -156,15 +156,6 @@ public class AnnouncementMojo extends 
AbstractAnnouncementMojo {
     @Parameter(defaultValue = "${project.build.directory}/announcement", 
required = true)
     private File announcementDirectory;
 
-    /**
-     * Directory where the announcement file will be generated.
-     *
-     * @deprecated Starting with version 2.10 this parameter is no longer 
used. You must use
-     *             {@link #announcementDirectory} instead.
-     */
-    @Parameter
-    private File outputDirectory;
-
     /**
      * Packaging structure for the artifact.
      */
@@ -254,25 +245,6 @@ public class AnnouncementMojo extends 
AbstractAnnouncementMojo {
     @Parameter
     private String filter;
 
-    /**
-     * Flag to determine if the plugin will generate a JIRA announcement.
-     *
-     * @deprecated Since version 2.4 this parameter has been deprecated. 
Please use the issueManagementSystems parameter
-     *             instead.
-     */
-    @Parameter(property = "generateJiraAnnouncement")
-    private Boolean generateJiraAnnouncement;
-
-    /**
-     * If releases from JIRA should be merged with the releases from a 
changes.xml file.
-     *
-     * @since 2.1
-     * @deprecated Since version 2.4 this parameter has been deprecated. 
Please use the issueManagementSystems parameter
-     *             instead.
-     */
-    @Parameter(property = "changes.jiraMerge")
-    private Boolean jiraMerge;
-
     /**
      * Defines the JIRA password for authentication into a private JIRA 
installation.
      *
@@ -460,11 +432,6 @@ public class AnnouncementMojo extends 
AbstractAnnouncementMojo {
      * @throws MojoExecutionException in case of errors
      */
     public void execute() throws MojoExecutionException {
-        // Fail build fast if it is using deprecated parameters
-        failIfUsingDeprecatedParameter(outputDirectory, "outputDirectory", 
"announcementDirectory");
-        failIfUsingDeprecatedParameter(generateJiraAnnouncement, 
"generateJiraAnnouncement", "issueManagementSystems ");
-        failIfUsingDeprecatedParameter(jiraMerge, "jiraMerge", 
"issueManagementSystems ");
-
         // Run only at the execution root
         if (runOnlyAtExecutionRoot && !isThisTheExecutionRoot()) {
             getLog().info("Skipping the announcement generation in this 
project because it's not the Execution Root");
@@ -545,14 +512,6 @@ public class AnnouncementMojo extends 
AbstractAnnouncementMojo {
         }
     }
 
-    private void failIfUsingDeprecatedParameter(Object value, String name, 
String replacement)
-            throws MojoExecutionException {
-        if (value != null) {
-            throw new MojoExecutionException(
-                    "You are using the old parameter '" + name + "'. " + "You 
must use '" + replacement + "' instead.");
-        }
-    }
-
     /**
      * Add the parameters to velocity context
      *
diff --git 
a/src/main/java/org/apache/maven/plugins/changes/github/GitHubReport.java 
b/src/main/java/org/apache/maven/plugins/changes/github/GitHubReport.java
index 77ae516..76f3ecd 100644
--- a/src/main/java/org/apache/maven/plugins/changes/github/GitHubReport.java
+++ b/src/main/java/org/apache/maven/plugins/changes/github/GitHubReport.java
@@ -51,18 +51,18 @@ public class GitHubReport extends AbstractChangesReport {
     /**
      * Valid Github columns.
      */
-    private static Map<String, Integer> githubColumns = new HashMap<>();
+    private static final Map<String, Integer> GITHUB_COLUMNS = new HashMap<>();
 
     static {
-        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);
+        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);
     }
 
     /**
@@ -163,7 +163,7 @@ public class GitHubReport extends AbstractChangesReport {
     protected void executeReport(Locale locale) throws MavenReportException {
 
         // Validate parameters
-        List<Integer> columnIds = IssuesReportHelper.getColumnIds(columnNames, 
githubColumns);
+        List<Integer> columnIds = IssuesReportHelper.getColumnIds(columnNames, 
GITHUB_COLUMNS);
         if (columnIds.size() == 0) {
             // This can happen if the user has configured column names and 
they are all invalid
             throw new MavenReportException(
diff --git 
a/src/main/java/org/apache/maven/plugins/changes/issues/IssuesReportHelper.java 
b/src/main/java/org/apache/maven/plugins/changes/issues/IssuesReportHelper.java
index 218f5b3..0c275da 100644
--- 
a/src/main/java/org/apache/maven/plugins/changes/issues/IssuesReportHelper.java
+++ 
b/src/main/java/org/apache/maven/plugins/changes/issues/IssuesReportHelper.java
@@ -23,9 +23,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.commons.collections4.bidimap.DualHashBidiMap;
-import org.apache.maven.plugin.logging.Log;
-
 /**
  * A helper class for generation of reports based on issues.
  *
@@ -70,42 +67,14 @@ public class IssuesReportHelper {
      * @return A List of column id:s
      */
     public static List<Integer> getColumnIds(String columnNames, Map<String, 
Integer> allColumns) {
-        return getColumnIds(columnNames, allColumns, null, null);
-    }
-
-    /**
-     * 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
-     * @param deprecatedColumns A mapping from deprecated column name to 
column id
-     * @param log A log
-     * @return A List of column id:s
-     */
-    public static List<Integer> getColumnIds(
-            String columnNames, Map<String, Integer> allColumns, Map<String, 
Integer> deprecatedColumns, Log log) {
-        DualHashBidiMap bidiColumns = null;
         List<Integer> columnIds = new ArrayList<>();
         String[] columnNamesArray = columnNames.split(",");
 
-        if (deprecatedColumns != null) {
-            bidiColumns = new DualHashBidiMap(allColumns);
-        }
-
         // Loop through the names of the columns, to validate each of them and 
add their id to the list
         for (String aColumnNamesArray : columnNamesArray) {
             String columnName = aColumnNamesArray.trim();
             if (allColumns.containsKey(columnName)) {
                 columnIds.add(allColumns.get(columnName));
-            } else if (deprecatedColumns != null && 
deprecatedColumns.containsKey(columnName)) {
-                Integer columnId = deprecatedColumns.get(columnName);
-                columnIds.add(columnId);
-                if (log != null) {
-                    log.warn("The columnName '" + columnName + "' has been 
deprecated." + " Please use "
-                            + "the columnName '" + 
bidiColumns.getKey(columnId) + "' instead.");
-                }
             }
         }
         return columnIds;
diff --git 
a/src/main/java/org/apache/maven/plugins/changes/trac/TracReport.java 
b/src/main/java/org/apache/maven/plugins/changes/trac/TracReport.java
index 3430ed9..df02258 100644
--- a/src/main/java/org/apache/maven/plugins/changes/trac/TracReport.java
+++ b/src/main/java/org/apache/maven/plugins/changes/trac/TracReport.java
@@ -44,10 +44,6 @@ import org.apache.xmlrpc.XmlRpcException;
  */
 @Mojo(name = "trac-report", threadSafe = true)
 public class TracReport extends AbstractChangesReport {
-    /**
-     * Deprecated Trac columns.
-     */
-    private static final Map<String, Integer> DEPRECATED_TRAC_COLUMNS = new 
HashMap<>();
 
     /**
      * Valid Trac columns.
@@ -55,19 +51,6 @@ public class TracReport extends AbstractChangesReport {
     private static final Map<String, Integer> TRAC_COLUMNS = new HashMap<>();
 
     static {
-        DEPRECATED_TRAC_COLUMNS.put("changed", 
IssuesReportHelper.COLUMN_UPDATED);
-        DEPRECATED_TRAC_COLUMNS.put("component", 
IssuesReportHelper.COLUMN_COMPONENT);
-        DEPRECATED_TRAC_COLUMNS.put("created", 
IssuesReportHelper.COLUMN_CREATED);
-        DEPRECATED_TRAC_COLUMNS.put("id", IssuesReportHelper.COLUMN_ID);
-        DEPRECATED_TRAC_COLUMNS.put("milestone", 
IssuesReportHelper.COLUMN_FIX_VERSION);
-        DEPRECATED_TRAC_COLUMNS.put("owner", 
IssuesReportHelper.COLUMN_ASSIGNEE);
-        DEPRECATED_TRAC_COLUMNS.put("priority", 
IssuesReportHelper.COLUMN_PRIORITY);
-        DEPRECATED_TRAC_COLUMNS.put("reporter", 
IssuesReportHelper.COLUMN_REPORTER);
-        DEPRECATED_TRAC_COLUMNS.put("resolution", 
IssuesReportHelper.COLUMN_RESOLUTION);
-        DEPRECATED_TRAC_COLUMNS.put("status", 
IssuesReportHelper.COLUMN_STATUS);
-        DEPRECATED_TRAC_COLUMNS.put("summary", 
IssuesReportHelper.COLUMN_SUMMARY);
-        DEPRECATED_TRAC_COLUMNS.put("type", IssuesReportHelper.COLUMN_TYPE);
-
         TRAC_COLUMNS.put("Assignee", IssuesReportHelper.COLUMN_ASSIGNEE);
         TRAC_COLUMNS.put("Component", IssuesReportHelper.COLUMN_COMPONENT);
         TRAC_COLUMNS.put("Created", IssuesReportHelper.COLUMN_CREATED);
@@ -138,8 +121,7 @@ public class TracReport extends AbstractChangesReport {
     @Override
     public void executeReport(Locale locale) throws MavenReportException {
         // Validate parameters
-        List<Integer> columnIds =
-                IssuesReportHelper.getColumnIds(columnNames, TRAC_COLUMNS, 
DEPRECATED_TRAC_COLUMNS, getLog());
+        List<Integer> columnIds = IssuesReportHelper.getColumnIds(columnNames, 
TRAC_COLUMNS);
         if (columnIds.size() == 0) {
             // This can happen if the user has configured column names and 
they are all invalid
             throw new MavenReportException(

Reply via email to