问题描述:新建完一个maven项目,pom文件报如下错误,
'artifactld' with value "Java基本语法' does not match a valid id pattern.
源码:
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>Javabasics</artifactId>
<groupId>org.example</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>Java基本语法</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
</project>
错误原因:pom文件为gav格式,不允许是中文字符或者空格,仅使下划线、数字、字母。将artifactId中的属性值更改即可
<artifactId>Java1</artifactId>