Indexer indexer = new Indexer();
indexer.index(cl.getResourceAsStream(GlobalModuleEjb.class.getName().replace(".","/") + ".class"));
indexer.index(cl.getResourceAsStream(GlobalModuleInterceptor.class.getName().replace(".", "/") + ".class"));
final Index index = indexer.complete();
final ByteArrayOutputStream out = new ByteArrayOutputStream();
IndexWriter writer = new IndexWriter(out);
writer.write(index);
jar.addAsManifestResource(new ByteArrayAsset(out.toByteArray()), "jandex.idx");
FileOutputStream jarFile = new FileOutputStream(new File(file, "globalTest.jar"));
try {