报错:
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:x.x.x:test (default-test) on project flow-traffic-statistics: Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException: Unable to get dependency information for org.apache.maven.surefire:surefire-junit-platform:jar:x.x.x Failed to retrieve POM for org.apache.maven.surefire:surefire-junit-platform:jar:x.x.x: Could not transfer artifact org.apache.maven.surefire:surefire-junit-platform:pom:x.x.x from/to central (https://repo.maven.apache.org/maven2): Remote host closed connection during handshake
解决方法1:
pom.xml添加plugin:
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
解决办法2:
在test类上添加注解@Ignore
@Ignore
public class XXXTestClassName{
XXXXXXX
}
解决办法3:
命令行操作,进入pom同级目录
mvn clean package -Dmaven.test.skip=true
或者
mvn clean package -DskipTests