|
6 | 6 |
|
7 | 7 | <groupId>co.cask.hydrator</groupId>
|
8 | 8 | <artifactId>elasticsearch-plugins</artifactId>
|
9 |
| - <version>1.8.0</version> |
| 9 | + <version>1.8.1</version> |
10 | 10 |
|
11 | 11 | <licenses>
|
12 | 12 | <license>
|
|
65 | 65 |
|
66 | 66 | <properties>
|
67 | 67 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
68 |
| - <cdap.version>4.2.0</cdap.version> |
| 68 | + <cdap.version>5.1.2</cdap.version> |
69 | 69 | <hadoop.version>2.3.0</hadoop.version>
|
70 | 70 | <junit.version>4.11</junit.version>
|
71 |
| - <hydrator.version>1.7.0</hydrator.version> |
| 71 | + <hydrator.version>2.1.2</hydrator.version> |
72 | 72 | <es.version>5.4.0</es.version>
|
73 | 73 | <es-hadoop.version>5.4.0</es-hadoop.version>
|
74 |
| - <widgets.dir>widgets</widgets.dir> |
75 | 74 | <slf4j.version>1.7.5</slf4j.version>
|
76 | 75 | <netty.version>4.0.30.Final</netty.version>
|
77 | 76 | <log4j.version>2.7</log4j.version>
|
78 | 77 | <logback.version>1.1.7</logback.version>
|
79 | 78 | <commons.version>3.1</commons.version>
|
80 | 79 | <junit.version>4.11</junit.version>
|
81 | 80 | <commons-httpclient.version>3.1</commons-httpclient.version>
|
82 |
| - <docs.dir>docs</docs.dir> |
83 |
| - <app.parents>system:cdap-data-pipeline[4.3.0-SNAPSHOT,5.0.0-SNAPSHOT),system:cdap-data-streams[4.3.0-SNAPSHOT,5.0.0-SNAPSHOT)</app.parents> |
84 | 81 | <!-- this is here because project.basedir evaluates to null in the script build step -->
|
85 | 82 | <main.basedir>${project.basedir}</main.basedir>
|
86 | 83 | </properties>
|
|
111 | 108 | <version>${cdap.version}</version>
|
112 | 109 | <scope>test</scope>
|
113 | 110 | </dependency>
|
114 |
| - <dependency> |
115 |
| - <groupId>co.cask.cdap</groupId> |
116 |
| - <artifactId>cdap-etl-realtime</artifactId> |
117 |
| - <version>${cdap.version}</version> |
118 |
| - <scope>test</scope> |
119 |
| - </dependency> |
120 | 111 | <dependency>
|
121 | 112 | <groupId>co.cask.hydrator</groupId>
|
122 | 113 | <artifactId>hydrator-common</artifactId>
|
|
338 | 329 | </executions>
|
339 | 330 | </plugin>
|
340 | 331 | <plugin>
|
341 |
| - <groupId>org.apache.maven.plugins</groupId> |
342 |
| - <artifactId>maven-antrun-plugin</artifactId> |
343 |
| - <version>1.7</version> |
| 332 | + <groupId>co.cask</groupId> |
| 333 | + <artifactId>cdap-maven-plugin</artifactId> |
| 334 | + <version>1.0.1</version> |
| 335 | + <configuration> |
| 336 | + <cdapArtifacts> |
| 337 | + <parent>system:cdap-data-pipeline[5.0.0,6.0.0-SNAPSHOT)</parent> |
| 338 | + <parent>system:cdap-data-streams[5.0.0,6.0.0-SNAPSHOT)</parent> |
| 339 | + </cdapArtifacts> |
| 340 | + </configuration> |
344 | 341 | <executions>
|
345 | 342 | <execution>
|
346 | 343 | <id>create-artifact-config</id>
|
347 | 344 | <phase>prepare-package</phase>
|
348 |
| - <configuration> |
349 |
| - <target> |
350 |
| - <script language="javascript"> <![CDATA[ |
351 |
| -
|
352 |
| - // for some reason, project.basedir evaluates to null if we just get the property here. |
353 |
| - // so we set main.basedir to project.basedir in the pom properties, then main.basedir is used here |
354 |
| - // where it evaluates correctly for whatever reason |
355 |
| - var baseDir = project.getProperty("main.basedir"); |
356 |
| - var targetDir = project.getProperty("project.build.directory"); |
357 |
| - var artifactId = project.getProperty("project.artifactId"); |
358 |
| - var version = project.getProperty("project.version"); |
359 |
| -
|
360 |
| - var cfgFile = new java.io.File(targetDir, artifactId + "-" + version + ".json"); |
361 |
| - if (!cfgFile.exists()) { |
362 |
| - cfgFile.createNewFile(); |
363 |
| - } |
364 |
| -
|
365 |
| - var parents = project.getProperty("app.parents").split(","); |
366 |
| - var config = { |
367 |
| - "parents": [ ], |
368 |
| - "properties": {} |
369 |
| - } |
370 |
| - for (i = 0; i < parents.length; i+=2) { |
371 |
| - // because name1[lo,hi],name2[lo,hi] gets split into "name1[lo", "hi]", "name2[lo", "hi]" |
372 |
| - // so we have to combine them again |
373 |
| - config.parents.push(parents[i] + "," + parents[i+1]); |
374 |
| - } |
375 |
| -
|
376 |
| - // look in widgets directory for widget config for each plugin |
377 |
| - var widgetsDir = new java.io.File(baseDir, project.getProperty("widgets.dir")); |
378 |
| - if (widgetsDir.isDirectory()) { |
379 |
| - var widgetsFiles = widgetsDir.listFiles(); |
380 |
| - for (i = 0; i < widgetsFiles.length; i++) { |
381 |
| - var widgetsFile = widgetsFiles[i]; |
382 |
| - if (widgetsFile.isFile()) { |
383 |
| - var propertyName = "widgets." + widgetsFile.getName(); |
384 |
| - // if the filename ends with .json |
385 |
| - if (propertyName.indexOf(".json", propertyName.length - 5) !== -1) { |
386 |
| - // strip the .json |
387 |
| - propertyName = propertyName.slice(0, -5); |
388 |
| - var contents = new java.lang.String(java.nio.file.Files.readAllBytes(widgetsFile.toPath()), java.nio.charset.StandardCharsets.UTF_8); |
389 |
| - var contentsAsJson = JSON.parse(contents); |
390 |
| - config.properties[propertyName] = JSON.stringify(contentsAsJson); |
391 |
| - } |
392 |
| - } |
393 |
| - } |
394 |
| - } |
395 |
| -
|
396 |
| - // look in the docs directory for docs for each plugin |
397 |
| - var docsDir = new java.io.File(baseDir, project.getProperty("docs.dir")); |
398 |
| - if (docsDir.isDirectory()) { |
399 |
| - var docFiles = docsDir.listFiles(); |
400 |
| - for (i = 0; i < docFiles.length; i++) { |
401 |
| - var docFile = docFiles[i]; |
402 |
| - if (docFile.isFile()) { |
403 |
| - var propertyName = "doc." + docFile.getName(); |
404 |
| - // if the filename ends with .md |
405 |
| - if (propertyName.indexOf(".md", propertyName.length - 3) !== -1) { |
406 |
| - // strip the extension |
407 |
| - propertyName = propertyName.slice(0, -3); |
408 |
| - var contents = new java.lang.String(java.nio.file.Files.readAllBytes(docFile.toPath()), java.nio.charset.StandardCharsets.UTF_8); |
409 |
| - config.properties[propertyName] = contents + ""; |
410 |
| - } |
411 |
| - } |
412 |
| - } |
413 |
| - } |
414 |
| -
|
415 |
| - var fw = new java.io.BufferedWriter(new java.io.FileWriter(cfgFile.getAbsoluteFile())); |
416 |
| - fw.write(JSON.stringify(config, null, 2)); |
417 |
| - fw.close(); |
418 |
| - ]]></script> |
419 |
| - </target> |
420 |
| - </configuration> |
421 | 345 | <goals>
|
422 |
| - <goal>run</goal> |
| 346 | + <goal>create-plugin-json</goal> |
423 | 347 | </goals>
|
424 | 348 | </execution>
|
425 | 349 | </executions>
|
|
0 commit comments