2 Replies Latest reply on Sep 17, 2012 12:10 PM by alrubinger

    Shrinkwrap usage question (EAR patching)

    micka33

      Hi all,

       

      Here is what I would like to perform when preparing deployment of an Arquillian test (hopefully it's possible):

           1 - Get an ear from my local maven Repo

           2 - extract a given jar from this ear

           3 - update Manifest.MF embeded in the jar by replacing it by my own

           4 - update the ear with the modified jar

       

      I am struggling with the last step, meaning I cannot add my jar into the ear...

       

      here is my code so far :

      @Deployment(order = 1, name = "XXXX", testable = false)

          public static EnterpriseArchive createDeploymentForEmsWorkflowServices() {

              EnterpriseArchive ear = DependencyResolvers

                      .use(MavenDependencyResolver.class)

                      .configureFrom(SETTINGS_XML_PATH).goOffline()

                      .artifact(EAR_COORDINATES).resolveAs(EnterpriseArchive.class)

                      .iterator().next();

       

              JavaArchive ejbJar = ear.getAsType(JavaArchive.class, EMBEDED_EJB_NAME, ArchiveFormat.ZIP);

              ejbJar.setManifest("MANIFEST.MF");

                //STEP 4 => REINTGRATE PATCHED JAR

           return ear;

          }

       

      I could not find any samples by googling , so any help would be welcome.

       

      Regards