Howto add another test source folder to Maven and compile it to a separate folder?

后端 未结 3 370
自闭症患者
自闭症患者 2020-12-09 07:17

I have the default src/test/java folder for our unit tests. A separate folder src/integration/java is available for the integration tests.

3条回答
  •  难免孤独
    2020-12-09 08:16

    If you only want to change the unit test source folder (rather than add an additional one), just change the testSourceDirectory element:

    
        ${project.basedir}/src/test/groovy
    

    This is useful if all of your unit tests are written in groovy. (But you will also need to configure maven to compile your groovy code too - see the groovy-eclipse-maven-plugin or the build-helper-maven-plugin.)

提交回复
热议问题