Class ChangePomVersion

java.lang.Object
de.oktoflow.platform.cmdTools.ChangePomVersion

public class ChangePomVersion extends Object
Changes POM versions.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

  • Method Details

    • isValid

      private boolean isValid()
      Returns whether the setup is valid.
      Returns:
      true for valid, false else
    • scan

      private void scan(File file)
      Scans file.
      Parameters:
      file - file or directory to scan for processing
    • process

      private void process(File file)
      Processes file.
      Parameters:
      file - the file (not directory) to process
    • stripSuffix

      private static String stripSuffix(String text, String suffix)
      Strips the suffix.
      Parameters:
      text - the text to modify
      suffix - the suffix to look for
      Returns:
      the text with suffix replaced
    • replaceManifestVersion

      private static PomReader.Result replaceManifestVersion(File file, String oldVersion, String newVersion) throws IOException
      Replaces bundle versions in Manifest files.
      Parameters:
      file - the file to modify
      oldVersion - the old (mvn) version
      newVersion - the new (mvn) version
      Returns:
      the result state
      Throws:
      IOException - if reading/writing fails
    • isOk

      private boolean isOk(File file)
      Returns whether a file is ok according to inclusion and exclusion patterns.
      Parameters:
      file - the file to check
      Returns:
      true for ok, false else
    • getArg

      public static String getArg(String[] args, String argName, String dflt)
      Emulates reading a Spring-like parameter if the configuration is not yet in place.
      Parameters:
      args - the arguments
      argName - the argument name (without PARAM_PREFIX or PARAM_VALUE_SEP)
      dflt - the default value if the argument cannot be found
      Returns:
      the value of argument or deflt
    • main

      public static void main(String[] args)
      Changes POM versions.
      Parameters:
      args -