为什么“盖镜子的镜子”存储库;错误,尽管在Maven设置中使用HTTPS URL .xml

发布于 2025-02-13 18:46:22 字数 3334 浏览 1 评论 0原文

我的maven版本是3.8.5,以下是maven settings.xml中的镜像config

<mirrors>
<mirror>
      <id>aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>aliyun</name>
      <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
      <blocked>true</blocked>
    </mirror>
  </mirrors>

。但是它设置了true,然后输出以下错误

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 209, column 21
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.security:spring-security-bom:pom:5.6.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2751, column 19
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.session:spring-session-bom:pom:2021.1.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2758, column 19
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.adwetec:adwetec:1.0 (/data/adwetec-user/adwetec-idm/pom.xml) has 2 errors
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.security:spring-security-bom:pom:5.6.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2751, column 19 -> [Help 2]
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.session:spring-session-bom:pom:2021.1.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2758, column 19 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

为什么如何设置它?

my maven version is 3.8.5, and the following is mirrors config in maven settings.xml

<mirrors>
<mirror>
      <id>aliyun</id>
      <mirrorOf>*</mirrorOf>
      <name>aliyun</name>
      <url>https://maven.aliyun.com/nexus/content/groups/public/</url>
      <blocked>true</blocked>
    </mirror>
  </mirrors>

When blocked set false , mvn packge running ok, but it set true , then output following error

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 209, column 21
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.security:spring-security-bom:pom:5.6.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2751, column 19
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework.session:spring-session-bom:pom:2021.1.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2758, column 19
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.adwetec:adwetec:1.0 (/data/adwetec-user/adwetec-idm/pom.xml) has 2 errors
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.security:spring-security-bom:pom:5.6.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2751, column 19 -> [Help 2]
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework.session:spring-session-bom:pom:2021.1.3 from/to aliyun (https://maven.aliyun.com/nexus/content/groups/public/): Blocked mirror for repositories: [central (https://repo.maven.apache.org/maven2, default, releases)] @ org.springframework.boot:spring-boot-dependencies:2.6.7, /data/mvn/repository/org/springframework/boot/spring-boot-dependencies/2.6.7/spring-boot-dependencies-2.6.7.pom, line 2758, column 19 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

WHY?How to set it ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

土豪我们做朋友吧 2025-02-20 18:46:22

您必须在settings.xml上正确配置中心访问:

 <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
   <activeProfiles>
    <activeProfile>nexus</activeProfile>
   </activeProfiles>

You have to configure the central access in your settings.xml correctly like this:

 <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>https://central</url>
          <releases>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
   <activeProfiles>
    <activeProfile>nexus</activeProfile>
   </activeProfiles>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文