Maven 引用 Spring Boot Snapshot 和 Milestone 仓库

Spring Boot Maven About 2,082 words

需求

为了试验Spring Boot的新功能,需要拉取Spring BootSnapshot版本和Milestone版本。

pom.xml

在工程目录的pom.xml中添加如下配置。

增加idspring-snapshots的仓库,并且设置releases属性为false

增加idspring-milestones的仓库,并且设置snapshots属性为false

repositories配置是为了拉取jar包。

pluginRepositories配置是为了拉取构建工程的插件。

<repositories>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <releases>
            <enabled>false</enabled>
        </releases>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <releases>
            <enabled>false</enabled>
        </releases>
    </pluginRepository>
</pluginRepositories>

settings.xml

注意:如果在全局的settings.xml中配置了mirrors镜像属性,需要排查spring-snapshotsspring-milestones这两个id

<mirrors>
    <mirror>
        <id>nexus</id>
        <name>internal nexus repository</name>
        <!--镜像地址-->
        <url></url>
        <mirrorOf>*,!spring-snapshots,!spring-milestones,!spring-releases</mirrorOf>
    </mirror>
</mirrors>

打开settings.xml方式:

  • 右键pom.xml文件
  • 选择Maven
  • 选择Open 'settings.xml'
Views: 763 · Posted: 2023-07-20

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh