I have two Jars A and B where A depends on B.
Jar B has a single class:
@ApplicationScoped
public class MyMa
One thing, you have to create Qulifier annotation for specify exactly which should be injected.
@Qualifier
@Retention(RUNTIME)
@Target({METHOD, FIELD, PARAMETER, TYPE})
public @interface UserConfiguration { }
and then..
@Produces
@UserConfiguration
@Named("user")
public String getUser(){
return "myUser";
}
for injection..
@Inject
public MyManagedBean(@UserConfiguration String user){
this.user = user;
}
see also http://docs.jboss.org/weld/reference/1.1.0.Final/en-US/html_single/#d0e1355