@Helmut persistence.xml is not just about listing entities. You also configure the EntityManagerFactory via this thing. So if you have multiple, which one wins when they all specify a javax.persistence.spi.PersistenceUnitTransactionType or a javax.sql.DataSource or a ...? And it is a complete misnomer that JPA forces you to bundle all your entities into one jar. The JPA spec specifically calls out allowing discovery of "managed classes" (entities, listeners, etc). However, as I point out, allowing multiple persistence.xml files is not a good extension added by OSGi JPA, unless it gives veru strict rules over how conflicting settings are supposed to be handled.
@Helmut persistence.xml is not just about listing entities. You also configure the EntityManagerFactory via this thing. So if you have multiple, which one wins when they all specify a javax.persistence.spi.PersistenceUnitTransactionType or a javax.sql.DataSource or a ...? And it is a complete misnomer that JPA forces you to bundle all your entities into one jar. The JPA spec specifically calls out allowing discovery of "managed classes" (entities, listeners, etc). However, as I point out, allowing multiple persistence.xml files is not a good extension added by OSGi JPA, unless it gives veru strict rules over how conflicting settings are supposed to be handled.