gpt4 book ai didi

java - 无法执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 8.1

转载 作者:行者123 更新时间:2023-12-01 16:42:32 24 4
gpt4 key购买 nike

我在通过命令提示符编译我的 Maven 项目时遇到问题,需要帮助 无法在项目自动化上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile): 编译失败: 编译失败:我正在使用 JDK14 和最新的 eclipse IDE 版本:2020-03 (4.15.0)

错误消息:

[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/kits/sit/Base_Setup/BQUK_Agent_Flow.java:[50,39] unmappable character (0x93) for encoding UTF-8
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/kits/sit/Base_Setup/BQUK_Agent_Flow.java:[50,66] unmappable character (0x94) for encoding UTF-8
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[3,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[11,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[12,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[13,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[14,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[15,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[16,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[17,22] package org.testng.xml does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[23,48] cannot find symbol
[ERROR] symbol: class IReporter
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[31,37] cannot find symbol
[ERROR] symbol: class XmlSuite
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[31,63] cannot find symbol
[ERROR] symbol: class ISuite
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[52,33] cannot find symbol
[ERROR] symbol: class IResultMap
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/RetryAnalyzer.java:[4,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/RetryAnalyzer.java:[5,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/RetryAnalyzer.java:[6,39] cannot find symbol
[ERROR] symbol: class IRetryAnalyzer
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/RetryAnalyzer.java:[25,30] cannot find symbol
[ERROR] symbol: class ITestResult
[ERROR] location: class com.qa.analyzer.RetryAnalyzer
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/MyTransformer.java:[6,18] package org.testng does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/MyTransformer.java:[7,30] package org.testng.annotations does not exist
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/MyTransformer.java:[11,39] cannot find symbol
[ERROR] symbol: class IAnnotationTransformer
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/analyzer/MyTransformer.java:[13,31] cannot find symbol
[ERROR] symbol: class ITestAnnotation
[ERROR] location: class com.qa.analyzer.MyTransformer
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[36,26] cannot find symbol
[ERROR] symbol: class ISuite
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[37,49] cannot find symbol
[ERROR] symbol: class ISuiteResult
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[39,42] cannot find symbol
[ERROR] symbol: class ISuiteResult
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[40,53] cannot find symbol
[ERROR] symbol: class ITestContext
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] /C:/work/Automation Learning/Automation-testing-practise/src/main/java/com/qa/ExtentReportListener/AutomationExtentReport.java:[56,42] cannot find symbol
[ERROR] symbol: class ITestResult
[ERROR] location: class com.qa.ExtentReportListener.AutomationExtentReport
[ERROR] -> [Help 1]

我正在使用的 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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.kingfisher</groupId>
<artifactId>Automation</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Maven Quick Start Archetype</name>
<url>http://maven.apache.org</url>


<properties>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>1.8</maven.compiler.source>

<maven.compiler.target>1.8</maven.compiler.target>

</properties>


<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
</plugins>






</pluginManagement>
</build>









<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.14.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.17</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>com.relevantcodes</groupId>
<artifactId>extentreports</artifactId>
<version>2.41.2</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>

</dependencies>
</project>

最佳答案

首先从 POM.xml 中删除不需要的 testng 依赖项,然后在 testng 依赖项中将范围添加为 test。您还通过 src/main/java 中的范围 test 访问了 testng 依赖项的类文件。请从依赖项中删除测试范围,然后再次执行测试。如果修复上述问题后问题仍然存在,请告诉我。

关于java - 无法执行目标 org.apache.maven.plugins :maven-compiler-plugin:3. 8.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61835832/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com