I’m trying to let maven run a single test class but I need to use an additional profile (which in fact is already created). Normally when I run:
mvn clean install -PmyProfile
“myProfile” is being activated. So I tried:
mvn -Dtest=myTest -PmyProfile test
Which resulted in “[WARNING]
Profile with id: ‘myProfile’ has not been activated.”
What am I doing wrong and how can I achieve my goal?
I cannot reproduce. I have a “sandbox” profile defined in my
~/.m2/settings.xmland the following command just works, without complains:While using an undefined profile generates the WARNING you’re talking about:
$ mvn -Dtest=AppTest -Pfoo test [INFO] Scanning for projects... [WARNING] Profile with id: 'foo' has not been activated. [INFO] ------------------------------------------------------------------------ [INFO] Building Q3372129 [INFO] task-segment: [test] [INFO] ------------------------------------------------------------------------ ...This begs the question: where is this profile defined?