Faktor-IPS Build Evolution: from Antscripts to Maven Plugins
Faktor IPS projects are built with Eclipse, everything is checked in and only the Java files are compiled in the build. Why is that?
Because the build needs a full Eclipse to be called "headless" and then run Ant scripts - very complicated. Nevertheless, some customers have implemented this at least for their product projects (including a build job that installs the appropriate Eclipse for the Faktor-IPS build job on the build server) to have the assurance that the checked-in product data is fully valid. We also used this ourselves for integration testing of Faktor-IPS.
But in times of Maven and Continuous Builds, this sounds very cumbersome. So we evaluated (after more and more customers supported such a development in the Faktor-IPS community) how to simplify the process. For quite some time, we have been using Eclipse Tycho to build the Faktor-IPS plugins. Tycho provides a bridge between the world of Maven projects and that of Eclipse plugins. Based on this, we wrote our own Maven plugin that only loads the plugins needed for the build in an Eclipse runtime and builds a Faktor IPS project.
Integrating it into your own projects is as easy as can be:
<plugin> <groupId>org.faktorips</groupId> <artifactId>faktorips-maven-plugin</artifactId> <version>21.6.3</version> <executions> <execution> <goals> <goal>faktorips-clean</goal> <goal>faktorips-build</goal> </goals> </execution> </executions> </plugin>
The use of additional plugins, such as the product variants, is also possible and described in the documentation. For example, the generated files can also be checked for changes compared to the state committed in Git, in order to let an automated Continuous Integration test fail if a project was checked in incompletely built.
For example, Faktor IPs files can be edited in a simple XML editor and then the plugin can be used to generate the changed Java code without having to start Eclipse even once. To further simplify this process, Faktor-IPS 21.12 (whose first milestone build is available at update.faktorzehn.org/faktorips/v21_12) will be able to write XML schema information in all files.
Your Faktor Zehn team