Skip to content

Commit 401fe82

Browse files
committed
Enforcing Weld to scan only those archives which have beans.xml in it. Otherwise any other 3rd party library which is using JSR-330 annotations will cause the deployment in CDI 1.1 environment (Java EE 7) to fail. For example Guava used in AngularJS tests. Related issue: javaee-samples#245
1 parent 3592a73 commit 401fe82

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

jaxrs/angularjs/src/test/java/org/javaee7/jaxrs/angularjs/NoteResourceImplTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.jboss.shrinkwrap.api.Archive;
1818
import org.jboss.shrinkwrap.api.GenericArchive;
1919
import org.jboss.shrinkwrap.api.ShrinkWrap;
20+
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
2021
import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
2122
import org.jboss.shrinkwrap.api.spec.WebArchive;
2223
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
@@ -49,6 +50,8 @@ public static Archive createDeployment()
4950
return ShrinkWrap.create(WebArchive.class, NoteResourceImplTest.class.getSimpleName() + ".war")
5051
.addClasses(Note.class, NoteApp.class, NoteResource.class, NoteResourceImpl.class)
5152
.addAsResource("META-INF/persistence.xml")
53+
.addAsWebInfResource("enforce-beans.xml", "jboss-all.xml")
54+
.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
5255
.addAsLibraries(seleniumApi)
5356
.merge(webResources);
5457
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<jboss xmlns="urn:jboss:1.0">
3+
<weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
4+
</jboss>

0 commit comments

Comments
 (0)