Class VersionMapper

java.lang.Object
org.apache.maven.ant.tasks.support.VersionMapper
All Implemented Interfaces:
Comparator<String>, org.apache.tools.ant.util.FileNameMapper

public class VersionMapper extends Object implements org.apache.tools.ant.util.FileNameMapper, Comparator<String>
Ant filename mapper to remove version info from filename when copying dependencies.
  • Field Details

  • Constructor Details

    • VersionMapper

      public VersionMapper()
  • Method Details

    • mapFileName

      public String[] mapFileName(String sourceFileName)
      Specified by:
      mapFileName in interface org.apache.tools.ant.util.FileNameMapper
    • setFrom

      public void setFrom(String from)
      Set the versions identifiers that this mapper can remove from filenames. The separator value used is path separator, as used by dependencies task when setting versionsId property value.
      Specified by:
      setFrom in interface org.apache.tools.ant.util.FileNameMapper
      Parameters:
      from - The string from which we set.
    • setTo

      public void setTo(String to)
      By default, only filename is changed, but if this attribute is set to flatten, directory is removed.
      Specified by:
      setTo in interface org.apache.tools.ant.util.FileNameMapper
      Parameters:
      to - to
    • compare

      public int compare(String s1, String s2)
      Specified by:
      compare in interface Comparator<String>