我正在使用Maven Java项目进行硒自动化,如果提供的值为jar,则pom.xml会显示标记错误。将value更改为pom时,不会遇到任何错误。以前,当值是jar时,根本没有错误。
尝试删除https://maven.apache.org/plugins/maven-jar-plugin/usage.html中描述的非强制性标签,但随后在http://maven.apache.org/xsd/maven-4.0.0.xsd显示错误“>作为[[目标org.apache.maven.plugins的执行默认资源:maven-resources-plugin:2.6:resources失败:执行org.apache.maven.plugins:maven-resources-plugin时遇到API不兼容:2.6:resources:java.lang.LinkageError:违反加载程序约束:解析接口方法时] ... click on it to see the error
<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>SampleTestAutomation</groupId>
<artifactId>SampleTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SampleTest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>9</maven.compiler.target>
<maven.compiler.source>9</maven.compiler.source>
</properties>
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.10</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.1.0</version>
</dependency>
....
....
....
</dependencies>
</project>
当标记中包含jar值时,不会显示任何错误消息。