maven入门问题,打包的时候就报错了
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | <project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > <modelVersion> 4.0 . 0 </modelVersion> <groupId>com.imooc</groupId> <artifactId>maven-first</artifactId> <version> 1.0 . 0 -RELEASE</version> <repositories> <repository> <!-- 创建私服的地址 --> <id>aliyun</id> <name>aliyun</name> <url>https: //maven.aliyun.com/repository/public</url> </repository> </repositories> <dependencies> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version> 8.0 . 17 </version> </dependency> <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version> 2.5 . 1 </version> </dependency> </dependencies> <build> <!-- 配置插件 --> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version> 2.5 . 5 </version> <!-- 用于说明在打包过程中的一些细节 --> <configuration> <!-- 设置应用程序入口类,main方法 --> <archive> <manifest> <mainClass>com.imooc.maven.PinYinTest</mainClass> </manifest> </archive> <!-- 在打包过程中所使用的额外参数 --> <descriptorRefs> <!-- all in one,在打包时会将所引用的jar合并到输出的jar文件中 --> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build> </project> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin: 2.5 . 5 :single (make-assembly) on project maven-first: Execution make-assembly of goal org.apache.maven.plugins:maven-assembly-plugin: 2.5 . 5 :single failed. NullPointerException -> [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. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1 ] http: //cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException |
1
收起
正在回答 回答被采纳积分+1
2回答
好帮手慕阿满
2019-09-26 10:34:38
同学你好,建议同学替换pom文件中plugin的内容,替换为如下重新打包再试试。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <plugin> <artifactId>maven-assembly-plugin</artifactId> <version> 2.4 </version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest><mainClass>com.imooc.maven.PinYinTest</mainClass></manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase> package </phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> |
另外问一下同学在eclipse中,PinYinTest类可以正常运行吗?
如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~
SSM主流框架入门与综合项目实战2018版
- 参与学习 人
- 提交作业 205 份
- 解答问题 4317 个
Java中非常实用的SSM整合开发内容,从Spring开始,到MyBaits的进阶内容,再到SpringMVC的应用,最后是SSM整合开发案例,逐步深入,助你成长为一名Java工程师!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧