Class PluginUtils

java.lang.Object
ru.akman.maven.plugins.jpackage.PluginUtils

public final class PluginUtils extends Object
Helper class for utilities.
  • Method Details

    • wrapOpt

      public static String wrapOpt(String str, char wrapWith)
      Wraps an option string with a string if that one is missing from the start or end of the given option string. A new string will not be created if the given option string is already wrapped.
      Parameters:
      str - the option string to be wrapped, may be null
      wrapWith - the char that will wrap the given string
      Returns:
      the wrapped option string
    • getThrowableCause

      public static String getThrowableCause(Throwable throwable)
      Get the cause message for throwable.
      Parameters:
      throwable - the throwable
      Returns:
      the cause error message
    • normalizeFileSetBaseDir

      public static File normalizeFileSetBaseDir(File baseDir, org.apache.maven.shared.model.fileset.FileSet fileSet) throws IOException
      Fix base directory of the fileset by resolving it relative to the specified base directory.
      Parameters:
      baseDir - base directory
      fileSet - fileset
      Returns:
      normalized fileset dir
      Throws:
      IOException - if error occurred while resolving a canonical path
    • getArtifactSetDebugInfo

      public static String getArtifactSetDebugInfo(Set<org.apache.maven.artifact.Artifact> artifacts)
      Get debug info about artifact set.
      Parameters:
      artifacts - set of project artifacts
      Returns:
      formatted string contains info about the artifacts
    • getArtifactDebugInfo

      public static String getArtifactDebugInfo(org.apache.maven.artifact.Artifact artifact)
      Get debug info about the artifact.
      Parameters:
      artifact - the artifact
      Returns:
      formatted string contains info about the artifact
    • getPathElementsDebugInfo

      public static String getPathElementsDebugInfo(String title, List<File> pathelements)
      Get debug info about path elements.
      Parameters:
      title - title
      pathelements - list of path elements
      Returns:
      formatted string contains info about the path elements
    • getFileSetDebugInfo

      public static String getFileSetDebugInfo(String title, org.apache.maven.shared.model.fileset.FileSet fileSet, String data)
      Get debug info about a fileset.
      Parameters:
      title - title
      fileSet - fileset
      data - fileset data
      Returns:
      formatted string contains info about the fileset
    • getDependencySetDebugInfo

      public static String getDependencySetDebugInfo(String title, DependencySet depSet, String data)
      Get debug info about a dependencyset.
      Parameters:
      title - title
      depSet - dependencyset
      data - dependencyset data
      Returns:
      formatted string contains info about the dependencyset
    • getDependencyDebugInfo

      public static String getDependencyDebugInfo(File file, org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor descriptor, boolean isIncluded)
      Get debug info about a dependency.
      Parameters:
      file - the dependency file
      descriptor - the dependency descriptor
      isIncluded - will the dependency be included
      Returns:
      formatted string contains info about the dependency