maven打包编译的时候排除test测试类

有2种方式 :

1.使用命令的时候带上参数

/**
*编译
*/
mvn install -Dmaven.test.skip=true
/**
*打包
*/
mvn package -Dmaven.test.skip=true

2.在pom.xml里面配置

<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
            <skip>true</skip>
        </configuration>
    </plugin>
</plugins>

猜你喜欢

转载自blog.csdn.net/hacker_Lees/article/details/82420896