maven私服

解压对应的jfrog artifactory压缩包

在这里插入图片描述
在此之前需要配置jdk环境
然后双击artifactory.bat文件,运行

浏览器访问

网址:http://127.0.0.1:8081/artifactory/
账号:admin
密码:password

下载setting.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <servers>
    <server>
      <username>admin</username>
      <password></password>
      <id>central</id>
    </server>
    <server>
      <username>admin</username>
      <password></password>
      <id>snapshots</id>
    </server>
  </servers>
  <profiles>
    <profile>
      <repositories>
        <repository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://ip:8081/artifactory/libs-release</url>
        </repository>
        <repository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://ip:8081/artifactory/libs-snapshot</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
          <id>central</id>
          <name>libs-release</name>
          <url>http://ip:8081/artifactory/libs-release</url>
        </pluginRepository>
        <pluginRepository>
          <snapshots />
          <id>snapshots</id>
          <name>libs-snapshot</name>
          <url>http://ip:8081/artifactory/libs-snapshot</url>
        </pluginRepository>
      </pluginRepositories>
      <id>artifactory</id>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>artifactory</activeProfile>
  </activeProfiles>
  <mirrors>
    <mirror>
        <id>alimaven</id>
        <name>aliyun maven</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
        <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>
</settings>

修改里面的用户名,密码,ip就行了(标签内容不能重复)。覆盖原来的文件包括IJ 的
然后修改pom.xml文件,最后加这个

<distributionManagement>
        <repository>
            <id>central</id>
            <name>libs-release</name>
            <url>http://ip:8081/artifactory/libs-release</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>libs-snapshot</name>
            <url>http://ip:8081/artifactory/libs-snapshot</url>
        </snapshotRepository>
    </distributionManagement>

点击maven-deploy

pom.xml中最重要一点

删掉里面的

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

全删,不然引用时问题之一是把路径名整个打错了导致编译不了,没有请忽略

配置自动注入bean管理

项目结构
在这里插入图片描述

spring.factories内容

		org.springframework.boot.autoconfigure.EnableAutoConfiguration=com.example.demo.config.PhoneAutoConfiguration

PhoneAutoConfiguration的内容

在这里插入图片描述
详细配置见https://www.jianshu.com/p/9e31b4ef2b20

使用

注入maven就可以正常使用了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值