Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/390.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven生成失败,无法找到符号:类错误_Java_Maven - Fatal编程技术网

Java Maven生成失败,无法找到符号:类错误

Java Maven生成失败,无法找到符号:类错误,java,maven,Java,Maven,当我上传到Github时,我有一个工作项目,但现在当我将它导入另一个系统时,它显示构建失败。 该项目是从Win10上传的,现在我正在将其导入Mac。对于Maven来说,这是一个非常基本的项目,我知道有一些非常基本的错误,我没有弄清楚 请在此处查找依赖项 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&q

当我上传到Github时,我有一个工作项目,但现在当我将它导入另一个系统时,它显示构建失败。 该项目是从Win10上传的,现在我正在将其导入Mac。对于Maven来说,这是一个非常基本的项目,我知道有一些非常基本的错误,我没有弄清楚

请在此处查找依赖项

<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>UI</groupId>
 <artifactId>Automation</artifactId>
 <version>0.0.1-SNAPSHOT</version>

 <name>Automation</name>
 <url>http://maven.apache.org</url>

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

 
 <dependencies>
   <dependency>
     <groupId>junit</groupId>
     <artifactId>junit</artifactId>
     <version>4.13.2</version>
     <scope>test</scope>
   </dependency>
   
 <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
<dependency>
   <groupId>io.cucumber</groupId>
   <artifactId>cucumber-java</artifactId>
   <version>6.9.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
<dependency>
   <groupId>io.cucumber</groupId>
   <artifactId>cucumber-junit</artifactId>
   <version>6.9.1</version>
   <scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
   <groupId>org.seleniumhq.selenium</groupId>
   <artifactId>selenium-java</artifactId>
   <version>3.141.59</version>
</dependency>

 </dependencies>
<build>
   <pluginManagement>
     <plugins>
       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-surefire-plugin</artifactId>
         <version>3.0.0-M5</version>
       </plugin>
       <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
            <source>1.8</source>
            <target>1.8</target>
        </configuration>
    </plugin>
     </plugins>
   </pluginManagement>
 </build>
</project>

4.0.0
用户界面
自动化
0.0.1-快照
自动化
http://maven.apache.org
UTF-8
朱尼特
朱尼特
4.13.2
测试
黄瓜
黄瓜爪哇
6.9.1
黄瓜
黄瓜刺柏
6.9.1
测试
org.seleniumhq.selenium
硒爪哇
3.141.59
org.apache.maven.plugins
maven surefire插件
3.0.0-M5
org.apache.maven.plugins
maven编译器插件
3.5.1
1.8
1.8
在导入之后,它无法识别我试图扩展到其他类的Hooks类。我在构建中找不到符号:类错误

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/nehasingh/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/Users/nehasingh/eclipse/java-2021-032/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/nehasingh/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/Users/nehasingh/eclipse/java-2021-032/Eclipse.app/Contents/Eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------------< UI:Automation >----------------------------
[INFO] Building Automation 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Automation ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/nehasingh/Downloads/AutomationUI-main/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ Automation ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to /Users/nehasingh/Downloads/AutomationUI-main/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[10,29] package UI.Automation.stepdfn does not exist
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[14,31] cannot find symbol
  symbol: class Hooks
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[3,29] package UI.Automation.stepdfn does not exist
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[5,32] cannot find symbol
  symbol: class Hooks
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[19,49] cannot find symbol
  symbol:   variable driver
  location: class UI.Automation.pageobjects.HomePage
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[32,35] cannot find symbol
  symbol:   variable driver
  location: class UI.Automation.pageobjects.HomePage
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[11,17] cannot find symbol
  symbol:   variable driver
  location: class UI.Automation.pageobjects.loginPage
[INFO] 7 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.837 s
[INFO] Finished at: 2021-04-17T00:03:28-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project Automation: Compilation failure: Compilation failure: 
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[10,29] package UI.Automation.stepdfn does not exist
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[14,31] cannot find symbol
[ERROR]   symbol: class Hooks
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[3,29] package UI.Automation.stepdfn does not exist
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[5,32] cannot find symbol
[ERROR]   symbol: class Hooks
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[19,49] cannot find symbol
[ERROR]   symbol:   variable driver
[ERROR]   location: class UI.Automation.pageobjects.HomePage
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[32,35] cannot find symbol
[ERROR]   symbol:   variable driver
[ERROR]   location: class UI.Automation.pageobjects.HomePage
[ERROR] /Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[11,17] cannot find symbol
[ERROR]   symbol:   variable driver
[ERROR]   location: class UI.Automation.pageobjects.loginPage
[ERROR] -> [Help 1]
[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/MojoFailureException

SLF4J:类路径包含多个SLF4J绑定。
SLF4J:在[jar:file:/Users/nehasingh/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.SLF4J.simple_1.16.0.20200610-1735/jars/SLF4J-simple-1.7.5.jar!/org/SLF4J/impl/StaticLoggerBinder.class]中找到绑定
SLF4J:在[文件:/Users/nehasingh/eclipse/java-2021-032/eclipse.app/Contents/eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/SLF4J/impl/StaticLoggerBinder.class]中找到绑定
SLF4J:参见http://www.slf4j.org/codes.html#multiple_bindings 我需要一个解释。
SLF4J:实际绑定的类型为[org.SLF4J.impl.SimpleLoggerFactory]
SLF4J:类路径包含多个SLF4J绑定。
SLF4J:在[jar:file:/Users/nehasingh/.p2/pool/plugins/org.eclipse.m2e.maven.runtime.SLF4J.simple_1.16.0.20200610-1735/jars/SLF4J-simple-1.7.5.jar!/org/SLF4J/impl/StaticLoggerBinder.class]中找到绑定
SLF4J:在[文件:/Users/nehasingh/eclipse/java-2021-032/eclipse.app/Contents/eclipse/configuration/org.eclipse.osgi/5/0/.cp/org/SLF4J/impl/StaticLoggerBinder.class]中找到绑定
SLF4J:参见http://www.slf4j.org/codes.html#multiple_bindings 我需要一个解释。
SLF4J:实际绑定的类型为[org.SLF4J.impl.SimpleLoggerFactory]
[信息]正在扫描项目。。。
[信息]
[信息]----------------------------------------------------------------
[信息]楼宇自动化0.0.1-SNAPSHOT
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven资源插件:2.6:resources(默认资源)@Automation---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]跳过不存在的resourceDirectory/Users/nehasingh/Downloads/AutomationUI main/src/main/resources
[信息]
[信息]---maven编译器插件:3.5.1:compile(默认编译)@Automation---
[信息]检测到更改-重新编译模块!
[信息]将3个源文件编译到/Users/nehasingh/Downloads/AutomationUI main/target/classes
[信息]-------------------------------------------------------------
[错误]编译错误:
[信息]-------------------------------------------------------------
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[10,29]包UI.Automation.stepdfn不存在
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[14,31]找不到符号
符号:类挂钩
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[3,29]包UI.Automation.stepdfn不存在
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[5,32]找不到符号
符号:类挂钩
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[19,49]找不到符号
符号:可变驱动器
位置:class UI.Automation.pageobjects.HomePage
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[32,35]找不到符号
符号:可变驱动器
位置:class UI.Automation.pageobjects.HomePage
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[11,17]找不到符号
符号:可变驱动器
位置:class UI.Automation.pageobjects.loginPage
[信息]7个错误
[信息]-------------------------------------------------------------
[信息]------------------------------------------------------------------------
[信息]生成失败
[信息]------------------------------------------------------------------------
[信息]总时间:2.837秒
[信息]完成时间:2021-04-17T00:03:28-03:00
[信息]------------------------------------------------------------------------
[错误]未能在项目自动化上执行目标org.apache.maven.plugins:maven编译器插件:3.5.1:compile(默认编译):编译失败:编译失败:
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[10,29]包UI.Automation.stepdfn不存在
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[14,31]找不到符号
[错误]符号:类挂钩
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[3,29]包UI.Automation.stepdfn不存在
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/loginPage.java:[5,32]找不到符号
[错误]符号:类挂钩
[错误]/Users/nehasingh/Downloads/AutomationUI-main/src/main/java/UI/Automation/pageobjects/HomePage.java:[19,49]找不到符号
[错误]符号:变量驱动程序
[错误]位置:class UI.Automation.pageobjects.HomePage
[错误]/Users/neh