Maven无法拉取SNAPSHOT依赖

young 766 2022-12-05

在Maven的settings.xml文件中,增加配置

profiles下增加配置

<profile>
  <id>nexus</id>
  <repositories>
    <repository>
      <id>central</id>
      <url>http://central</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <url>http://central</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>
</profile>

profiles标签外增加配置,激活profile

<activeProfiles>
  <activeProfile>nexus</activeProfile>
</activeProfiles>