My understanding of the alternative is that it is an alternative to some other interface implementation that you can use in a different deployment environment (for example, in a testing environment). An alternate bean is declared by annotating it using @Alternative .
To use the alternative in this deployment scenario, you select it in the <alternatives> element of the CDI META-INF/beans.xml deployment descriptor. This will enable @Alternative beans, which are disabled by default.
If enabled, if the container detects an ambiguous relationship for a given injection point, it will consider alternatives that can be introduced, and if there is exactly one, select this alternative.
In other words, alternatives are a good way to replace an existing implementation with another during deployment. If there is nothing to replace, you do not need alternatives, just put your jar on the class path. I’m not sure that this was exactly your question, although I doubt the concept of third-party cans.
More details in 2.1.4. Alternatives 4.6. Alternatives and 4.7. Eliminating unsatisfied and ambiguous dependencies (but I think this is what you read).
Update: To answer your additional question.
If not, how to use beans from third-party libraries that don't have beans.xml
This cannot be, the bean archive must have bean.xml (let it be empty), as described in section 15.6. Documentation packaging and deployment :
CDI does not define any special deployment archives. You can pack beans in a JAR, EJB-JAR, or WARs-any deployment location in a CLASSPATH application. However, the archive must be a "bean archive". This means that each archive containing beans must specify a file named beans.xml in the META-INF class path directory or WEB-INF web root directory (for WAR). The file may be empty. beans are deployed in archives that are not in the beans.xml file beans.xml not be available for use in the application.
Then, to correct the unsatisfied and controversial relationship, refer to the previously mentioned section 4.7.
Update 2: It seems that when using BeforeBeanDiscovery.addAnnotatedType() you can add other classes that must be considered when a bean is detected. ( BeforeBeanDiscovery - event)