All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.itemis.maven.plugins.unleash.util.functions.PluginToString Maven / Gradle / Ivy

Go to download

This plugin provides a generic alternative to the error-prone default release plugin provided by Maven. It is designed to require a minimal effort of work for releasing modules and being extensible to integrate in every project setup.

There is a newer version: 2.10.0
Show newest version
package com.itemis.maven.plugins.unleash.util.functions;

import org.apache.maven.model.Plugin;

import com.google.common.base.Function;

/**
 * A function to convert a {@link Plugin} to its String representation in coordinates format.
 *
 * @author Stanley Hillner
 * @since 1.0.0
 */
public enum PluginToString implements Function {
  INSTANCE;

  @Override
  public String apply(Plugin p) {
    StringBuilder sb = new StringBuilder(p.getGroupId()).append(":").append(p.getArtifactId());
    if (p.getVersion() != null) {
      sb.append(":").append(p.getVersion());
    }
    return sb.toString();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy