Class OverlayManager
java.lang.Object
org.apache.maven.plugins.war.overlay.OverlayManager
Manages the overlays.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate 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.(package private) org.apache.maven.artifact.Artifact
getAssociatedArtifact
(Overlay overlay) Returns the Artifact associated to the specified overlay.Returns the id of the resolved overlays.Returns the resolved overlays.private List
<org.apache.maven.artifact.Artifact> Returns a list of WARArtifact
describing the overlays of the current project.(package private) void
initialize
(String[] defaultIncludes, String[] defaultExcludes, Overlay currentProjectOverlay) Initializes the manager and validates the overlays configuration.
-
Field Details
-
overlays
-
project
private final org.apache.maven.project.MavenProject project -
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 overlaysproject
- the maven projectdefaultIncludes
- the default includes to usedefaultExcludes
- the default excludes to usecurrentProjectOverlay
- the overlay for the current project- Throws:
InvalidOverlayConfigurationException
- if the config is invalid
-
-
Method Details
-
getOverlays
Returns the resolved overlays.- Returns:
- the overlays
-
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 usedefaultExcludes
- the default excludes to usecurrentProjectOverlay
- 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 overlayartifact
- the artifact- Returns:
- boolean true if equals
-
getOverlaysAsArtifacts
Returns a list of WARArtifact
describing the overlays of the current project.- Returns:
- the overlays as artifacts objects
-