5 Replies Latest reply on Apr 14, 2011 6:09 PM by Aslak Knutsen

    Add entire package to Archive?

    Mark Temple Newbie

      Is there a way to add an entire package to a generated archive?

      Say you have a class structure in your project like this:

       

      com.project.beans (30 classes)

      com.project.model (45 classes)

      com.project.services (30 classes)

       

      When you create the Archive it looks something like this:

      @Deployment

          public static JavaArchive createTestArchive() {

              return ShrinkWrap

                      .create(JavaArchive.class, "test.jar")

                      // I know how to add a class one at a time...

                      .addPackage(Sample.class.getPackage())

                      // How can we add all under com.project.beans?

                      // How can we add all under com.project.model?

                      // How can we add all under com.project.services?

                      .addAsManifestResource("persistence.xml",

                              ArchivePaths.create("persistence.xml"))

                      .addAsManifestResource(EmptyAsset.INSTANCE,

                              ArchivePaths.create("beans.xml"));

      }

       

      Is there a way to somehow say add everthing under com?

       

      Thanks,

      Mark