Maven 3.8.1 报错 Blocked mirror for repositories

[ERROR] Failed to execute goal com.github.davidmoten:jax-maven-plugin:0.1.6:xjc (default) on project oozie-fluent-job-api: Execution default of goal com.github.davidmoten:jax-maven-plugin:0.1.6:xjc failed: Plugin com.github.davidmoten:jax-maven-plugin:0.1.6 or one of its dependencies could not be resolved: Failed to collect dependencies at com.github.davidmoten:jax-maven-plugin:jar:0.1.6 -> com.github.davidmoten:jax-maven-plugin-core:jar:0.1.6 -> com.sun.xml.ws:jaxws-tools:jar:2.3.1 -> com.sun.xml.ws:jaxws-rt:jar:2.3.1 -> com.sun.xml.ws:policy:jar:2.7.5 -> org.glassfish.jaxb:txw2:jar:2.4.0-b180608.0325: Failed to read artifact descriptor for org.glassfish.jaxb:txw2:jar:2.4.0-b180608.0325: Could not transfer artifact org.glassfish.jaxb:txw2:pom:2.4.0-b180608.0325 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [releases.java.net (http://maven.java.net/content/repositories/releases/, default, releases+snapshots), jvnet-nexus-staging (http://maven.java.net/content/repositories/staging/, default, releases+snapshots), eclipse (http://download.eclipse.org/rt/eclipselink/maven.repo, default, releases+snapshots), jvnet-nexus-snapshots (http://maven.java.net/content/repositories/snapshots/, default, snapshots)] -> [Help 1]

官方的解决方法

Maven – Release Notes – Maven 3.8.1icon-default.png?t=M0H8https://maven.apache.org/docs/3.8.1/release-notes.html 

修复方案:

<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
          xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    <mirrors>
        <!--
        <mirror>
          <id></id>
          <name></name>
          <url></url>
          <mirrorOf></mirrorOf>
        </mirror>
        -->
        <mirror>
          <id>mirror-release.java.net</id>
          <name>mirror java.net release repository</name>
          <url>https://maven.java.net/content/repositories/releases/</url>
          <mirrorOf>releases.java.net</mirrorOf>
        </mirror>
        <mirror>
          <id>mirror-jvnet-nexus-staging</id>
          <name>mirror jvnet-nexus-staging repository</name>
          <url>https://maven.java.net/content/repositories/staging/</url>
          <mirrorOf>jvnet-nexus-staging</mirrorOf>
        </mirror>
        <mirror>
          <id>mirror-eclipse</id>
          <name>mirror eclipse repository</name>
          <url>https://download.eclipse.org/rt/eclipselink/maven.repo</url>
          <mirrorOf>eclipse</mirrorOf>
        </mirror>
        <mirror>
          <id>mirror-jvnet-nexus-snapshots</id>
          <name>mirror jvnet-nexus-snapshots repository</name>
          <url>https://maven.java.net/content/repositories/snapshots/</url>
          <mirrorOf>jvnet-nexus-snapshots</mirrorOf>
        </mirror>
    </mirrors>
</settings>

通过命令 mvn help:effective-settings 检查当前settings

[root@localhost .m2]# mvn help:effective-settings
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- maven-help-plugin:3.2.0:effective-settings (default-cli) @ standalone-pom ---
[INFO] 
Effective user-specific configuration settings:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Generated by Maven Help Plugin on 2021-06-10T16:21:51+08:00            -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
<!--                                                                        -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective Settings for 'root' on 'localhost.localdomain'               -->
<!--                                                                        -->
<!-- ====================================================================== -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
  <localRepository>/root/.m2/repository</localRepository>
  <mirrors>
    <mirror>
      <mirrorOf>releases.java.net</mirrorOf>
      <name>mirror java.net release repository</name>
      <url>https://maven.java.net/content/repositories/releases/</url>
      <id>mirror-release.java.net</id>
    </mirror>
    <mirror>
      <mirrorOf>jvnet-nexus-staging</mirrorOf>
      <name>mirror jvnet-nexus-staging repository</name>
      <url>https://maven.java.net/content/repositories/staging/</url>
      <id>mirror-jvnet-nexus-staging</id>
    </mirror>
    <mirror>
      <mirrorOf>eclipse</mirrorOf>
      <name>mirror eclipse repository</name>
      <url>https://download.eclipse.org/rt/eclipselink/maven.repo</url>
      <id>mirror-eclipse</id>
    </mirror>
    <mirror>
      <mirrorOf>jvnet-nexus-snapshots</mirrorOf>
      <name>mirror jvnet-nexus-snapshots repository</name>
      <url>https://maven.java.net/content/repositories/snapshots/</url>
      <id>mirror-jvnet-nexus-snapshots</id>
    </mirror>
    <mirror>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
      <id>maven-default-http-blocker</id>
    </mirror>
  </mirrors>
  <pluginGroups>
    <pluginGroup>org.apache.maven.plugins</pluginGroup>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
</settings>


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.755 s
[INFO] Finished at: 2021-06-10T16:21:52+08:00
[INFO] ------------------------------------------------------------------------

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

智达教育‍

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值