How to declare @AnyMetaDef when @Any is in another jar

The model is probably incorrect, but the abstract class ROLE is in a dependency.
But his attribute “actor” is of type @ANY, so I have to pass his @AnyMetaDef to him.
In my example, if I put it in ecore.jar @AnyMetaDef it does not know the implementations and if I put it in efluid.jar, when loading the persistent.xml in ecore, it will tell me that it cannot find any @AnyMetaDef with the name “ACTEUR”.

An idea ?

2021-06-09 17_47_21-PlantUML Web Server

@Table(name = "TROLE")
@Inheritance(strategy = SINGLE_TABLE)
@DiscriminatorColumn(name="ROLE", length = 80)
public abstract class Role  {

  @Any(metaDef = "ACTEUR", metaColumn = @Column(name = "ACTEUR_ROLE", length = 80), fetch = LAZY)
  @JoinColumn(name = "ACTEUR_ID", columnDefinition = "varchar2(80 char)")
  private ActeurEcore acteur;
} in efluid.jar

      name = "ACTEUR",
      idType = "string",
      metaType = "string",
      metaValues = {
        @MetaValue(value = "", targetEntity = Acteur.class),
        @MetaValue(value = "", targetEntity = ActeurGenerique.class),
        @MetaValue(value = "", targetEntity = ActeurInterne.class),
        @MetaValue(value = "", targetEntity = AgenceBancaire.class),
        @MetaValue(value = "", targetEntity = Agent.class)

Basically instead of throwing an exception if an @AnyMetaDef already exists with the same name, perform a merge

	public void addAnyMetaDef(AnyMetaDef defAnn) {
		if ( anyMetaDefs == null ) {
			anyMetaDefs = new HashMap<>();
		else {
			if ( anyMetaDefs.containsKey( ) ) {
				throw new AnnotationException( "Two @AnyMetaDef with the same name defined: " + );

		anyMetaDefs.put(, defAnn );

I implemented a solution which I am not sure of its effectiveness.

I created a with the @AnyMetaDef annotation in ecore jar and the same in the same package in efluid.jar but this time with all possible implementations.

So I end up with 2 in the same package but not in the same jar.

It always gets me the one from efluid.jar, but it’s probably related to the order of the classpath …