type=page
status=published
title=Configuring a CDI Application
next=cdi-basic014.html
prev=cdi-basic012.html
~~~~~~
= Configuring a CDI Application


[[GJBNZ]]

[[configuring-a-cdi-application]]
Configuring a CDI Application
-----------------------------

When your beans are annotated with a scope type, the server recognizes
the application as a bean archive and no additional configuration is
required. The possible scope types for CDI beans are listed in
link:cdi-basic008.html#GJBBK[Using Scopes].

CDI uses an optional deployment descriptor named `beans.xml`. Like other
Java EE deployment descriptors, the configuration settings in
`beans.xml` are used in addition to annotation settings in CDI classes.
The settings in `beans.xml` override the annotation settings if there is
a conflict. An archive must contain the `beans.xml` deployment
descriptor only in certain limited situations, described in
link:cdi-adv.html#GJEHI[Chapter 27, "Contexts and Dependency Injection
for Java EE: Advanced Topics"].

For a web application, the `beans.xml` deployment descriptor, if
present, must be in the `WEB-INF` directory. For EJB modules or JAR
files, the `beans.xml` deployment descriptor, if present, must be in the
`META-INF` directory.
