war.addAsLibraries(libJar);
EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
ear.addAsModule(war);
JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "earLib.jar");
earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: ../cp1.jar\n".getBytes()), "MANIFEST.MF");
ear.addAsLibraries(earLib);
earLib = ShrinkWrap.create(JavaArchive.class, "cp1.jar");
earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: cp2.jar\n".getBytes()), "MANIFEST.MF");
ear.addAsModule(earLib);
earLib = ShrinkWrap.create(JavaArchive.class, "cp2.jar");
earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: a/b/c\n".getBytes()), "MANIFEST.MF");
earLib.addClass(TestBB.class);
ear.addAsModule(earLib);
ear.add(new StringAsset("Hello World"), "a/b/c", "testfile.file");