搭建Dubbo Admin(五)

Dubbo Admin下载地址(2019年9月8日):https://github.com/apache/dubbo-admin

 注意:JDK要求1.8以上

1. 进入到模块 dubbo-admin-ui中,打开maven的pom.xml文件,在build中加上:

<downloadRoot>http://npm.taobao.org/mirrors/node/</downloadRoot>

加完后应该是这个样子:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~  he License.  You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~  Unless required by applicable law or agreed to in writing, software
  ~  distributed under the License is distributed on an "AS IS" BASIS,
  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~  See the License for the specific language governing permissions and
  ~  limitations under the License.
  -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>dubbo-admin</artifactId>
        <groupId>org.apache</groupId>
        <version>0.1</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>dubbo-admin-ui</artifactId>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <frontend-maven-plugin.version>1.6</frontend-maven-plugin.version>
    </properties>

    <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>
</project>
View Code

2.  修配置文件 dubbo-admin-server/src/main/resources/application.properties

server.port=9898

# centers in dubbo2.7
# Zookeeper的IP和端口
admin.registry.address=zookeeper://192.168.178.5:2181
admin.config-center=zookeeper://192.168.178.5:2181
admin.metadata-report.address=zookeeper://192.168.178.5:2181

#group
admin.registry.group=dubbo
admin.config-center.group=dubbo
admin.metadata-report.group=dubbo

admin.apollo.token=e16e5cd903fd0c97a116c873b448544b9d086de9
admin.apollo.appId=test
admin.apollo.env=dev
admin.apollo.cluster=default
admin.apollo.namespace=dubbo

3.  编译打包

cd dubbo-admin-develop #进入解压目录
mvn clean package  //编译打包

4. 启动运行

cd dubbo-admin-distribution/target
java -jar dubbo-admin-0.1.jar

猜你喜欢

转载自www.cnblogs.com/myitnews/p/11484573.html