Class ModuleIdentifierValidator


  • public class ModuleIdentifierValidator
    extends java.lang.Object
    This class will check the list of modules if there exist a duplicate artifactId. If we have such case it's necessary to create a warning to the user otherwise it can happen to overwrite existing artifacts during the EAR creation process. This is a temporary solution to keep backward compatibility with previous versions. For the next major release 3.X the creation of the EAR archive should be done based on unique identifiers like groupId:artifactId:version.
    • Field Detail

      • earModules

        private java.util.List<EarModule> earModules
      • result

        private java.util.Map<java.lang.String,​java.util.List<EarModule>> result
    • Constructor Detail

      • ModuleIdentifierValidator

        public ModuleIdentifierValidator​(java.util.List<EarModule> earModules)
        Parameters:
        earModules - The list of EarModule which will be checked.
    • Method Detail

      • existDuplicateArtifacts

        public boolean existDuplicateArtifacts()
        You have to call checkForDuplicateArtifacts() before otherwise you will get always false.
        Returns:
        true in case of existing duplicates false otherwise.
      • checkForDuplicateArtifacts

        public ModuleIdentifierValidator checkForDuplicateArtifacts()
        Trigger the module list check.
        Returns:
        this for fluent usage.
      • analyze

        private void analyze()
      • getDuplicateArtifacts

        public java.util.Map<java.lang.String,​java.util.List<EarModule>> getDuplicateArtifacts()
        Returns:
        A map of duplicate artifacts.
      • getEarModules

        public java.util.List<EarModule> getEarModules()
        Returns:
        The list of EarModule