code: @Override
      protected void addResource(final Resource resource) {
  
          if(resource != null) {
  
              final String newDirectory = resource.getDirectory();
  
              // Is the supplied resource already added?
              final List<Resource> currentResources = getProject().getResources();
  
              if(getLog().isDebugEnabled()) {
                  getLog().debug("Candidate Resource Directory [" + newDirectory + "]");
                  getLog().debug("Found [" + currentResources.size() + "] current Resources: "
                          + currentResources);
              }
  
              for (Resource current : currentResources) {
  
                  // Is the resource already added?
                  if(current.getDirectory() != null && current.getDirectory().equalsIgnoreCase(newDirectory)) {
                      getLog().debug("Resource already added [" + newDirectory + "]. Not adding again.");
                      return;
                  }
              }
  
              // Add the new Resource
              currentResources.add(resource);
  
              if(getLog().isDebugEnabled()) {
                  getLog().debug("Added resource [" + newDirectory + "] to existing resources.");
              }
          }
      }
docs: {@inheritDoc}