org.apache.maven.plugin.issues.AbstractIssueManagementSystem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of maven-changes-plugin Show documentation
Show all versions of maven-changes-plugin Show documentation
Creates a release history for inclusion into the site and assists in generating an announcement mail.
package org.apache.maven.plugin.issues;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import java.util.HashMap;
import java.util.Map;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.changes.IssueType;
/**
* Historically, this plugin started out working against an IMS-neutral XML file, and then added extensive support for
* JIRA with some small snippets of code for other issue management systems. This class is intended to start a cleaner
* modularity for support of multiple systems.
* 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}.
* Note that the map in here is not 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: AbstractIssueManagementSystem.java 1379901 2012-09-01 23:44:49Z dennisl $
*/
public abstract class AbstractIssueManagementSystem
implements IssueManagementSystem
{
protected Map issueTypeMap;
protected AbstractIssueManagementSystem()
{
issueTypeMap = new HashMap();
}
/* (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#getIssueTypeMap()
*/
public Map getIssueTypeMap()
{
return issueTypeMap;
}
/* (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#getName()
*/
public abstract String getName();
/* (non-Javadoc)
* @see org.apache.maven.plugin.issues.IssueManagementSystem#applyConfiguration(java.util.Map)
*/
public void applyConfiguration( Map issueTypes )
throws MojoExecutionException
{
for ( Map.Entry me : issueTypes.entrySet() )
{
IssueType type = IssueType.lookupByKey( me.getKey() );
if ( type == null )
{
throw new MojoExecutionException( "Invalid issue action " + me.getKey() );
}
String imsTypes = me.getValue();
String[] imsTypeArray = imsTypes.split( "," );
for ( String imsType : imsTypeArray )
{
issueTypeMap.put( imsType, type );
}
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy