mvn assembly:assembly
打包,运行
mvn assembly:assembly
报错
Error creating assembly archive pack: You must set at least one file
原来的 pom 中 maven-assembly-plugin 是这样的
<plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <version>2.3</version> </plugin>
修改后
<plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <version>2.3</version> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>
再运行
mvn assembly:assembly
可行