且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在创建jar时使用maven pom:test-jar有时会说JAR将为空 - 没有内容被标记为包含

更新时间:2021-11-17 02:41:00

我得到了回答:

mvn clean install -DskipTests

Add this in your pom.xml

<plugin>
    <artifactId>maven-assembly-plugin</artifactId>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <descriptorRefs>
        <descriptorRef>jar-with-dependencies</descriptorRef>
      </descriptorRefs>
    </configuration>
  </plugin>