blob: adf50055a8e8889571e6a2c5848fbc8ad0236e25 [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 Lychaginf024b412021-10-11 10:31:08 -070054 <taco.plugin.auth.none><![CDATA[<option value="auth-none" label="No Authentication"/>]]></taco.plugin.auth.none>
Dmitry Lychagin151662e2021-10-15 18:36:58 -070055 <taco.plugin.fields.custom/>
56 <taco.plugin.norm.attributes.custom/>
57 <taco.plugin.jdbc.properties.custom/>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070058
59 <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
60
61 <build.taco.init.sdk.stage>none</build.taco.init.sdk.stage>
62 <build.taco.package.sdk.stage>none</build.taco.package.sdk.stage>
63 <build.taco.package.nosdk.stage>none</build.taco.package.nosdk.stage>
64 <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
65 <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
66 <build.taco.gensrc.plugin.class.directory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</build.taco.gensrc.plugin.class.directory>
67 <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
68 <build.taco.package.file>${project.build.directory}/${taco.plugin.class}.taco</build.taco.package.file>
69 <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
70 <build.venv.python.path>${build.venv.directory}/bin/python</build.venv.python.path>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070071 </properties>
72
73 <build>
74 <resources>
75 <resource>
76 <directory>${taco.sourceDirectory}</directory>
77 </resource>
78 </resources>
79 <plugins>
80 <plugin>
81 <groupId>org.codehaus.mojo</groupId>
82 <artifactId>build-helper-maven-plugin</artifactId>
83 <executions>
84 <execution>
85 <id>parse-version</id>
86 <goals>
87 <goal>parse-version</goal>
88 </goals>
89 </execution>
90 </executions>
91 </plugin>
92 <plugin>
93 <artifactId>maven-resources-plugin</artifactId>
94 <executions>
95 <execution>
96 <id>taco-generate-sources</id>
97 <phase>generate-sources</phase>
98 <goals>
99 <goal>copy-resources</goal>
100 </goals>
101 <configuration>
102 <outputDirectory>${build.taco.gensrc.directory}</outputDirectory>
103 <resources>
104 <resource>
105 <directory>${taco.sourceDirectory}</directory>
106 <filtering>true</filtering>
107 </resource>
108 </resources>
109 </configuration>
110 </execution>
111 </executions>
112 </plugin>
113 <plugin>
114 <groupId>org.apache.maven.plugins</groupId>
115 <artifactId>maven-jar-plugin</artifactId>
116 <configuration>
117 <classesDirectory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</classesDirectory>
118 </configuration>
119 </plugin>
120 <plugin>
121 <groupId>org.apache.maven.plugins</groupId>
122 <artifactId>maven-source-plugin</artifactId>
123 <executions>
124 <execution>
125 <id>attach-sources</id>
126 <goals>
127 <goal>jar</goal>
128 </goals>
129 </execution>
130 </executions>
131 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700132 <plugin>
133 <groupId>org.codehaus.mojo</groupId>
134 <artifactId>exec-maven-plugin</artifactId>
135 <executions>
136 <execution>
137 <id>venv-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700138 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700139 <goals>
140 <goal>exec</goal>
141 </goals>
142 <configuration>
143 <!--suppress UnresolvedMavenProperty -->
144 <executable>${python.path}</executable>
145 <workingDirectory>${project.build.directory}</workingDirectory>
146 <arguments>
147 <argument>-m</argument>
148 <argument>venv</argument>
149 <argument>${build.venv.directory}</argument>
150 </arguments>
151 </configuration>
152 </execution>
153 <execution>
154 <id>taco-packager-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700155 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700156 <goals>
157 <goal>exec</goal>
158 </goals>
159 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700160 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700161 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
162 <arguments>
163 <argument>setup.py</argument>
164 <argument>install</argument>
165 </arguments>
166 <environmentVariables>
167 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
168 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
169 </environmentVariables>
170 </configuration>
171 </execution>
172 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700173 <!-- create .taco file using Taco SDK -->
174 <id>taco-package-sdk</id>
175 <phase>${build.taco.package.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700176 <goals>
177 <goal>exec</goal>
178 </goals>
179 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700180 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700181 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
182 <arguments>
183 <argument>-m</argument>
184 <argument>connector_packager.package</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700185 <argument>${build.taco.gensrc.plugin.class.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700186 <argument>--log</argument>
187 <argument>${build.taco.log.directory}</argument>
188 <argument>--dest</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700189 <argument>${project.build.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700190 </arguments>
191 <environmentVariables>
192 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
193 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
194 </environmentVariables>
195 </configuration>
196 </execution>
197 </executions>
198 </plugin>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700199 <plugin>
200 <groupId>org.apache.maven.plugins</groupId>
201 <artifactId>maven-shade-plugin</artifactId>
202 <executions>
203 <execution>
204 <!-- create .taco file if Taco SDK is not available -->
205 <id>taco-package-nosdk</id>
206 <phase>${build.taco.package.nosdk.stage}</phase>
207 <goals>
208 <goal>shade</goal>
209 </goals>
210 <configuration>
211 <outputFile>${build.taco.package.file}</outputFile>
212 <artifactSet>
213 <includes>
214 <include>org.apache.asterix:asterix-jdbc-taco</include>
215 </includes>
216 </artifactSet>
217 </configuration>
218 </execution>
219 </executions>
220 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700221 </plugins>
222 </build>
223
224 <profiles>
225 <profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700226 <id>taco-sdk-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700227 <activation>
228 <property>
229 <name>taco.sdk.path</name>
230 </property>
231 </activation>
232 <properties>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700233 <build.taco.init.sdk.stage>initialize</build.taco.init.sdk.stage>
234 <build.taco.package.sdk.stage>package</build.taco.package.sdk.stage>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700235 </properties>
236 <build>
237 <plugins>
238 <plugin>
239 <groupId>org.apache.maven.plugins</groupId>
240 <artifactId>maven-enforcer-plugin</artifactId>
241 <executions>
242 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700243 <id>enforce-taco-sdk-packager-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700244 <goals>
245 <goal>enforce</goal>
246 </goals>
247 <configuration>
248 <rules>
249 <requireProperty>
250 <property>python.path</property>
251 </requireProperty>
252 <requireFilesExist>
253 <files>
254 <!--suppress UnresolvedMavenProperty -->
255 <file>${python.path}</file>
256 <file>${taco.sdk.path}/connector-packager/setup.py</file>
257 </files>
258 </requireFilesExist>
259 </rules>
260 <fail>true</fail>
261 </configuration>
262 </execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700263 <execution>
264 <!-- ensure that .taco was created -->
265 <id>enforce-taco-package-success</id>
266 <phase>verify</phase>
267 <goals>
268 <goal>enforce</goal>
269 </goals>
270 <configuration>
271 <rules>
272 <requireFilesExist>
273 <files>
274 <file>${build.taco.package.file}</file>
275 </files>
276 </requireFilesExist>
277 </rules>
278 <fail>true</fail>
279 </configuration>
280 </execution>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700281 </executions>
282 </plugin>
283 </plugins>
284 </build>
285 </profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700286 <profile>
287 <id>taco-sdk-missing</id>
288 <activation>
289 <property>
290 <name>!taco.sdk.path</name>
291 </property>
292 </activation>
293 <properties>
294 <build.taco.package.nosdk.stage>package</build.taco.package.nosdk.stage>
295 </properties>
296 </profile>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700297 </profiles>
298</project>