pom.xml 11.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?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="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>
        <groupId>org.apache.iotdb</groupId>
        <artifactId>iotdb-parent</artifactId>
26
        <version>1.0.0-SNAPSHOT</version>
27 28 29 30 31 32 33 34 35
        <relativePath>../pom.xml</relativePath>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>testcontainer</artifactId>
    <properties>
        <docker.test.skip>false</docker.test.skip>
        <docker.build.executable>docker</docker.build.executable>
        <docker.build.single.argument>build -t apache/iotdb:maven-development -f ${basedir}/../docker/src/main/Dockerfile-single ${basedir}/../.</docker.build.single.argument>
        <docker.clean.single.argument>image rm apache/iotdb:maven-development</docker.clean.single.argument>
36 37
        <docker.build.sync.argument>build -t apache/iotdb:sync-maven-development -f ${basedir}/../docker/src/main/Dockerfile-single-tc ${basedir}/../.</docker.build.sync.argument>
        <docker.clean.sync.argument>image rm apache/iotdb:sync-maven-development</docker.clean.sync.argument>
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.iotdb</groupId>
            <artifactId>iotdb-jdbc</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.iotdb</groupId>
            <artifactId>iotdb-session</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.iotdb</groupId>
            <artifactId>iotdb-cli</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
58 59 60 61 62 63
        <dependency>
            <groupId>org.apache.iotdb</groupId>
            <artifactId>iotdb-server</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
64 65 66 67 68
    </dependencies>
    <profiles>
        <profile>
            <id>testcontainer</id>
            <activation>
69
                <activeByDefault>false</activeByDefault>
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
            </activation>
            <build>
                <plugins>
                    <!-- before integration test, we build the docker image -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>build-docker-image</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.build.single.argument}</commandlineArgs>
                                </configuration>
                            </execution>
91 92 93 94 95 96 97 98 99 100 101 102
                            <execution>
                                <id>build-sync-docker-image</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.build.sync.argument}</commandlineArgs>
                                </configuration>
                            </execution>
103 104 105 106 107 108 109 110 111 112 113 114
                            <execution>
                                <id>clean-docker-image</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.clean.single.argument}</commandlineArgs>
                                </configuration>
                            </execution>
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
                            <execution>
                                <id>clean-sync-docker-image</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.clean.sync.argument}</commandlineArgs>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>add-test-container-source</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${basedir}/src/test/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>run-integration-tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>test-sync</id>
167 168 169
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
            <build>
                <plugins>
                    <!-- before integration test, we build the docker image -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.6.0</version>
                        <executions>
                            <execution>
                                <id>build-sync-docker-image</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.build.sync.argument}</commandlineArgs>
                                </configuration>
                            </execution>
                            <execution>
                                <id>clean-sync-docker-image</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${docker.test.skip}</skip>
                                    <executable>${docker.build.executable}</executable>
                                    <commandlineArgs>${docker.clean.sync.argument}</commandlineArgs>
                                </configuration>
                            </execution>
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>add-test-container-source</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>${basedir}/src/test/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>run-integration-tests</id>
                                <phase>integration-test</phase>
                                <goals>
                                    <goal>integration-test</goal>
232
                                    <goal>verify</goal>
233 234 235
                                </goals>
                            </execution>
                        </executions>
236 237 238 239 240
                        <configuration>
                            <includes>
                                <include>**/org/apache/iotdb/db/sync/**</include>
                            </includes>
                        </configuration>
241 242 243 244 245 246
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>