I have a better solution applying the JPA 2.2 patch as the `doLast` for the `installWildFly` task. In theory what this should do is to only apply the patch when we actually do the install. However, there is a minor annoyance that I'm not sure there is a great way to resolve. Essentially we have 3 things that write to the same directory structure: install, patch and modules. Install and patch logically go together, which is the change I made. But even then we still have 2 tasks writing to that same dir: install (+ patch) and our modules. What is the practical implication? Given the new combined install+patch task, I can run `installWildFly` multiple times and the install and patch are performed just once. Perfect. However, because `installHibernateModule` writes to the same directory as soon as that task is run it "dirties" the up-to-date checks for `installWildFly` and it will get run next time regardless. The "proper" solution would be to:
- "install" WF into a tmp dir
- apply the JPA 2.2 patch
- copy the patched version to the "real" dir
- apply the Hibernate modules
Of course another way to look at this is that we could (and should) probably look at the patching itself as a "org.hibernate.javax.persistence:hibernate-jpa-api-2.2-wildflymodules" task. Then we would just get the patched WildFly from there and continue on here as normal. |