How to exclude a package from CDI scanning using @Vetoed annotation

Create a new Java file called package-info.java in the package you want to exclude. Then add the following code

@Vetoed
package org.shekhar.cdidemo.example;

import javax.enterprise.inject.Vetoed;
Advertisements