Run JUnit Tests contained in dependency jar using Maven Surefire

后端 未结 3 1483
广开言路
广开言路 2020-11-29 06:28

I have a jar in my maven repository that contains junit tests, which should be run in different projects, because it is able to inspect the project and test for certain feat

3条回答
  •  心在旅途
    2020-11-29 07:09

    (This is just restating what is in a comment above from khmarbaise, but since it wasn't clarified, I think it's worth restating):

    Use the test-classes directory instead of the classes folder as outputDirectory:

    
        org.apache.maven.plugins
        maven-dependency-plugin
        
            
                unpack
                process-test-classes
                
                    unpack
                
                
                    
                        
                            de.mwx.test
                            selenium-test-base
                            0.1
                            true
                              
                                  ${project.build.directory}/test-classes
                              
                        
                    
                
            
        
    
    

提交回复
热议问题