3 Replies Latest reply on May 28, 2013 11:10 AM by richard.emerson

    MavenImporter doesn't process war overlays?

    richard.emerson

      Hi,

       

      As far as I can tell, the new MavenImporter doesn't process war overlays as part of the Maven 'build' that it does.

       

      I do something like this:

       

      {code}

      WebArchive result = ShrinkWrap.create(MavenImporter.class)

                          .loadPomFromFile("pom.xml")

                          .importBuildOutput()

                          .as(WebArchive.class);

      {code}

       

      where the pom.xml (actually its parent pom) has a dependency like this:

       

      {code:xml}

      <dependency>

                <groupId>com.blah</groupId>

                <artifactId>common-web-resources</artifactId>

                <version>${version.common.web.resources}</version>

                <type>war</type>

                <scope>runtime</scope>

      </dependency>

      {code}

       

      and configures the maven-war-plugin like this:

       

       

      {code:xml}

      <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-war-plugin</artifactId>

                <configuration>

                          <overlays>

                                    <overlay>

                                              <groupId>com.blah</groupId>

                                              <artifactId>common-web-resources</artifactId>

                                              <excludes>

                                                        <exclude>META-INF/**</exclude>

                                                        <exclude>WEB-INF/lib/**</exclude>

                                              </excludes>

                                    </overlay>

                          </overlays>

                </configuration>

      </plugin>

      {code}

       

      The archive returned by .importBuildOutput doesn't contain any of the contents of the common-web-resources war.

       

      Does MavenImporter do an actual Maven build behind the scenes?

      - If so, does it avoid certain plugin executions or lifecycle phases?

      - Or, if not, should the 'importBuildOutput' method be renamed to something else?

       

      Many thanks,

      Richard