I created a pom with several profiles in, one profile containing parameters (username and password) that need to be supplied. If I run maven command line with -Duser=blah -Dsecret=blah, it seems to work. However, I don't find a consistent way of configuring IntelliJ to use these parameters.
I select the Profile in the Maven Projects view, and I tried to supply those parameters in all kinds of ways on the junit configuration but it's not being picked up. What seems to work i creating a Run Configuration for maven on the Maven Projects tab, for example compile, and supplying the parameters to that configuration. Then each time I launch that maven compile configuration, the next junit runs will pick the parameters up, it seems. That is to say, as long as the JUnit Run Configuration existed before I ran the Maven Run Configuration. For a new test I need to rerun the maven configuration, if I relaunch the editor I need to do so, and so on. Is there any consistent way of supplying parameters to the maven profile in the JUnit configuration (I would like to have it in the JUnit configuration, must be possible because there's clearly a link between the selected maven profile and the junit configuration, different profiles yield clearly different results, it just seems to not want to work with parameters in the profile). Is this a bug in the editor or one in my head?