简体   繁体   English

未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1

[英]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1

i am facing issue while compiling my maven project through command prompt, need help Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project Automation: Compilation failure: Compilation failure: i am using JDK14 and latest eclipse IDE Version: 2020-03 (4.15.0) i am facing issue while compiling my maven project through command prompt, need help Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project Automation: Compilation failure:编译失败:我正在使用 JDK14 和最新的 eclipse IDE 版本:2020-03 (4.15.0)

Error message:错误信息:

[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 that i am using:我正在使用的 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>

First of all remove the unwanted testng dependency from the POM.xml and second you have added the scope as test in the testng dependency.首先从 POM.xml 中删除不需要的 testng 依赖项,其次您已添加 scope 作为测试在 Z3732777938BCF4DEEAFA2757F 依赖项中。 You have also accessed the class file of the testng dependency with the scope test in src/main/java.您还通过 src/main/java 中的 scope 测试访问了 testng 依赖项的 class 文件。 Please remove the test scope from the dependency and then execute the test again.请从依赖项中删除测试 scope,然后再次执行测试。 Let me know if the issue persists even after fixing the above issues.让我知道即使在解决上述问题后问题仍然存在。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 无法在项目上执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:testCompile (default-testCompile) on projec “无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)” - "Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile)" Jenkins 构建错误:[错误] 无法执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1compile: - Jenkins build Error: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile: 无效的目标版本:11 - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile : invalid target release: 11 未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) Maven:未能执行目标 org.apache.maven.plugins:maven-compiler-plugin:3.10.1compile: - Maven: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile 无法执行目标org.apache.maven.plugins:maven-compiler-plugin等 - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin AND more Intelij IDEA-无法执行目标org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile - Intelij IDEA - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM