Class OverlayManager

java.lang.Object
org.apache.maven.plugins.war.overlay.OverlayManager

public class OverlayManager extends Object
Manages the overlays.
  • Field Details

    • overlays

      private final List<Overlay> overlays
    • project

      private final org.apache.maven.project.MavenProject project
    • artifactsOverlays

      private final List<org.apache.maven.artifact.Artifact> artifactsOverlays
  • Constructor Details

    • OverlayManager

      public OverlayManager(List<Overlay> overlays, org.apache.maven.project.MavenProject project, String[] defaultIncludes, String[] defaultExcludes, Overlay currentProjectOverlay) throws InvalidOverlayConfigurationException
      Creates a manager with the specified overlays. Note that the list is potentially updated by the manager so a new list is created based on the overlays.
      Parameters:
      overlays - the overlays
      project - the maven project
      defaultIncludes - the default includes to use
      defaultExcludes - the default excludes to use
      currentProjectOverlay - the overlay for the current project
      Throws:
      InvalidOverlayConfigurationException - if the config is invalid
  • Method Details

    • getOverlays

      public List<Overlay> getOverlays()
      Returns the resolved overlays.
      Returns:
      the overlays
    • getOverlayIds

      public List<String> getOverlayIds()
      Returns the id of the resolved overlays.
      Returns:
      the overlay ids
    • initialize

      void initialize(String[] defaultIncludes, String[] defaultExcludes, Overlay currentProjectOverlay) throws InvalidOverlayConfigurationException
      Initializes the manager and validates the overlays configuration.
      Parameters:
      defaultIncludes - the default includes to use
      defaultExcludes - the default excludes to use
      currentProjectOverlay - the overlay for the current project
      Throws:
      InvalidOverlayConfigurationException - if the configuration is invalid
    • getAssociatedArtifact

      org.apache.maven.artifact.Artifact getAssociatedArtifact(Overlay overlay) throws InvalidOverlayConfigurationException
      Returns the Artifact associated to the specified overlay. If the overlay defines the current project, null is returned. If no artifact could not be found for the overlay a InvalidOverlayConfigurationException is thrown.
      Parameters:
      overlay - an overlay
      Returns:
      the artifact associated to the overlay
      Throws:
      InvalidOverlayConfigurationException - if the overlay does not have an associated artifact
    • compareOverlayWithArtifact

      private boolean compareOverlayWithArtifact(Overlay overlay, org.apache.maven.artifact.Artifact artifact)
      Compare groupId invalid input: '&'invalid input: '&' artifactId invalid input: '&'invalid input: '&' type invalid input: '&'invalid input: '&' classifier.
      Parameters:
      overlay - the overlay
      artifact - the artifact
      Returns:
      boolean true if equals
    • getOverlaysAsArtifacts

      private List<org.apache.maven.artifact.Artifact> getOverlaysAsArtifacts()
      Returns a list of WAR Artifact describing the overlays of the current project.
      Returns:
      the overlays as artifacts objects