在maven中添加插件經過修改項目下的pom.xml文件完成。apache
以下是配置第一個插件示例:app
(這個插件主要功能是爲maven項目指定一個main方法。)maven
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-shade-plugin</artifactId> <version>1.2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <transformers> <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> <mainClass>com.zte.app.myapp.App</mainClass> </transformer> </transformers> </configuration> </execution> </executions> </plugin> </plugins> </build>
若是過程當中出現:cvc-complex-type.2.4.a: Invalid content was found starting with element xxxxui
之類的錯誤,通常都是拼寫問題,或者元素嵌套有誤。spa