Sometimes, when one of your modules is used by different applications, but requires slight changes, you want to create different artifacts, that can be direct dependencies of those applications.
You can do this by using profiles and classifiers.
You can create your pom, the usual way, with profiles…more here, then apply classifiers to the package plugin inside your profile, like this:
This will produce an artifact with finalName
that will be accessible by specifying the classifier in your dependency.
Just remember to use executions because it will not work otherwise. It will build the artifacts, but will not deploy them.