while (entries.hasMoreElements()) {
String entry = (String)entries.nextElement();
//if directly under WEB-INF/lib
if (entry.endsWith(JAR_SUFFIX) &&
entry.indexOf(SEPARATOR_CHAR, WEB_INF_LIB.length() + 1 ) == -1 ) {
ReadableArchive weblibJarArchive = archive.getSubArchive(entry);
if (weblibJarArchive.exists(META_INF_BEANS_XML)) {
if ( logger.isLoggable( FINE ) ) {
logger.log(FINE,
CDILoggerInfo.WEB_INF_LIB_CONSIDERING_BEAN_ARCHIVE,
new Object[]{ entry });
}
weblibJarsThatAreBeanArchives.add(weblibJarArchive);
// This is causing tck failures, specifically
// MultiModuleProcessingTest.testProcessedModulesCount
// creating a bda for an extionsion that does not include a beans.xml is handled later
// when annotated types are created by that extension. This is done in
// DeploymentImpl.loadBeanDeploymentArchive(Class<?> beanClass)
// } else if (weblibJarArchive.exists(META_INF_SERVICES_EXTENSION)) {
// if ( logger.isLoggable( FINE ) ) {
// logger.log(FINE, "-WEB-INF/lib: considering " + entry
// + " as an extension and creating another BDA for it");
// }
// weblibJarsThatAreBeanArchives.add(weblibJarArchive);
} else {
// Check for classes annotated with qualified annotations
URI entryPath = new File(context.getSourceDir().getAbsolutePath(), entry).toURI();
if (WeldUtils.hasCDIEnablingAnnotations(context, entryPath)) {
if ( logger.isLoggable( FINE ) ) {
logger.log(FINE,
CDILoggerInfo.WEB_INF_LIB_CONSIDERING_BEAN_ARCHIVE,
new Object[]{ entry });
}
weblibJarsThatAreBeanArchives.add(weblibJarArchive);
} else {
if ( logger.isLoggable( FINE ) ) {
logger.log(FINE,
CDILoggerInfo.WEB_INF_LIB_SKIPPING_BEAN_ARCHIVE,
new Object[]{ archive.getName() } );
}
}
}
}
}
//process all web-inf lib JARs and create BDAs for them
List<BeanDeploymentArchiveImpl> webLibBDAs = new ArrayList<BeanDeploymentArchiveImpl>();
if (weblibJarsThatAreBeanArchives.size() > 0) {
ListIterator<ReadableArchive> libJarIterator = weblibJarsThatAreBeanArchives.listIterator();
while (libJarIterator.hasNext()) {
ReadableArchive libJarArchive = (ReadableArchive)libJarIterator.next();
BeanDeploymentArchiveImpl wlbda = new BeanDeploymentArchiveImpl(libJarArchive,
ejbs, context,
WEB_INF_LIB + SEPARATOR_CHAR + libJarArchive.getName() /* Use WEB-INF/lib/jarName as BDA Id*/);
this.beanDeploymentArchives.add(wlbda); //add to list of BDAs for this WAR
webLibBDAs.add(wlbda);
}
}
ensureWebLibJarVisibility(webLibBDAs);