Skip to main content

Posts

Showing posts from August, 2023

Useful maven recipes

 Filtering java sources using maven properties As you probably know, the maven resource plugin gives you the ability to create resources directory where the resource files will be filtered so that any maven properties defined in the build can be interpolated or substituted.  This allows you for example to create a properties file like: artifactid=${project.artifactId} when packaging this properties file the property artifactid will be set to the value of the maven project's artifactId. When using annotations, the strings used in the parameters must be know at compile time and if you want to use a maven property such as project.version, you cannot use the previous property file since the string will only be created at runtime.  This is where java filtered source files comes into play. What you need to do is in the parent POM shared by your application, add the following plugin exec...