blob: 9223528e6ee3c80638073ce8e7823d4dc391d4ac [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>
50 <taco.plugin.port.default>19002</taco.plugin.port.default>
51 <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 Lychaginea552922021-10-11 15:40:15 -070055 <taco.plugin.jdbc.properties.aux> </taco.plugin.jdbc.properties.aux>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070056 <taco.plugin.auth.none><![CDATA[<option value="auth-none" label="No Authentication"/>]]></taco.plugin.auth.none>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -070057
58 <taco.sourceDirectory>${project.basedir}/src/main/taco</taco.sourceDirectory>
59
60 <build.taco.init.sdk.stage>none</build.taco.init.sdk.stage>
61 <build.taco.package.sdk.stage>none</build.taco.package.sdk.stage>
62 <build.taco.package.nosdk.stage>none</build.taco.package.nosdk.stage>
63 <build.taco.directory>${project.build.directory}/taco</build.taco.directory>
64 <build.taco.gensrc.directory>${build.taco.directory}/generated-sources</build.taco.gensrc.directory>
65 <build.taco.gensrc.plugin.class.directory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</build.taco.gensrc.plugin.class.directory>
66 <build.taco.log.directory>${build.taco.directory}</build.taco.log.directory>
67 <build.taco.package.file>${project.build.directory}/${taco.plugin.class}.taco</build.taco.package.file>
68 <build.venv.directory>${project.build.directory}/venv</build.venv.directory>
69 <build.venv.python.path>${build.venv.directory}/bin/python</build.venv.python.path>
Dmitry Lychaginf024b412021-10-11 10:31:08 -070070 </properties>
71
72 <build>
73 <resources>
74 <resource>
75 <directory>${taco.sourceDirectory}</directory>
76 </resource>
77 </resources>
78 <plugins>
79 <plugin>
80 <groupId>org.codehaus.mojo</groupId>
81 <artifactId>build-helper-maven-plugin</artifactId>
82 <executions>
83 <execution>
84 <id>parse-version</id>
85 <goals>
86 <goal>parse-version</goal>
87 </goals>
88 </execution>
89 </executions>
90 </plugin>
91 <plugin>
92 <artifactId>maven-resources-plugin</artifactId>
93 <executions>
94 <execution>
95 <id>taco-generate-sources</id>
96 <phase>generate-sources</phase>
97 <goals>
98 <goal>copy-resources</goal>
99 </goals>
100 <configuration>
101 <outputDirectory>${build.taco.gensrc.directory}</outputDirectory>
102 <resources>
103 <resource>
104 <directory>${taco.sourceDirectory}</directory>
105 <filtering>true</filtering>
106 </resource>
107 </resources>
108 </configuration>
109 </execution>
110 </executions>
111 </plugin>
112 <plugin>
113 <groupId>org.apache.maven.plugins</groupId>
114 <artifactId>maven-jar-plugin</artifactId>
115 <configuration>
116 <classesDirectory>${build.taco.gensrc.directory}/plugins/${taco.plugin.class}</classesDirectory>
117 </configuration>
118 </plugin>
119 <plugin>
120 <groupId>org.apache.maven.plugins</groupId>
121 <artifactId>maven-source-plugin</artifactId>
122 <executions>
123 <execution>
124 <id>attach-sources</id>
125 <goals>
126 <goal>jar</goal>
127 </goals>
128 </execution>
129 </executions>
130 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700131 <plugin>
132 <groupId>org.codehaus.mojo</groupId>
133 <artifactId>exec-maven-plugin</artifactId>
134 <executions>
135 <execution>
136 <id>venv-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700137 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700138 <goals>
139 <goal>exec</goal>
140 </goals>
141 <configuration>
142 <!--suppress UnresolvedMavenProperty -->
143 <executable>${python.path}</executable>
144 <workingDirectory>${project.build.directory}</workingDirectory>
145 <arguments>
146 <argument>-m</argument>
147 <argument>venv</argument>
148 <argument>${build.venv.directory}</argument>
149 </arguments>
150 </configuration>
151 </execution>
152 <execution>
153 <id>taco-packager-install</id>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700154 <phase>${build.taco.init.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700155 <goals>
156 <goal>exec</goal>
157 </goals>
158 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700159 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700160 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
161 <arguments>
162 <argument>setup.py</argument>
163 <argument>install</argument>
164 </arguments>
165 <environmentVariables>
166 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
167 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
168 </environmentVariables>
169 </configuration>
170 </execution>
171 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700172 <!-- create .taco file using Taco SDK -->
173 <id>taco-package-sdk</id>
174 <phase>${build.taco.package.sdk.stage}</phase>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700175 <goals>
176 <goal>exec</goal>
177 </goals>
178 <configuration>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700179 <executable>${build.venv.python.path}</executable>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700180 <workingDirectory>${taco.sdk.path}/connector-packager</workingDirectory>
181 <arguments>
182 <argument>-m</argument>
183 <argument>connector_packager.package</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700184 <argument>${build.taco.gensrc.plugin.class.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700185 <argument>--log</argument>
186 <argument>${build.taco.log.directory}</argument>
187 <argument>--dest</argument>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700188 <argument>${project.build.directory}</argument>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700189 </arguments>
190 <environmentVariables>
191 <VIRTUALENV>${build.venv.directory}</VIRTUALENV>
192 <PATH>${build.venv.directory}${file.separator}bin:${path.separator}${env.PATH}</PATH>
193 </environmentVariables>
194 </configuration>
195 </execution>
196 </executions>
197 </plugin>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700198 <plugin>
199 <groupId>org.apache.maven.plugins</groupId>
200 <artifactId>maven-shade-plugin</artifactId>
201 <executions>
202 <execution>
203 <!-- create .taco file if Taco SDK is not available -->
204 <id>taco-package-nosdk</id>
205 <phase>${build.taco.package.nosdk.stage}</phase>
206 <goals>
207 <goal>shade</goal>
208 </goals>
209 <configuration>
210 <outputFile>${build.taco.package.file}</outputFile>
211 <artifactSet>
212 <includes>
213 <include>org.apache.asterix:asterix-jdbc-taco</include>
214 </includes>
215 </artifactSet>
216 </configuration>
217 </execution>
218 </executions>
219 </plugin>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700220 </plugins>
221 </build>
222
223 <profiles>
224 <profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700225 <id>taco-sdk-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700226 <activation>
227 <property>
228 <name>taco.sdk.path</name>
229 </property>
230 </activation>
231 <properties>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700232 <build.taco.init.sdk.stage>initialize</build.taco.init.sdk.stage>
233 <build.taco.package.sdk.stage>package</build.taco.package.sdk.stage>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700234 </properties>
235 <build>
236 <plugins>
237 <plugin>
238 <groupId>org.apache.maven.plugins</groupId>
239 <artifactId>maven-enforcer-plugin</artifactId>
240 <executions>
241 <execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700242 <id>enforce-taco-sdk-packager-exists</id>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700243 <goals>
244 <goal>enforce</goal>
245 </goals>
246 <configuration>
247 <rules>
248 <requireProperty>
249 <property>python.path</property>
250 </requireProperty>
251 <requireFilesExist>
252 <files>
253 <!--suppress UnresolvedMavenProperty -->
254 <file>${python.path}</file>
255 <file>${taco.sdk.path}/connector-packager/setup.py</file>
256 </files>
257 </requireFilesExist>
258 </rules>
259 <fail>true</fail>
260 </configuration>
261 </execution>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700262 <execution>
263 <!-- ensure that .taco was created -->
264 <id>enforce-taco-package-success</id>
265 <phase>verify</phase>
266 <goals>
267 <goal>enforce</goal>
268 </goals>
269 <configuration>
270 <rules>
271 <requireFilesExist>
272 <files>
273 <file>${build.taco.package.file}</file>
274 </files>
275 </requireFilesExist>
276 </rules>
277 <fail>true</fail>
278 </configuration>
279 </execution>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700280 </executions>
281 </plugin>
282 </plugins>
283 </build>
284 </profile>
Dmitry Lychagindd8616e2021-10-13 10:34:43 -0700285 <profile>
286 <id>taco-sdk-missing</id>
287 <activation>
288 <property>
289 <name>!taco.sdk.path</name>
290 </property>
291 </activation>
292 <properties>
293 <build.taco.package.nosdk.stage>package</build.taco.package.nosdk.stage>
294 </properties>
295 </profile>
Dmitry Lychaginf024b412021-10-11 10:31:08 -0700296 </profiles>
297</project>