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就可以正常使用了