打包的时候出现了error 麻烦老师看看
这是pom.xml: <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> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.1.10.RELEASE</version> </dependency> </dependencies> <build> <!-- 配置插件 --> <plugins> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.5</version> <configuration> <archive> <manifest> <mainClass>com.imooc.maven.PinyinTestor</mainClass> </manifest> </archive> <descriptorRefs> <!-- all in one,在打包时会将所有引用的jar合并到输出的jar文件中 --> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugins> </build> </project> 报错: [INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Malformed POM D:\eclipse-workspace\maven-first\pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<plugins>\r\n\t\t<groupId>... @34:12) @ D:\eclipse-workspace\maven-first\pom.xml, line 34, column 12 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.imooc:maven-first:1.0.0-release (D:\eclipse-workspace\maven-first\pom.xml) has 1 error [ERROR] Malformed POM D:\eclipse-workspace\maven-first\pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<plugins>\r\n\t\t<groupId>... @34:12) @ D:\eclipse-workspace\maven-first\pom.xml, line 34, column 12 -> [Help 2] [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/ProjectBuildingException [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
11
收起
正在回答
2回答
同学你好!
请问同学的plugin标签的外层是否有plugins标签呢?同学这里原来的代码是没有写plugin标签的,同学是否使用它替换了plugins标签了呢?
这里同学将plugin标签的内容替换了plugins标签的内容测试一下比如:
<plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>com.imooc.maven.PinyinTestor</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin> </plugins>
3. 如果还报错,建议同学贴一下最新的pom文件,以及报错信息。注意在我要回答中贴出,回复里会改变代码的格式
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
好帮手慕阿满
2019-10-28 19:25:04
同学你好,建议同学删除之前的plugin,替换为如下的plugin再试试,如:
<plugin> <artifactId>maven-assembly-plugin</artifactId> <version>2.4</version> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <mainClass>com.imooc.maven.PinyinTestor</mainClass> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>
如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~
相似问题
登录后可查看更多问答,登录/注册
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星