Maven TestNG project, pass command line arguments to testng.xml file

前端 未结 1 1430
夕颜
夕颜 2021-01-22 00:11

I have a Maven TestNG project, and am trying pass couple of command line arguments into the testng.xml file.

The testng.xml file looks like below:



        
1条回答
  •  不知归路
    2021-01-22 00:40

    TestNG and surefire are not supporting the ${var} notation.

    But you can use the filtering feature of Maven. Then you'll have to choose the modified resource:

    
    4.0.0
    Test_Project
    TP_X
    1.0-SNAPSHOT
      
        
            
                src/test/resources
                true
            
        
        ${src.dir}
        
            
                org.apache.maven.plugins
                maven-surefire-plugin
                2.19.1
                
                    
                       target/test-classes/testng.xml
                    
                
            
        
      
    
    

    Note the difference between testResources and resources: How do I filter test resources in maven?

    0 讨论(0)
提交回复
热议问题