blob: ff1377232b456b14dfe0fd8f755a575fb40630a5 [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>
Dmitry Lychagind934ea82022-03-30 11:50:50 -070026 <version>0.9.8-SNAPSHOT</version>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070027 </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>
Dmitry Lychagin981c7962021-11-29 10:50:35 -080049 <taco.plugin.site.download>${taco.plugin.site}</taco.plugin.site.download>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070050 <taco.plugin.dialect>AsterixDB</taco.plugin.dialect>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070051 <taco.plugin.database.label>Dataverse</taco.plugin.database.label>
52 <taco.plugin.database.default>Default</taco.plugin.database.default>
53 <taco.plugin.table.label>Dataset</taco.plugin.table.label>
54 <taco.plugin.jdbc.scheme>jdbc:asterixdb://</taco.plugin.jdbc.scheme>
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 Lychagin151662e2021-10-15 18:36:58 -070056 <taco.plugin.fields.custom/>
57 <taco.plugin.norm.attributes.custom/>
58 <taco.plugin.jdbc.properties.custom/>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070059
60 <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
61
Dmitry Lychagind355ca32021-10-25 16:03:41 -070062 <build.taco.copy.sdk.stage>none</build.taco.copy.sdk.stage>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070063 <build.taco.init.sdk.stage>none</build.taco.init.sdk.stage>
64 <build.taco.package.sdk.stage>none</build.taco.package.sdk.stage>
65 <build.taco.package.nosdk.stage>none</build.taco.package.nosdk.stage>
66 <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
67 <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
68 <build.taco.gensrc.plugin.class.directory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</build.taco.gensrc.plugin.class.directory>
Dmitry Lychagind355ca32021-10-25 16:03:41 -070069 <build.taco.sdk.directory>${build.taco.directory}/connector-plugin-sdk</build.taco.sdk.directory>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070070 <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
Dmitry Lychagin70139ba2022-02-23 13:19:13 -080071 <build.taco.filename>${taco.plugin.class}.taco</build.taco.filename>
72 <build.taco.file>${project.build.directory}/${build.taco.filename}</build.taco.file>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070073 <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
74 <build.venv.python.path>${build.venv.directory}/bin/python</build.venv.python.path>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070075 </properties>
76
77 <build>
78 <resources>
79 <resource>
80 <directory>${taco.sourceDirectory}</directory>
81 </resource>
82 </resources>
83 <plugins>
84 <plugin>
85 <groupId>org.codehaus.mojo</groupId>
86 <artifactId>build-helper-maven-plugin</artifactId>
87 <executions>
88 <execution>
89 <id>parse-version</id>
90 <goals>
91 <goal>parse-version</goal>
92 </goals>
93 </execution>
94 </executions>
95 </plugin>
96 <plugin>
97 <artifactId>maven-resources-plugin</artifactId>
98 <executions>
99 <execution>
100 <id>taco-generate-sources</id>
101 <phase>generate-sources</phase>
102 <goals>
103 <goal>copy-resources</goal>
104 </goals>
105 <configuration>
106 <outputDirectory>${build.taco.gensrc.directory}</outputDirectory>
107 <resources>
108 <resource>
109 <directory>${taco.sourceDirectory}</directory>
110 <filtering>true</filtering>
111 </resource>
112 </resources>
113 </configuration>
114 </execution>
Dmitry Lychagind355ca32021-10-25 16:03:41 -0700115 <execution>
116 <id>taco-copy-sdk</id>
117 <phase>${build.taco.copy.sdk.stage}</phase>
118 <goals>
119 <goal>copy-resources</goal>
120 </goals>
121 <configuration>
122 <outputDirectory>${build.taco.sdk.directory}</outputDirectory>
123 <resources>
124 <resource>
125 <!--suppress UnresolvedMavenProperty -->
126 <directory>${taco.sdk.path}</directory>
127 <filtering>false</filtering>
128 </resource>
129 </resources>
130 </configuration>
131 </execution>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700132 </executions>
133 </plugin>
134 <plugin>
135 <groupId>org.apache.maven.plugins</groupId>
136 <artifactId>maven-jar-plugin</artifactId>
137 <configuration>
138 <classesDirectory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</classesDirectory>
139 </configuration>
140 </plugin>
141 <plugin>
142 <groupId>org.apache.maven.plugins</groupId>
143 <artifactId>maven-source-plugin</artifactId>
144 <executions>
145 <execution>
146 <id>attach-sources</id>
147 <goals>
148 <goal>jar</goal>
149 </goals>
150 </execution>
151 </executions>
152 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700153 <plugin>
154 <groupId>org.codehaus.mojo</groupId>
155 <artifactId>exec-maven-plugin</artifactId>
156 <executions>
157 <execution>
158 <id>venv-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700159 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700160 <goals>
161 <goal>exec</goal>
162 </goals>
163 <configuration>
164 <!--suppress UnresolvedMavenProperty -->
165 <executable>${python.path}</executable>
166 <workingDirectory>${project.build.directory}</workingDirectory>
167 <arguments>
168 <argument>-m</argument>
169 <argument>venv</argument>
170 <argument>${build.venv.directory}</argument>
171 </arguments>
172 </configuration>
173 </execution>
174 <execution>
175 <id>taco-packager-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700176 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700177 <goals>
178 <goal>exec</goal>
179 </goals>
180 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700181 <executable>${build.venv.python.path}</executable>
Dmitry Lychagind355ca32021-10-25 16:03:41 -0700182 <workingDirectory>${build.taco.sdk.directory}/connector-packager</workingDirectory>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700183 <arguments>
184 <argument>setup.py</argument>
185 <argument>install</argument>
186 </arguments>
187 <environmentVariables>
188 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
189 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
190 </environmentVariables>
191 </configuration>
192 </execution>
193 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700194 <!-- create .taco file using Taco SDK -->
195 <id>taco-package-sdk</id>
196 <phase>${build.taco.package.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700197 <goals>
198 <goal>exec</goal>
199 </goals>
200 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700201 <executable>${build.venv.python.path}</executable>
Dmitry Lychagind355ca32021-10-25 16:03:41 -0700202 <workingDirectory>${build.taco.sdk.directory}/connector-packager</workingDirectory>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700203 <arguments>
204 <argument>-m</argument>
205 <argument>connector_packager.package</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700206 <argument>${build.taco.gensrc.plugin.class.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700207 <argument>--log</argument>
208 <argument>${build.taco.log.directory}</argument>
209 <argument>--dest</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700210 <argument>${project.build.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700211 </arguments>
212 <environmentVariables>
213 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
214 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
215 </environmentVariables>
216 </configuration>
217 </execution>
218 </executions>
219 </plugin>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700220 <plugin>
221 <groupId>org.apache.maven.plugins</groupId>
222 <artifactId>maven-shade-plugin</artifactId>
223 <executions>
224 <execution>
225 <!-- create .taco file if Taco SDK is not available -->
226 <id>taco-package-nosdk</id>
227 <phase>${build.taco.package.nosdk.stage}</phase>
228 <goals>
229 <goal>shade</goal>
230 </goals>
231 <configuration>
Dmitry Lychagin70139ba2022-02-23 13:19:13 -0800232 <outputFile>${build.taco.file}</outputFile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700233 <artifactSet>
234 <includes>
235 <include>org.apache.asterix:asterix-jdbc-taco</include>
236 </includes>
237 </artifactSet>
238 </configuration>
239 </execution>
240 </executions>
241 </plugin>
Dmitry Lychagin70139ba2022-02-23 13:19:13 -0800242 <plugin>
243 <artifactId>maven-antrun-plugin</artifactId>
244 <executions>
245 <execution>
246 <!-- Print warning if .taco was not packaged by TACO SDK -->
247 <id>taco-package-nosdk-warn</id>
248 <phase>${build.taco.package.nosdk.stage}</phase>
249 <goals>
250 <goal>run</goal>
251 </goals>
252 <configuration>
253 <target>
254 <echo level="warning">WARNING: Tableau Connector SDK was not used for ${build.taco.filename} packaging because 'taco.sdk.path' property is not set</echo>
255 </target>
256 </configuration>
257 </execution>
258 <execution>
259 <!-- Add license to .taco file -->
260 <id>taco-package-add-license</id>
261 <phase>package</phase>
262 <goals>
263 <goal>run</goal>
264 </goals>
265 <configuration>
266 <target>
267 <echo>Adding license to ${build.taco.filename}</echo>
268 <jar file="${build.taco.file}" update="true">
269 <fileset dir="${project.build.directory}/classes">
270 <include name="META-INF/LICENSE"/>
271 <include name="META-INF/NOTICE"/>
272 </fileset>
273 </jar>
274 </target>
275 </configuration>
276 </execution>
277 </executions>
278 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700279 </plugins>
280 </build>
281
282 <profiles>
283 <profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700284 <id>taco-sdk-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700285 <activation>
286 <property>
287 <name>taco.sdk.path</name>
288 </property>
289 </activation>
290 <properties>
Dmitry Lychagind355ca32021-10-25 16:03:41 -0700291 <build.taco.copy.sdk.stage>generate-resources</build.taco.copy.sdk.stage>
292 <build.taco.init.sdk.stage>process-resources</build.taco.init.sdk.stage>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700293 <build.taco.package.sdk.stage>package</build.taco.package.sdk.stage>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700294 </properties>
295 <build>
296 <plugins>
297 <plugin>
298 <groupId>org.apache.maven.plugins</groupId>
299 <artifactId>maven-enforcer-plugin</artifactId>
300 <executions>
301 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700302 <id>enforce-taco-sdk-packager-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700303 <goals>
304 <goal>enforce</goal>
305 </goals>
306 <configuration>
307 <rules>
308 <requireProperty>
309 <property>python.path</property>
310 </requireProperty>
311 <requireFilesExist>
312 <files>
313 <!--suppress UnresolvedMavenProperty -->
314 <file>${python.path}</file>
315 <file>${taco.sdk.path}/connector-packager/setup.py</file>
316 </files>
317 </requireFilesExist>
318 </rules>
319 <fail>true</fail>
320 </configuration>
321 </execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700322 <execution>
323 <!-- ensure that .taco was created -->
324 <id>enforce-taco-package-success</id>
325 <phase>verify</phase>
326 <goals>
327 <goal>enforce</goal>
328 </goals>
329 <configuration>
330 <rules>
331 <requireFilesExist>
332 <files>
Dmitry Lychagin70139ba2022-02-23 13:19:13 -0800333 <file>${build.taco.file}</file>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700334 </files>
335 </requireFilesExist>
336 </rules>
337 <fail>true</fail>
338 </configuration>
339 </execution>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700340 </executions>
341 </plugin>
342 </plugins>
343 </build>
344 </profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700345 <profile>
346 <id>taco-sdk-missing</id>
347 <activation>
348 <property>
349 <name>!taco.sdk.path</name>
350 </property>
351 </activation>
352 <properties>
353 <build.taco.package.nosdk.stage>package</build.taco.package.nosdk.stage>
354 </properties>
355 </profile>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700356 </profiles>
357</project>