11 Replies Latest reply on Jul 13, 2018 8:20 AM by kos.prov

    Generating application.xml for Enterprise Archive?

    michaelschuetz

      Hi to all,

       

      typical EAR file build by ShrinkWrap looks like this:

       

      {code}

      @Deployment
          public static Archive<?> getTestArchive() {
              final WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
              final JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "test.jar")
                      .addClasses(MyService.class, MyServiceBean.class);
              final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class,
                      "test.ear")
                      .setApplicationXML("application.xml")
                      .addModule(war)
                      .addModule(ejb);

       

              return ear;
          }

      {code}

       

      AFAIK it is required to set application.xml explicitely.

       

      For most usecases generating application.xml (like maven ear plugin does) would probably be sufficient.

      So, if you don't set application.xml, would be nice that ShrinkWrap generates it (or a generateApplicationXML method if you don't like automagic).

       

      What do you think?

       

       

      Thanks and regards

      Michael