you would have to implement and register Weld resource injection SPI, ie. either
org.jboss.weld.injection.spi.ResourceInjectionServices. See also EE resource injection and resolution services and Registering services. If using Weld SE you could also subclass
Weld.createDeployment(ResourceLoader, CDI11Bootstrap)and register SPI service programatically -
What is the difference between a Service and a WeldBeanDeploymentArchive?
Also how to map the JNDI name to the bean, in my case "java:comp/env/ds"?
BeanDeploymentArchiverepresents a CDI bean archive whereas Weld SPI
Serviceimplementation makes it possible to integrate Weld in various environments. In your case, I would probably start with implementing
org.jboss.weld.injection.spi.InjectionServices.aroundInject(), ie. find all resource injection points, do a JNDI lookup manually and set the field.