blob: 1a7c677f3aed065e6fb7559eed4e4d2b85581bac [file] [log] [blame]
Dmitry Lychaginf024b412021-10-11 10:31:08 -07001<!--
2 ! Licensed to the Apache Software Foundation (ASF) under one
3 ! or more contributor license agreements. See the NOTICE file
4 ! distributed with this work for additional information
5 ! regarding copyright ownership. The ASF licenses this file
6 ! to you under the Apache License, Version 2.0 (the
7 ! "License"); you may not use this file except in compliance
8 ! with the License. You may obtain a copy of the License at
9 !
10 ! http://www.apache.org/licenses/LICENSE-2.0
11 !
12 ! Unless required by applicable law or agreed to in writing,
13 ! software distributed under the License is distributed on an
14 ! "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ! KIND, either express or implied. See the License for the
16 ! specific language governing permissions and limitations
17 ! under the License.
18 !-->
19<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
20 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
21 <modelVersion>4.0.0</modelVersion>
22
23 <parent>
24 <artifactId>apache-asterixdb-jdbc</artifactId>
25 <groupId>org.apache.asterix</groupId>
26 <version>0.9.7-SNAPSHOT</version>
27 </parent>
28 <artifactId>asterix-jdbc-taco</artifactId>
29 <packaging>jar</packaging>
30
31 <licenses>
32 <license>
33 <name>Apache License, Version 2.0</name>
34 <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
35 <distribution>repo</distribution>
36 <comments>A business-friendly OSS license</comments>
37 </license>
38 </licenses>
39
40 <properties>
41 <root.dir>${basedir}/..</root.dir>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070042
43 <taco.plugin.class>asterixdb_jdbc</taco.plugin.class>
44 <taco.plugin.name>AsterixDB</taco.plugin.name>
45 <!--suppress UnresolvedMavenProperty -->
46 <taco.plugin.version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</taco.plugin.version>
47 <taco.plugin.vendor>Apache</taco.plugin.vendor>
48 <taco.plugin.site>https://asterixdb.apache.org</taco.plugin.site>
49 <taco.plugin.dialect>AsterixDB</taco.plugin.dialect>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070050 <taco.plugin.database.label>Dataverse</taco.plugin.database.label>
51 <taco.plugin.database.default>Default</taco.plugin.database.default>
52 <taco.plugin.table.label>Dataset</taco.plugin.table.label>
53 <taco.plugin.jdbc.scheme>jdbc:asterixdb://</taco.plugin.jdbc.scheme>
Dmitry Lychagind5cf95d2021-10-14 14:41:53 -070054 <taco.plugin.jdbc.properties.aux/>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070055 <taco.plugin.auth.none><![CDATA[<option value="auth-none" label="No Authentication"/>]]></taco.plugin.auth.none>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070056
57 <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
58
59 <build.taco.init.sdk.stage>none</build.taco.init.sdk.stage>
60 <build.taco.package.sdk.stage>none</build.taco.package.sdk.stage>
61 <build.taco.package.nosdk.stage>none</build.taco.package.nosdk.stage>
62 <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
63 <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
64 <build.taco.gensrc.plugin.class.directory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</build.taco.gensrc.plugin.class.directory>
65 <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
66 <build.taco.package.file>${project.build.directory}/${taco.plugin.class}.taco</build.taco.package.file>
67 <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
68 <build.venv.python.path>${build.venv.directory}/bin/python</build.venv.python.path>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070069 </properties>
70
71 <build>
72 <resources>
73 <resource>
74 <directory>${taco.sourceDirectory}</directory>
75 </resource>
76 </resources>
77 <plugins>
78 <plugin>
79 <groupId>org.codehaus.mojo</groupId>
80 <artifactId>build-helper-maven-plugin</artifactId>
81 <executions>
82 <execution>
83 <id>parse-version</id>
84 <goals>
85 <goal>parse-version</goal>
86 </goals>
87 </execution>
88 </executions>
89 </plugin>
90 <plugin>
91 <artifactId>maven-resources-plugin</artifactId>
92 <executions>
93 <execution>
94 <id>taco-generate-sources</id>
95 <phase>generate-sources</phase>
96 <goals>
97 <goal>copy-resources</goal>
98 </goals>
99 <configuration>
100 <outputDirectory>${build.taco.gensrc.directory}</outputDirectory>
101 <resources>
102 <resource>
103 <directory>${taco.sourceDirectory}</directory>
104 <filtering>true</filtering>
105 </resource>
106 </resources>
107 </configuration>
108 </execution>
109 </executions>
110 </plugin>
111 <plugin>
112 <groupId>org.apache.maven.plugins</groupId>
113 <artifactId>maven-jar-plugin</artifactId>
114 <configuration>
115 <classesDirectory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</classesDirectory>
116 </configuration>
117 </plugin>
118 <plugin>
119 <groupId>org.apache.maven.plugins</groupId>
120 <artifactId>maven-source-plugin</artifactId>
121 <executions>
122 <execution>
123 <id>attach-sources</id>
124 <goals>
125 <goal>jar</goal>
126 </goals>
127 </execution>
128 </executions>
129 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700130 <plugin>
131 <groupId>org.codehaus.mojo</groupId>
132 <artifactId>exec-maven-plugin</artifactId>
133 <executions>
134 <execution>
135 <id>venv-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700136 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700137 <goals>
138 <goal>exec</goal>
139 </goals>
140 <configuration>
141 <!--suppress UnresolvedMavenProperty -->
142 <executable>${python.path}</executable>
143 <workingDirectory>${project.build.directory}</workingDirectory>
144 <arguments>
145 <argument>-m</argument>
146 <argument>venv</argument>
147 <argument>${build.venv.directory}</argument>
148 </arguments>
149 </configuration>
150 </execution>
151 <execution>
152 <id>taco-packager-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700153 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700154 <goals>
155 <goal>exec</goal>
156 </goals>
157 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700158 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700159 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
160 <arguments>
161 <argument>setup.py</argument>
162 <argument>install</argument>
163 </arguments>
164 <environmentVariables>
165 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
166 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
167 </environmentVariables>
168 </configuration>
169 </execution>
170 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700171 <!-- create .taco file using Taco SDK -->
172 <id>taco-package-sdk</id>
173 <phase>${build.taco.package.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700174 <goals>
175 <goal>exec</goal>
176 </goals>
177 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700178 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700179 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
180 <arguments>
181 <argument>-m</argument>
182 <argument>connector_packager.package</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700183 <argument>${build.taco.gensrc.plugin.class.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700184 <argument>--log</argument>
185 <argument>${build.taco.log.directory}</argument>
186 <argument>--dest</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700187 <argument>${project.build.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700188 </arguments>
189 <environmentVariables>
190 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
191 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
192 </environmentVariables>
193 </configuration>
194 </execution>
195 </executions>
196 </plugin>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700197 <plugin>
198 <groupId>org.apache.maven.plugins</groupId>
199 <artifactId>maven-shade-plugin</artifactId>
200 <executions>
201 <execution>
202 <!-- create .taco file if Taco SDK is not available -->
203 <id>taco-package-nosdk</id>
204 <phase>${build.taco.package.nosdk.stage}</phase>
205 <goals>
206 <goal>shade</goal>
207 </goals>
208 <configuration>
209 <outputFile>${build.taco.package.file}</outputFile>
210 <artifactSet>
211 <includes>
212 <include>org.apache.asterix:asterix-jdbc-taco</include>
213 </includes>
214 </artifactSet>
215 </configuration>
216 </execution>
217 </executions>
218 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700219 </plugins>
220 </build>
221
222 <profiles>
223 <profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700224 <id>taco-sdk-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700225 <activation>
226 <property>
227 <name>taco.sdk.path</name>
228 </property>
229 </activation>
230 <properties>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700231 <build.taco.init.sdk.stage>initialize</build.taco.init.sdk.stage>
232 <build.taco.package.sdk.stage>package</build.taco.package.sdk.stage>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700233 </properties>
234 <build>
235 <plugins>
236 <plugin>
237 <groupId>org.apache.maven.plugins</groupId>
238 <artifactId>maven-enforcer-plugin</artifactId>
239 <executions>
240 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700241 <id>enforce-taco-sdk-packager-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700242 <goals>
243 <goal>enforce</goal>
244 </goals>
245 <configuration>
246 <rules>
247 <requireProperty>
248 <property>python.path</property>
249 </requireProperty>
250 <requireFilesExist>
251 <files>
252 <!--suppress UnresolvedMavenProperty -->
253 <file>${python.path}</file>
254 <file>${taco.sdk.path}/connector-packager/setup.py</file>
255 </files>
256 </requireFilesExist>
257 </rules>
258 <fail>true</fail>
259 </configuration>
260 </execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700261 <execution>
262 <!-- ensure that .taco was created -->
263 <id>enforce-taco-package-success</id>
264 <phase>verify</phase>
265 <goals>
266 <goal>enforce</goal>
267 </goals>
268 <configuration>
269 <rules>
270 <requireFilesExist>
271 <files>
272 <file>${build.taco.package.file}</file>
273 </files>
274 </requireFilesExist>
275 </rules>
276 <fail>true</fail>
277 </configuration>
278 </execution>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700279 </executions>
280 </plugin>
281 </plugins>
282 </build>
283 </profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700284 <profile>
285 <id>taco-sdk-missing</id>
286 <activation>
287 <property>
288 <name>!taco.sdk.path</name>
289 </property>
290 </activation>
291 <properties>
292 <build.taco.package.nosdk.stage>package</build.taco.package.nosdk.stage>
293 </properties>
294 </profile>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700295 </profiles>
296</project>