本地电脑环境
window10
jdk1.8
maven 3.5.4
IDEA 2020.1
首先配置好maven环境
这里面有一些坑,可以看我的另一篇博客,踩过的坑希望大家不要在踩了。
https://blog.csdn.net/ibo123/article/details/108034402
无法加载主类的问题在于你的maven环境没有进行全局配置,请务必配置好全局maven。要不然IDEA会自动加载默认的maven。
1 构建一个简单的maven项目
file -> project -> Maven-> next
填写 Goupid Artifactid -> Next
项目名称和路径根据自己需要填写,最后点击Finish.
2 pom.xml设置
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ibo.pit</groupId>
<artifactId>pit_test</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<!-- 不设置scope就是全局-->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.4.11</version>
<