dubbo-admin-ui模块 打包失败问题处理
2020-03-31 本文已影响0人
小白_u767d
此处只为maven方式部署,前后端分离方式暂不讨论.
1.git地址为
https://github.com/apache/dubbo-admin.git
2.根据文档获取源码
git clone https://github.com/apache/dubbo-admin.git
3.在以下文件指定注册中心地址
dubbo-admin-server/src/main/resources/application.properties
格式为:
# centers in dubbo2.7
#注册中心地址 注册中心集群部署时,多个注册中心以 [ | ] 分隔
admin.config-center=zookeeper://127.0.0.1:2181
#元数据中心地址
admin.metadata-report.address=zookeeper://127.0.0.1:2181
#登录名
admin.root.user.name=root
#密码
admin.root.user.password=root
- 原文档在此处开始打包,实际使用时会出现dubbo-admin-ui模块打包失败的问题,需添加插件仓库地址,方式为在dubbo-admin-ui模块的pom文件中添加国内仓库地址.
<downloadRoot>http://npm.taobao.org/mirrors/node/</downloadRoot>
完整build为:
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v9.11.1</nodeVersion>
<downloadRoot>http://npm.taobao.org/mirrors/node/</downloadRoot>
</configuration>
</execution>
<!-- Install all project dependencies -->
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<!-- Build and minify static files -->
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
5.打包项目
cd dubbo-admin
mvn clean package
打包完成的文件在 dubbo-admin-distribution/target目录中
6.启动
cd dubbo-admin-distribution/target; java -jar dubbo-admin-0.1.jar
7.访问http://localhost:8080