解决maven拉取不到snapshot jar, settings.xml配置

POM.xml文件里更改了version,发现jar包拉不下来,一直报错,看了仓库是有这个jar的,开始看我的maven配置文件,发现是配置了不拉取快照版本的jar

maven的setting.xml配置:



<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 https://maven.apache.org/xsd/settings-1.2.0.xsd">
  <pluginGroups>
  pluginGroups>
  <proxies>
  proxies>
  <servers>
  servers>

  <mirrors>
    <mirror>
      <id>maven-default-http-blockerid>
      <mirrorOf>external:http:*mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.name>
      <url>http://0.0.0.0/url>
      <blocked>trueblocked>
    mirror>
  mirrors>
  <profiles>
   
    <profile>
      <repositories>
        <repository>
          <id>jdk14id>
          <name>Repository for JDK 1.4 buildsname>
          <url>http://www.myhost.com/maven/jdk14url>
          <layout>defaultlayout>
          <snapshotPolicy>alwayssnapshotPolicy>
          
        repository>
      repositories>


    <pluginRepositories>
          <pluginRepository>
          <id>Nexusid>
          <url>http://nexus.*.com/nexus/content/groups/publicurl
          >
          <enabled>trueenabled>
          <checksumPolicy>warnchecksumPolicy>
          releases>
          <snapshots>
          <enabled>trueenabled>
          <checksumPolicy>failchecksumPolicy>
          snapshots>
      pluginRepository>
pluginRepositories>
    profile>
  profiles>
settings>

< enabled>true
true或者false表示该仓库是否为下载某种类型构件(发布版,快照版)开启。

< snapshots>
< enabled>true
fail

 <snapshots>
<enabled>trueenabled>
<checksumPolicy>failchecksumPolicy>
snapshots>

看了一下,是snapshots配置问题fail代表失败,改为warn就好了
ignore(忽略),fail(失败),或者warn(警告)。

你可能感兴趣的:(问题集,maven,jar,xml)