???????Maven2??Ant??????????????????Maven???????????

???????Maven???????????Junit??????????????????surefire????

????mvn -Dtest=TestXXX test

?????Maven???????JVM?????????????????Maven??JVM?????????棬???????profiling???????????????????????????????????????????????MAVEN_OPTS??

????linux??????.profile????.bash_profile?????export MAVEN_OPTS=-Xmx1024m

????windows???????????????MAVEN_OPTS

???????????????е?maven??????????????JVM??????????????????????????????binmvn.bat????mvn.sh?????????????????(%MAVEN_OPTS%??????JVM??????

????@REM Start MAVEN2

????:runm2

????%MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath %CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%inm2.conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS%

????????и???specific??????????????????????JUnit Testcase???????fork??????μ?JVM?????У????????JVM????????????????????????????pom.xml?????????巽?????????????pom.xml??<build>-><plugins>????????plugin???????????surefire?????????????testcase????????fork??????μ?JVM?????У????????JVM????????????maven.test.jvmargs?????д???:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkMode>pertest</forkMode>
<argLine>${maven.test.jvmargs}</argLine>
</configuration>
</plugin>

?????????<properties>????????????maven??????maven.test.jvmargs?????????????????????????????????д???

<deploy.target/>
<maven.test.jvmargs></maven.test.jvmargs>

??????????????????????У?????-Dtest????????е?testcase???????-Dmaven.test.jvmargs?????????JVM??????maven??????????????μ?fork??????JVM???С?

????mvn -Dtest=TestXXX -Dmaven.test.jvmargs='-agentlib:xxxagent -Xmx128m' test