I’m trying to create my custom nifi controller service. For that I have to create maven project in eclipse based on the nifi-service-bundle-archetype. When doing so the following structure is created:
-Project
-- ContollerService
---pom.xml
-- ContollerService-api
---pom.xml
-- ContollerService-api-nar
---pom.xml
-- ContollerService-nar
---pom.xml
-pom.xml
The project has its own pom.xml in addition to the sub modules and each sub module has its its own pom.xml
The project pom.xml looks like this:
<project ...>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
<version>1.16.0</version>
</parent>
<groupId>nifi</groupId>
<artifactId>ContollerService</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<modules>
<module>ContollerService-api</module>
<module>ContollerService-api-nar</module>
<module>ContollerService</module>
<module>ContollerService-nar</module>
</modules>
</project>
The submodule has dependency on different nifi packages.
The problem Im facing is that Im trying to create two different build for two different nifi versions 1.16.0 and 2.0.0-M3 . The question I have is what is the best way I can manage two different nifi verions in the same project given the following constraints:
1- nifi version 1.16 use java 1.8 while 2.0.0-M3 uses java 21
2- in the project pom when the nifi version is 1.16 the parent is:
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-nar-bundles</artifactId>
<version>1.16.0</version>
</parent>
however for version 2.0.0M3 uses different parent package:
<parent>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-extension-bundles</artifactId>
<version>2.0.0-M3</version>
</parent>
My goal is create different maven build against different version which will take care of the following:
1- apply the correct package (with the correct version) to the project pom.
2- apply the proper nifi dependency version in each sub module.
3- apply the proper java build (if I have to create different build profile to handle that no big deal).
I tried profiling and I tried using properties but nothing seem to help completely. for profiling I still had to change the parent packageversion manually for each different versionbuild.
Can sonmeone help please.
Thanks