Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-383

WARArchive.addAllDependencies() may create invalid libraries

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: core_1.0.0.Beta4
    • Fix Version/s: core_1.0.0.Beta5
    • Component/s: core
    • Labels:
      None

      Description

      Given a multi-module Maven project where the top-level module foo-web depends on modules foo-service and foo-model, where foo-web has jar packaging with a Main class

          public static void main(String[] args) throws Exception {
              Container container = new Container();
      
              WARArchive deployment = ShrinkWrap.create(WARArchive.class);
              deployment.addClass(LibraryBean.class);
              ClassLoader cl = Main.class.getClassLoader();
              deployment.addAsWebInfResource(new ClassLoaderAsset("WEB-INF/web.xml", cl), "web.xml");
              deployment.addAsWebInfResource(new ClassLoaderAsset("WEB-INF/faces-config.xml", cl), "faces-config.xml");
              deployment.addAsWebResource(new ClassLoaderAsset("books.xhtml", cl), "books.xhtml");
              deployment.addAllDependencies();
              container.start().deploy(deployment);
          }
      

      when the Main class is run directly from my Eclipse workspace, the dependent modules do not get discovered.

      When running mvn package and starting the Swarm JAR via java -jar foo-web-swarm.jar, everything is fine.

      This appears to be caused by ArtifactManager.allArtifacts() not providing a suitable archive name for class folders. A class folder like ../foo-service/target/classes will end up in the generated WAR as WEB-INF/lib/85cbee12-5c68-403d-8cd3-f088e315ec3f. Since this library is missing the .jar extension, it will be ignored.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                kenfinni Ken Finnigan
                Reporter:
                hwellmann.de Harald Wellmann
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: