打包时出现异常
[INFO] Scanning for projects... [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Malformed POM D:\STUDY\J2EE\maven-first\pom.xml: Unrecognised tag: 'id' (position: START_TAG seen ...<!-- \u521b\u5efa\u79c1\u670d\u5730\u5740 -->\r\n\t\t<id>... @28:7) @ D:\STUDY\J2EE\maven-first\pom.xml, line 28, column 7 @ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.zcl:maven-first:1.0.0.RELEASE (D:\STUDY\J2EE\maven-first\pom.xml) has 1 error [ERROR] Malformed POM D:\STUDY\J2EE\maven-first\pom.xml: Unrecognised tag: 'id' (position: START_TAG seen ...<!-- \u521b\u5efa\u79c1\u670d\u5730\u5740 -->\r\n\t\t<id>... @28:7) @ D:\STUDY\J2EE\maven-first\pom.xml, line 28, column 7 -> [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
<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.zcl</groupId> <artifactId>maven-first</artifactId> <version>1.0.0.RELEASE</version> <dependencies> <!-- 创建依赖 --> <dependency> <groupId>com.github.bj-tydic</groupId> <artifactId>async-mysql-connector</artifactId> <version>1.7</version> </dependency> <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.1</version> </dependency> <dependency> <groupId>co.paralleluniverse</groupId> <artifactId>comsat-spring-webmvc</artifactId> <version>0.7.0</version> </dependency> </dependencies> <repositories> <!-- 创建私服地址 --> <id>aliyun</id> <name>aliyun</name> <url>https://maven.aliyun.com/repository/public</url> </repositories> <build> <!-- 配置插件 --> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugins</artifactId> <version>2.5.5</version> <configuration> <!-- 配置入口类 --> <archive> <manifest> <mainClass>com.zcl.maven.PinyinTestor</mainClass> </manifest> </archive> <descriptorRefs> <!-- all in one ,打包时将所有引用的jar合并到输出的jar文件中 --> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build> </project>
package com.zcl.maven;
import java.util.Scanner;
import net.sourceforge.pinyin4j.PinyinHelper;
public class PinyinTestor {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
String[] str1 = PinyinHelper.toHanyuPinyinStringArray(str.charAt(0));
for(String py:str1) {
System.out.println(py);
}
}
}老师打包时出问题了,看不太懂这个异常
6
收起
正在回答 回答被采纳积分+1
3回答
好帮手慕柯南
2019-09-01 11:33:55
同学你好!
同学将pom文件替换为以下样式测试一下:
<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.zcl</groupId> <artifactId>maven-first</artifactId> <version>1.0.0.RELEASE</version> <dependencies> <!-- 创建依赖 --> <dependency> <groupId>com.github.bj-tydic</groupId> <artifactId>async-mysql-connector</artifactId> <version>1.7</version> </dependency> <dependency> <groupId>com.belerweb</groupId> <artifactId>pinyin4j</artifactId> <version>2.5.1</version> </dependency> <dependency> <groupId>co.paralleluniverse</groupId> <artifactId>comsat-spring-webmvc</artifactId> <version>0.7.0</version> </dependency> </dependencies> <repositories> <repository> <id>aliyun</id> <name>aliyun</name> <url>https://maven.aliyun.com/repository/public</url> </repository> </repositories> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.5.5</version> <configuration> <archive> <manifest>com.lgq.maven.PinyinTestor</manifest> </archive> <descriptorRefs> <!-- all in one,在打包时将所有引用的jar包合并到输出的jar文件中 --> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> </build> </project>
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
3. Java 数据库开发与实战应用
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程

恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星