1、在pom.xml文件中,添加 <packaging>jar</packaging>
2、在右侧maven工具中,跳过test选项
3、右键package,选择带有 ...[package]的选项,即可在输出目录下得到jar包
注意:如果要将打好的包直接复制到其他目录,可以在 pom.xml 中加入以下属性:
<build>
<plugins>
<plugin>
<groupId>org.apac