Devskiller / jpa2ddl

JPA Schema Generator Plugin
Apache License 2.0
109 stars 33 forks source link

Explicitly sort annotated package and class names before adding them to MetadataSources to achieve platform independent repeatable builds #28

Closed afedotov closed 5 years ago

afedotov commented 5 years ago

Files.walkFileTree() has unpredictable iteration order, especially on different platforms like macOS and Windows. Also generated DDL script content depends on order in witch classes are added to metadata with MetadataSources.addAnnotatedClassName(). As a consequence, running same build on different platforms results in differing DDL scripts (in terms of table / column order). To ensure repeatable builds just explicitly sort package and class names before adding them to metadata.

jkubrynski commented 5 years ago

Thanks for the contribution!