Maven本地jar包部署与安装:dubbox-2.8.4.jar

Dubbox前身是阿里巴巴的Dubbo项目,阿里巴巴解散了Dubbo团队后,由当当网继续维护此项目,改名为Dubbox,但是没有提交到Maven中央仓库
(突然发现阿里巴巴又开始进行dubbo维护了,停止维护时的版本是2.5.3,现在是2.6.4)
image
这些就不管了,现在我手动将Dubbox的jar包安装到本地仓库中
1.下载Dubbox-2.8.4
https://github.com/dangdangdotcom/dubbox/releases
image
image
2.解压Dubbox-2.8.4
image
3.用maven编译文件(前提是已经安装了maven,并且配置了maven的环境变量)
①win键+R,输入cmd,回车
image
image
②设置maven本地仓库路径,下面代码是我本地maven的settings.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository>F:/apache-maven-3.5.4/repository</localRepository>
  <pluginGroups></pluginGroups>
  <proxies></proxies>
  <servers></servers>
  <mirrors>
    <mirror>         
      <id>alimaven</id>
      <name>aliyun maven</name> 
      <url>
        http://maven.aliyun.com/nexus/content/groups/public/
      </url>
      <mirrorOf>central</mirrorOf> 
    </mirror> 
  </mirrors>
  <profiles></profiles>
</settings>

而maven安装目录中有两个settings.xml文件
**Maven安装目录(全局):%MAVEN_HOME%confsettings.xml
用户安装目录(用户):${user.home}.m2settings.xml
第一个是全局配置,第二个是用户配置。当两者都存在,它们的内容将被合并,特定于用户的settings.xml文件占主导地位。**
这里因为我为了节省C盘空间,把.m2文件夹删除了,用本地仓库的settings.xml文件替换掉%MAVEN_HOME%confsettings.xml
③执行命令,如果第一次执行install命令,会首先安装maven插件

mvn install -f D:\文件\dubbox-dubbox-2.8.4\pom.xml -D maven.test.skip=true

image
说明已经编译完成
④打开本地仓库,查看dubbo和dubbo-admin的版本
dubbo
image
image
dubbo-admin
image
image
⑤在maven工程中引用该包

    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>dubbo</artifactId>
      <version>${dubbox.version}</version>
    </dependency>

image
已经引入进来了
结束

猜你喜欢

转载自yq.aliyun.com/articles/662535