I use variables in dependencies that are influenced by profiles. This is not working in flattened POM. What can I do?
In general dynamic dependencies should be avoided. However, you can move the dependency from the direct project dependencies into the dependencies of all relevant profiles.