maven-assembly-plugin报如下异常:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4.1:single (make-assembly) on project assemblyDemo: Failed to create assembly: Error creating assembly archive statics: You must set at least one file. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
其中pom文件配置如下:
<!-- 静态内容另打zip包配置 --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.4.1</version> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <finalName> ${project.artifactId}-${project.version} </finalName> <descriptors> <descriptor> src/assemble/statics-zip.xml </descriptor> </descriptors> </configuration> </execution> </executions> </plugin>
statics-zip.xml的配置文件如下:
<?xml version="1.0" encoding="UTF-8"?> <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> <id>statics</id> <formats> <format>zip</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <fileSets> <fileSet> <directory>${basedir}/src/main/webapp/statics-gen</directory> <outputDirectory>/</outputDirectory> </fileSet> </fileSets> </assembly>
选择打赏方式:
打赏
打赏