繁体   English   中英

无法在项目 XXXX 上执行目标无法解决项目 XXXX 的依赖项(兄弟模块案例)

[英]Failed to execute goal on project XXXX Could not resolve dependencies for project XXXX (sibling module cases)

这是我在 Eclipse 中的文件结构

我想做的事 ?

我想将兄弟模块包含到我的 Spring Boot 项目中,该项目名为 AccountManagementSystem

我的.m2目录中没有 setting.xml

我试过的

1.删​​除.m2目录但对我不起作用

  1. 运行mvn clean install -U仍然对我不起作用

这是我的错误信息

[INFO] Scanning for projects...
[INFO] 
[INFO] --------< com.AccountManagementSystem:AccountManagementSystem >---------
[INFO] Building AccountManagementSystem 0.0.1
[INFO] --------------------------------[ war ]---------------------------------
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/EncapsulationSystem/EncapsulationSystem/1.0/EncapsulationSystem-1.0.pom
[WARNING] The POM for com.EncapsulationSystem:EncapsulationSystem:jar:1.0 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/jc/adwords-encapsulation/1.0/adwords-encapsulation-1.0.pom
[WARNING] The POM for jc:adwords-encapsulation:jar:1.0 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/PermissionSystemApiTool/PermissionSystemApiTool/0.0.1/PermissionSystemApiTool-0.0.1.pom
[WARNING] The POM for com.PermissionSystemApiTool:PermissionSystemApiTool:jar:0.0.1 is missing, no dependency information available
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/EncapsulationSystem/EncapsulationSystem/1.0/EncapsulationSystem-1.0.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/com/PermissionSystemApiTool/PermissionSystemApiTool/0.0.1/PermissionSystemApiTool-0.0.1.jar
[INFO] Downloading from : https://repo.maven.apache.org/maven2/jc/adwords-encapsulation/1.0/adwords-encapsulation-1.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  2.800 s
[INFO] Finished at: 2021-11-15T16:47:06+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project AccountManagementSystem: Could not resolve dependencies for project com.AccountManagementSystem:AccountManagementSystem:war:0.0.1: The following artifacts could not be resolved: com.EncapsulationSystem:EncapsulationSystem:jar:1.0, jc:adwords-encapsulation:jar:1.0, com.PermissionSystemApiTool:PermissionSystemApiTool:jar:0.0.1: Could not find artifact com.EncapsulationSystem:EncapsulationSystem:jar:1.0 in central (https://repo.maven.apache.org/maven2) -> [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/DependencyResolutionException


这是我的 pom.xml

<?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>
    <packaging>war</packaging>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.4</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.AccountManagementSystem</groupId>
    <artifactId>AccountManagementSystem</artifactId>
    <version>0.0.1</version>
    <name>AccountManagementSystem</name>
    <description>Account Management System</description>

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

    <dependencies>

        <dependency>
            <groupId>com.EncapsulationSystem</groupId>
            <artifactId>EncapsulationSystem</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>jc</groupId>
            <artifactId>adwords-encapsulation</artifactId>
            <version>1.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>


        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-jdbc</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j</artifactId>
            <version>1.2.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-pool2</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.google.oauth-client</groupId>
            <artifactId>google-oauth-client-jetty</artifactId>
            <version>1.32.1</version>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>com.PermissionSystemApiTool</groupId>
            <artifactId>PermissionSystemApiTool</artifactId>
            <version>0.0.1</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.amven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

我找到了一些解决方案

Maven多模块项目找不到兄弟模块

Maven 无法解析依赖项,无法解析工件

但是当我运行mvn clean install

我收到错误信息

[INFO] Scanning for projects...
[INFO] 
[INFO] --------< com.AccountManagementSystem:AccountManagementSystem >---------
[INFO] Building AccountManagementSystem 0.0.1
[INFO] --------------------------------[ war ]---------------------------------
[WARNING] The POM for com.EncapsulationSystem:EncapsulationSystem:jar:1.0 is missing, no dependency information available
[WARNING] The POM for jc:adwords-encapsulation:jar:1.0 is missing, no dependency information available
[WARNING] The POM for com.PermissionSystemApiTool:PermissionSystemApiTool:jar:0.0.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.912 s
[INFO] Finished at: 2021-11-15T16:58:46+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project AccountManagementSystem: Could not resolve dependencies for project com.AccountManagementSystem:AccountManagementSystem:war:0.0.1: The following artifacts could not be resolved: com.EncapsulationSystem:EncapsulationSystem:jar:1.0, jc:adwords-encapsulation:jar:1.0, com.PermissionSystemApiTool:PermissionSystemApiTool:jar:0.0.1: com.EncapsulationSystem:EncapsulationSystem:jar:1.0 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced -> [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/DependencyResolutionException

我在我的兄弟项目上依次运行mvn intall解决了我的问题

或者只是将项目导出到战争文件解决了我的问题,因为我的项目是通过战争打包的

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM