Maven WAR Plugin
  1. Maven WAR Plugin
  2. MWAR-150

Test for overlay.skip before resolving overlay dependency

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Implemented
    • Affects Version/s: 2.1-alpha-1
    • Fix Version/s: None
    • Component/s: overlay
    • Labels:
      None

      Description

      I have a "master" pom that many projects share and inherit common build, report, dependency, etc. functionality from. I would like all of my .war projects to inherit from this "master" pom including my overlays and my projects that use the overlay.

      In my master pom I have:

      		<pluginManagement>
      			<plugins>
      				<plugin>
      					<groupId>org.apache.maven.plugins</groupId>
      					<artifactId>maven-war-plugin</artifactId>
      					<version>2.1-alpha-1</version>
      					<configuration>
      						<overlays>
      							<overlay>
      								<groupId>com.mycompany.app</groupId>
      								<artifactId>my-overlay</artifactId>
      							</overlay>
      							<overlay></overlay>
      						</overlays>
      					</configuration>
      				</plugin>
      			</plugins>
      		</pluginManagement>
      

      This obviously causes a problem when the overlay war is created because it cannot overlay itself with itself. So I get the error:

      "overlay[ id com.mycompany.app:my-overlay] is not a dependency of the project."
      

      I tried overriding the war plugin in the overlay pom and removed the overlays but there seemed to be some kind of inheritance thing going on where the overlays were still being added no matter what I did. (Might be a different issue?)

      Anyway, another way to fix this issue might be to use the "skip" attribute??? But I get the same error using <skip>true</skip>. Would it be possible to allow the "skip" attribute to be tested prior to overlay dependency checking? I've provided an example project of how I would like skip to function in a clean way that might help this problem of circular overlays.

      Mike

      1. skip-overlay.zip
        4 kB
        Mike Youngstrom

        Activity

        Mike Youngstrom created issue -
        Stephane Nicoll made changes -
        Field Original Value New Value
        Component/s overlay [ 14514 ]
        Robert Scholte made changes -
        Description I have a "master" pom that many projects share and inherit common build, report, dependency, etc. functionality from. I would like all of my .war projects to inherit from this "master" pom including my overlays and my projects that use the overlay.

        In my master pom I have:
        [code]
        <pluginManagement>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1-alpha-1</version>
        <configuration>
        <overlays>
        <overlay>
        <groupId>com.mycompany.app</groupId>
        <artifactId>my-overlay</artifactId>
        </overlay>
        <overlay></overlay>
        </overlays>
        </configuration>
        </plugin>
        </plugins>
        </pluginManagement>
        [/code]

        This obviously causes a problem when the overlay war is created because it cannot overlay itself with itself. So I get the error:

        "overlay[ id com.mycompany.app:my-overlay] is not a dependency of the project."

        I tried overriding the war plugin in the overlay pom and removed the overlays but there seemed to be some kind of inheritance thing going on where the overlays were still being added no matter what I did. (Might be a different issue?)

        Anyway, another way to fix this issue might be to use the "skip" attribute??? But I get the same error using <skip>true</skip>. Would it be possible to allow the "skip" attribute to be tested prior to overlay dependency checking? I've provided an example project of how I would like skip to function in a clean way that might help this problem of circular overlays.

        Mike
        I have a "master" pom that many projects share and inherit common build, report, dependency, etc. functionality from. I would like all of my .war projects to inherit from this "master" pom including my overlays and my projects that use the overlay.

        In my master pom I have:
        {code:xml}
        <pluginManagement>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.1-alpha-1</version>
        <configuration>
        <overlays>
        <overlay>
        <groupId>com.mycompany.app</groupId>
        <artifactId>my-overlay</artifactId>
        </overlay>
        <overlay></overlay>
        </overlays>
        </configuration>
        </plugin>
        </plugins>
        </pluginManagement>
        {code}

        This obviously causes a problem when the overlay war is created because it cannot overlay itself with itself. So I get the error:
        {noformat}
        "overlay[ id com.mycompany.app:my-overlay] is not a dependency of the project."
        {noformat}
        I tried overriding the war plugin in the overlay pom and removed the overlays but there seemed to be some kind of inheritance thing going on where the overlays were still being added no matter what I did. (Might be a different issue?)

        Anyway, another way to fix this issue might be to use the "skip" attribute??? But I get the same error using {{<skip>true</skip>}}. Would it be possible to allow the "skip" attribute to be tested prior to overlay dependency checking? I've provided an example project of how I would like skip to function in a clean way that might help this problem of circular overlays.

        Mike
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:28:45 UTC 2015 [ 1428240525159 ]
        Mark Thomas made changes -
        Workflow jira [ 12728564 ] Default workflow, editable Closed status [ 12764747 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 01:49:55 UTC 2015 [ 1428284995525 ]
        Mark Thomas made changes -
        Workflow jira [ 12966478 ] Default workflow, editable Closed status [ 13002825 ]
        Karl Heinz Marbaise made changes -
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Implemented [ 10 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Mike Youngstrom
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development