11. Dependency Scope
• compile
– default
• provided
– required on compilation, but not for execution
– provided by JDK or other container
• runtime
– required for execution and test
• test
– for test only
• system
– like provided
– must supply systemPath
22. Test
• Run as JUNIT test
• Variables
– testSourceDirectory
• src/test/java
– testOutputdirectory
• target/test-classes
– result
• target/surefire-reports
• Includsion
– Java filenames that start with "Test"
• **/Test*.java
– Java filenames that end with "Test"
• **/*Test.java
– Java filenames that end with "TestCase"
• **/*TestCase.java
23. Test
mvn -Dtest=TestCircle test
run test on TestCircle class
mvn -Dtest=TestSquare,TestCi*le test
run multiple names/patterns, separated by commas
mvn -Dtest=TestCircle#mytest test
mvn -Dtest=TestCircle#test* test
mvn -Dtest=TestCircle#testOne+testTwo test
run test on multiple methods
mvn install -Dmaven.test.skip=true
skip test
31. Profile
• Per Project
– pom.xml
• Per User
– %USER_HOME%/.m2/settings.xml
• Global
– %M2_HOME%/config/settings.xml
mvn groupId:artifactId:goal -P profile-1,profile-2