Skip to content

Commit

Permalink
AS7-2164 Warn if CDI annotations present but no beans.xml
Browse files Browse the repository at this point in the history
  • Loading branch information
esantana authored and jharting committed Sep 3, 2012
1 parent fb52a2a commit 1566413
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Expand Up @@ -30,6 +30,7 @@
import org.jboss.as.server.AbstractDeploymentChainStep;
import org.jboss.as.server.DeploymentProcessorTarget;
import org.jboss.as.server.deployment.Phase;
import org.jboss.as.weld.deployment.CdiAnnotationProcessor;
import org.jboss.as.weld.deployment.processors.BeanArchiveProcessor;
import org.jboss.as.weld.deployment.processors.BeansXmlProcessor;
import org.jboss.as.weld.deployment.processors.WebIntegrationProcessor;
Expand Down Expand Up @@ -61,6 +62,7 @@ protected void performBoottime(OperationContext context, ModelNode operation, Mo
context.addStep(new AbstractDeploymentChainStep() {
protected void execute(DeploymentProcessorTarget processorTarget) {
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.DEPENDENCIES, Phase.DEPENDENCIES_WELD, new WeldDependencyProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_CDI_ANNOTATIONS, new CdiAnnotationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.PARSE, Phase.PARSE_WELD_DEPLOYMENT, new BeansXmlProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_WEB_INTEGRATION, new WebIntegrationProcessor());
processorTarget.addDeploymentProcessor(WeldExtension.SUBSYSTEM_NAME, Phase.POST_MODULE, Phase.POST_MODULE_WELD_BEAN_ARCHIVE, new BeanArchiveProcessor());
Expand Down
Expand Up @@ -42,6 +42,7 @@
import org.jboss.as.weld.WeldMessages;
import org.jboss.as.weld.deployment.BeanArchiveMetadata;
import org.jboss.as.weld.deployment.BeansXmlParser;
import org.jboss.as.weld.deployment.CdiAnnotationMarker;
import org.jboss.as.weld.deployment.WeldDeploymentMetadata;
import org.jboss.vfs.VirtualFile;
import org.jboss.weld.bootstrap.spi.BeansXml;
Expand Down Expand Up @@ -121,6 +122,10 @@ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitPro
if (deploymentUnit.getParent() != null) {
WeldDeploymentMarker.mark(deploymentUnit.getParent());
}
} else {
if (CdiAnnotationMarker.isCdiDeployment(deploymentUnit)) {
WeldLogger.DEPLOYMENT_LOGGER.warn("Deployment contains CDI annotations but beans.xml was not found.");
}
}
}

Expand Down

0 comments on commit 1566413

Please sign in to comment.