| <?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 |
| ~ the 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:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns="http://maven.apache.org/POM/4.0.0" |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| <groupId>org.apache.dubbo</groupId> |
| <version>1.0-SNAPSHOT</version> |
| |
| <modelVersion>4.0.0</modelVersion> |
| |
| <artifactId>dubbo-samples-nacos-override</artifactId> |
| |
| <properties> |
| <source.level>1.8</source.level> |
| <target.level>1.8</target.level> |
| <dubbo.version>2.7.5</dubbo.version> |
| <spring.version>4.3.16.RELEASE</spring.version> |
| <junit.version>4.12</junit.version> |
| <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version> |
| <jib-maven-plugin.version>1.2.0</jib-maven-plugin.version> |
| <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version> |
| <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version> |
| <image.name>${project.artifactId}:${dubbo.version}</image.name> |
| <java-image.name>openjdk:8</java-image.name> |
| <dubbo.port>20880</dubbo.port> |
| <nacos.port>8848</nacos.port> |
| <main-class>org.apache.dubbo.samples.governance.BasicProvider</main-class> |
| </properties> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.apache.dubbo</groupId> |
| <artifactId>dubbo</artifactId> |
| <version>${dubbo.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.dubbo</groupId> |
| <artifactId>dubbo-configcenter-nacos</artifactId> |
| <version>${dubbo.version}</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.dubbo</groupId> |
| <artifactId>dubbo-registry-nacos</artifactId> |
| <version>${dubbo.version}</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>junit</groupId> |
| <artifactId>junit</artifactId> |
| <version>${junit.version}</version> |
| <scope>test</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-test</artifactId> |
| <version>${spring.version}</version> |
| <scope>test</scope> |
| </dependency> |
| </dependencies> |
| |
| <profiles> |
| <profile> |
| <id>dubbo-integration-test-nacos</id> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.dubbo</groupId> |
| <artifactId>dubbo-maven-address-plugin</artifactId> |
| <version>1.0-SNAPSHOT</version> |
| <executions> |
| <execution> |
| <goals> |
| <goal>local-address</goal> |
| </goals> |
| <configuration> |
| <localAddress>dubbo-local-address</localAddress> |
| </configuration> |
| <phase>initialize</phase> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <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>${image.name}</image> |
| </to> |
| <container> |
| <mainClass>${main-class}</mainClass> |
| <environment> |
| <DUBBO_IP_TO_REGISTRY>${dubbo-local-address}</DUBBO_IP_TO_REGISTRY> |
| </environment> |
| <jvmFlags> |
| <jvmFlag>-Dnacos.address=${dubbo-local-address}</jvmFlag> |
| </jvmFlags> |
| </container> |
| </configuration> |
| <executions> |
| <execution> |
| <phase>package</phase> |
| <goals> |
| <goal>dockerBuild</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <plugin> |
| <groupId>io.fabric8</groupId> |
| <artifactId>docker-maven-plugin</artifactId> |
| <version>${docker-maven-plugin.version}</version> |
| <configuration> |
| <images> |
| <image> |
| <name>nacos/nacos-server:latest</name> |
| <run> |
| <ports> |
| <port>${nacos.port}:${nacos.port}</port> |
| </ports> |
| <wait> |
| <time>30000</time> |
| <log>Nacos started successfully in stand alone mode</log> |
| </wait> |
| <env> |
| <PREFER_HOST_MODE>hostname</PREFER_HOST_MODE> |
| <MODE>standalone</MODE> |
| </env> |
| </run> |
| </image> |
| <image> |
| <name>${image.name}</name> |
| <run> |
| <ports> |
| <port>${dubbo.port}:${dubbo.port}</port> |
| </ports> |
| <wait> |
| <log>dubbo service started</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> |
| <configuration> |
| <systemPropertyVariables> |
| <nacos.address>${dubbo-local-address}</nacos.address> |
| </systemPropertyVariables> |
| <includes> |
| <include>**/*IT.java</include> |
| </includes> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <!-- For jdk 11 above JavaEE annotation --> |
| <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> |
| </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> |
| |
| <repositories> |
| <repository> |
| <id>apache.snapshots.https</id> |
| <name>Apache Development Snapshot Repository</name> |
| <url>https://repository.apache.org/content/repositories/snapshots</url> |
| <layout>default</layout> |
| <releases> |
| <enabled>false</enabled> |
| </releases> |
| <snapshots> |
| <enabled>true</enabled> |
| <updatePolicy>daily</updatePolicy> |
| </snapshots> |
| </repository> |
| </repositories> |
| </project> |