Hi fellow community members, I’d like to inform you about some recent improvements we’ve made regarding Gradle task execution and static weaving in our local development setup.
Background Previously, local development builds were occasionally inconsistent due to issues such as: Missing resource files Compilation errors due to missing classes Gradle cache inconsistencies Unnecessary recompilation of unchanged source files We’ve now addressed these problems, and you should no longer encounter them. Summary of Changes Gradle tasks and their dependencies have been thoroughly reviewed and optimized Static weaving processes have also been improved For new modules, static weaving is now automatically applied if naming and directory conventions are followed Static Weaving Configuration This section explains the static weaving setup for JPA entities in the Fineract project. Overview Static weaving enhances JPA entities during the build phase to improve runtime performance. We use `org.eclipse.persistence.tools.weaving.jpa.StaticWeave` to process compiled classes and apply bytecode transformations. Configuration Static weaving is defined in the `static-weaving.gradle` file and is applied to all Java projects containing JPA entities. How It Works Compilation: Java source files are compiled to `build/classes/java/main`. Weaving: The static weaving step is integrated into the end of the `compileJava` task, modifying the compiled classes in place. Adding Static Weaving to a Module To enable static weaving in a new module: Add JPA entities to `src/main/java` Include a `persistence.xml` file at `src/main/resources/jpa/static-weaving/module/[module-name]/` The build process will automatically detect and apply weaving Troubleshooting If you encounter issues with static weaving: Ensure `persistence.xml` is correctly placed Verify that output directories are properly created Review build logs for weaving-related errors Feel free to reach out if you have any questions or encounter issues. Best regards, Adam