I have maven.test.skip set to true in my settings.xml. The tests are
still skipped when I run 'mvn -Dmaven.test.skip=false install'. Is this
a bug or is it intentional?
SAME QUESTION, MORE DETAIL:
===========================
I have maven.test.skip set to true in my ~/.m2/settings.xml file. I did
it like this:
<settings>
<profiles>
<profile>
<id>blah</id>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>blah</activeProfile>
</activeProfiles>
</settings>
Sometimes, I would like to set it to false, overriding the setting from
my profile. I would like to do this on the command line, like so:
mvn -Dmaven.test.skip=false install
However, my setting on the command line seems to be ignored. The tests
are still skipped, even if I set maven.test.skip=false in this manner. I
find this behavior to be surprising. I would expect the value I
expressed on the command line to override any settings from pom.xml or
settings.xml.
So I wondered if perhaps the surefire plugin was ignoring the value of
the property and just checking if the property was set or not. In other
words, I wondered if setting maven.test.skip to 'false' (or 'carrots',
or anything) would have the same effect as setting it to true. To test,
I removed maven.test.skip from my settings.xml file and set the value on
the command line. I found that surefire does indeed pay attention to the
value. Setting maven.test.skip=true would skip the tests, but setting
maven.test.skip=false would not skip the tests.
So it seems that the value in my settings.xml file cannot be overridden
on the command line. Is this a bug, or is this intentional? If it is
intentional, why? It seems to me that property values specified
explicitly on the command line should override any property values from
pom.xml or settings.xml files.
Thanks,
-Max
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]