blob: ab76dae9f5bc4aed6b1caf6f087916a02fb928c3 [file] [log] [blame]
<?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.dubbo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dubbo-admin-test</artifactId>
<properties>
<source.level>1.8</source.level>
<target.level>1.8</target.level>
<dubbo.version>2.7.7</dubbo.version>
<spring.version>4.3.16.RELEASE</spring.version>
<junit.version>4.12</junit.version>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
<docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
<maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<provider.image.name>dubbo-admin-integration-provider:latest</provider.image.name>
<consumer.image.name>dubbo-admin-integration-consumer:latest</consumer.image.name>
<java-image.name>openjdk:8-jre</java-image.name>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-bom</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>${dubbo.version}</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>${dubbo.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.141.59</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>29.0-jre</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty.aggregate</groupId>
<artifactId>jetty-all-server</artifactId>
<version>8.2.0.v20160908</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>3.4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fluentlenium</groupId>
<artifactId>fluentlenium-junit</artifactId>
<version>3.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>javax.annotation</id>
<activation>
<jdk>[1.11,)</jdk>
</activation>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>dubbo-admin-integration-test</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<goals>
<goal>local-ip</goal>
</goals>
<phase>initialize</phase>
</execution>
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<portNames>
<portName>zookeeper.port</portName>
<portName>dubbo-admin.port</portName>
<portName>rest.api.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo>===== LocalIP: ${local.ip}</echo>
<echo>===== Zookeeper port: ${zookeeper.port}</echo>
<echo>===== Dubbo Admin port: ${dubbo-admin.port}</echo>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<alias>zookeeper</alias>
<name>zookeeper:3.6</name>
<run>
<ports>
<port>${zookeeper.port}:2181</port>
</ports>
<wait>
<log>binding to port</log>
</wait>
</run>
</image>
<image>
<alias>dubbo-admin</alias>
<name>apache/dubbo-admin-integration:latest</name>
<run>
<dependsOn>zookeeper</dependsOn>
<ports>
<port>${dubbo-admin.port}:8080</port>
</ports>
<env>
<admin.registry.address>zookeeper://zookeeper:2181
</admin.registry.address>
<admin.config-center>zookeeper://zookeeper:2181
</admin.config-center>
<admin.metadata-report.address>zookeeper://zookeeper:2181
</admin.metadata-report.address>
<JAVA_OPTS>-javaagent:/jacoco/jacoco.jar=destfile=/jacoco/jacoco.exec</JAVA_OPTS>
</env>
<volumes>
<bind>
<volume>${project.basedir}/../jacoco:/jacoco</volume>
</bind>
</volumes>
<links>
<link>zookeeper:zookeeper</link>
</links>
<wait>
<log>Tomcat started on port</log>
<http>
<url>http://${local.ip}:${dubbo-admin.port}/static/dubbo.ico</url>
<method>GET</method>
<status>200</status>
</http>
<time>20000</time>
</wait>
</run>
</image>
<image>
<alias>dubbo-admin-provider</alias>
<name>${provider.image.name}</name>
<run>
<dependsOn>dubbo-admin</dependsOn>
<env>
<dubbo.config-center.address>zookeeper://${local.ip}:${zookeeper.port}
</dubbo.config-center.address>
</env>
<wait>
<log>dubbo service started</log>
</wait>
</run>
</image>
<image>
<alias>dubbo-admin-consumer</alias>
<name>${consumer.image.name}</name>
<run>
<dependsOn>dubbo-admin-provider</dependsOn>
<env>
<dubbo.config-center.address>zookeeper://${local.ip}:${zookeeper.port}
</dubbo.config-center.address>
<rest.api.port>${rest.api.port}</rest.api.port>
</env>
<wait>
<log>dubbo service init finish</log>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>start</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<environmentVariables>
<BASEURL>http://localhost:${dubbo-admin.port}</BASEURL>
</environmentVariables>
<includes>
<include>**/*IT.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-provider</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>${java-image.name}</image>
</from>
<to>
<image>${provider.image.name}</image>
</to>
<container>
<mainClass>org.apache.dubbo.admin.ProviderBootstrap</mainClass>
</container>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-consumer</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib-maven-plugin.version}</version>
<configuration>
<from>
<image>${java-image.name}</image>
</from>
<to>
<image>${consumer.image.name}</image>
</to>
<container>
<mainClass>org.apache.dubbo.admin.ConsumerBootstrap</mainClass>
</container>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>dockerBuild</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<source>${source.level}</source>
<target>${target.level}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>