当前位置: 首页 > 知识库问答 >
问题:

Maven安装失败,而试图寻找依赖的项目

晋安国
2023-03-14

我有订单的核心项目,这是依赖于tos基地。这是我的pom。xml。我尝试了堆栈溢出中的所有可能的事情,但仍然得到错误。

我做了跟踪

mvn清理mvn编译mvn编译依赖项:树mvn清理安装

此外,我试图用Xms和Xmx设置MAVEN_OPT。

此外,我再次创建了该项目,但出现了相同的错误。

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.spectrum.sci</groupId>
    <artifactId>order-core</artifactId>
    <version>1.0</version>
    <name>order-core</name>
    <description>Order Core</description>

    <properties>
        <java.version>1.8</java.version>
        <cxf.version>3.2.0</cxf.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <dependencies>

        <dependency>
            <groupId>com.spectrum.tos</groupId>
            <artifactId>tos-base</artifactId>
            <version>1.0</version>
         </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>
            <version>${cxf.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-service-description</artifactId>
            <version>${cxf.version}</version>
         </dependency>
         <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.3.2</version>
         </dependency>


    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
  </project>

这是我得到的错误:

[INFO] Scanning for projects...
[INFO] 
[INFO] [1m--------------------< [0;36mcom.spectrum.sci:order-core[0;1m >---------------------[m
[INFO] [1mBuilding order-core 1.0[m
[INFO] [1m--------------------------------[ jar ]---------------------------------[m
[INFO] 
[INFO] [1m--- [0;32mmaven-resources-plugin:3.1.0:resources[m [1m(default-resources)[m @ [36morder-core[0;1m ---[m
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 0 resource
[INFO] 
[INFO] [1m--- [0;32mmaven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m @ [36morder-core[0;1m ---[m
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 151 source files to C:\Users\P2932832\BPradhan\order-core\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[14,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[15,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[42,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[43,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[39,60] cannot find symbol
  symbol:   class OrderRequest
  location: class com.spectrum.sci.controllers.OrderController
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[39,11] cannot find symbol
  symbol:   class OrderResponse
  location: class com.spectrum.sci.controllers.OrderController
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[55,36] cannot find symbol
  symbol:   class OrderRequest
  location: class com.spectrum.sci.service.OrderDetailsService
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[55,16] cannot find symbol
  symbol:   class OrderResponse
  location: class com.spectrum.sci.service.OrderDetailsService
[INFO] 8 errors 
[INFO] -------------------------------------------------------------
[INFO] [1m------------------------------------------------------------------------[m
[INFO] [1;31mBUILD FAILURE[m
[INFO] [1m------------------------------------------------------------------------[m
[INFO] Total time:  21.704 s
[INFO] Finished at: 2020-03-13T13:52:35-06:00
[INFO] [1m------------------------------------------------------------------------[m
[ERROR] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile[m [1m(default-compile)[m on project [36morder-core[m: [1;31mCompilation failure[m: Compilation failure: 
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[14,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[15,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[42,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[43,30] package com.spectrum.tos.model does not exist
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[39,60] cannot find symbol
[ERROR]   symbol:   class OrderRequest
[ERROR]   location: class com.spectrum.sci.controllers.OrderController
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/controllers/OrderController.java:[39,11] cannot find symbol
[ERROR]   symbol:   class OrderResponse
[ERROR]   location: class com.spectrum.sci.controllers.OrderController
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[55,36] cannot find symbol
[ERROR]   symbol:   class OrderRequest
[ERROR]   location: class com.spectrum.sci.service.OrderDetailsService
[ERROR] /C:/Users/P2932832/BPradhan/order-core/src/main/java/com/spectrum/sci/service/OrderDetailsService.java:[55,16] cannot find symbol
[ERROR]   symbol:   class OrderResponse
[ERROR]   location: class com.spectrum.sci.service.OrderDetailsService
[ERROR] -> [1m[Help 1][m
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch.
[ERROR] Re-run Maven using the [1m-X[m switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [1m[Help 1][m http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

共有1个答案

涂浩皛
2023-03-14

如果tos基本依赖项正确安装在本地存储库下,请尝试mvn-U clean install远程存储库重新更新本地存储库。m2/com/spectrum/tos,那么您应该检查版本1.0是否真的包含缺少的包,也许您应该升级此依赖项。

 类似资料:
  • 最近,在Jenkins中运行的Maven构建作业失败了,但有以下例外,它们不能从Maven Central中提取依赖项,因此应该使用HTTPS。我不知道如何将请求从HTTP更改为HTTPS。在这件事上有人能指导我吗? [错误]无法解析的生成扩展: 插件或其依赖项之一无法解析: 未能收集: 未能读取: 无法将项目: 无法将项目->[帮助2] 正在等待Jenkins完成收集 Plugin或其依赖项之一

  • 我正在尝试将Jeddict插件安装到Apache Netbeans版本12中。我遵循了手动安装和通过更新中心安装的说明:Jeddict安装说明 这两种方法都失败,并显示以下消息: 有些插件需要安装plugin Maven项目。插件Maven Projects是在实现版本12.0中请求的-631BD69CD6112B1CC4C892C24E3E605B1BA04241。以下插件受到影响:jCode

  • 问题:Maven在我的测试中找不到一些依赖项 在我的pom中是这样导入的。xml: 我已经试过了: mvn测试编译 使Intellij缓存无效 重启Intellij 清除. m2并重建项目

  • 我和我的朋友正在做一个Java maven项目,它的设置和我们从Git得到的项目是一样的。在我的设置中,Maven正确地导入了所有依赖项,但对于我的朋友,它找不到任何依赖项。 我们尝试过的事情: 右键单击project,单击maven并单击Reimport。 我们都可以上网,所以这也不是问题。而且,Maven在IntelliJ中设置为自动导入。

  • 我正在将一个组件打包到jar文件中,并试图将其安装到另一个系统中进行开发。我正在使用maven安装该文件,如下所示(摘自https://maven.apache.org/plugins/maven-install-plugin/examples/custom-pom-installation.html): Maven报告jar已成功安装: 我看到jar和pom文件都放在/home/user/中。m