1 <?xml version="1.0" encoding="UTF-8"?>
\r
3 ~ ===============================LICENSE_START======================================
\r
5 ~ ================================================================================
\r
6 ~ Copyright © 2017 AT&T Intellectual Property. All rights reserved.
\r
7 ~ ================================================================================
\r
8 ~ Licensed under the Apache License, Version 2.0 (the "License");
\r
9 ~ you may not use this file except in compliance with the License.
\r
10 ~ You may obtain a copy of the License at
\r
12 ~ http://www.apache.org/licenses/LICENSE-2.0
\r
14 ~ Unless required by applicable law or agreed to in writing, software
\r
15 ~ distributed under the License is distributed on an "AS IS" BASIS,
\r
16 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 ~ See the License for the specific language governing permissions and
\r
18 ~ limitations under the License.
\r
19 ~ ============================LICENSE_END===========================================
\r
22 <project xmlns="http://maven.apache.org/POM/4.0.0"
\r
23 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
\r
24 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
\r
26 <modelVersion>4.0.0</modelVersion>
\r
29 <artifactId>dcae-analytics</artifactId>
\r
30 <groupId>org.onap.dcaegen2.analytics.tca</groupId>
\r
31 <version>2.0.0-SNAPSHOT</version>
\r
34 <artifactId>dcae-analytics-cdap-plugins</artifactId>
\r
35 <packaging>jar</packaging>
\r
37 <!-- THIS MODULE CONTAINS CDAP CODE FOR PLUGINS -->
\r
38 <name>DCAE Analytics CDAP Plugins</name>
\r
39 <description>DCAE Analytics CDAP Plugins to build CDAP Pipelines</description>
\r
42 <main.basedir>${project.parent.basedir}</main.basedir>
\r
43 <main.basedir.plugins>${project.basedir}</main.basedir.plugins>
\r
44 <widgets.dir>widgets</widgets.dir>
\r
45 <docs.dir>docs</docs.dir>
\r
47 system:cdap-etl-batch[4.0.0,4.1.0-SNAPSHOT),system:cdap-etl-realtime[4.0.0,4.1.0-SNAPSHOT),system:cdap-data-pipeline[4.0.0,4.1.0-SNAPSHOT),system:cdap-data-streams[4.0.0,4.1.0-SNAPSHOT)
\r
53 <!-- DCAE DEPENDENCIES -->
\r
55 <groupId>org.onap.dcaegen2.analytics.tca</groupId>
\r
56 <artifactId>dcae-analytics-cdap-common</artifactId>
\r
57 <version>2.0.0-SNAPSHOT</version>
\r
61 <groupId>org.onap.dcaegen2.analytics.tca</groupId>
\r
62 <artifactId>dcae-analytics-tca</artifactId>
\r
63 <version>2.0.0-SNAPSHOT</version>
\r
69 <groupId>co.cask.cdap</groupId>
\r
70 <artifactId>cdap-api</artifactId>
\r
74 <groupId>co.cask.cdap</groupId>
\r
75 <artifactId>cdap-etl-api</artifactId>
\r
79 <groupId>co.cask.cdap</groupId>
\r
80 <artifactId>cdap-etl-api-spark</artifactId>
\r
84 <groupId>co.cask.cdap</groupId>
\r
85 <artifactId>cdap-etl-realtime</artifactId>
\r
89 <groupId>co.cask.cdap</groupId>
\r
90 <artifactId>cdap-data-pipeline</artifactId>
\r
94 <groupId>co.cask.cdap</groupId>
\r
95 <artifactId>cdap-data-streams</artifactId>
\r
99 <groupId>org.apache.spark</groupId>
\r
100 <artifactId>spark-streaming_2.10</artifactId>
\r
105 <groupId>co.cask.http</groupId>
\r
106 <artifactId>netty-http</artifactId>
\r
109 <groupId>co.cask.common</groupId>
\r
110 <artifactId>common-http</artifactId>
\r
115 <groupId>org.apache.hadoop</groupId>
\r
116 <artifactId>hadoop-mapreduce-client-core</artifactId>
\r
119 <groupId>org.apache.hadoop</groupId>
\r
120 <artifactId>hadoop-common</artifactId>
\r
125 <groupId>org.apache.spark</groupId>
\r
126 <artifactId>spark-core_2.10</artifactId>
\r
131 <groupId>org.slf4j</groupId>
\r
132 <artifactId>slf4j-api</artifactId>
\r
136 <groupId>ch.qos.logback</groupId>
\r
137 <artifactId>logback-core</artifactId>
\r
141 <groupId>ch.qos.logback</groupId>
\r
142 <artifactId>logback-classic</artifactId>
\r
147 <groupId>com.google.code.findbugs</groupId>
\r
148 <artifactId>jsr305</artifactId>
\r
149 <version>${findbugs.jsr305.version}</version>
\r
150 <scope>provided</scope>
\r
154 <groupId>com.google.code.findbugs</groupId>
\r
155 <artifactId>annotations</artifactId>
\r
156 <version>${findbugs.annotations.version}</version>
\r
157 <scope>provided</scope>
\r
160 <!-- TEST DEPENDENCIES -->
\r
162 <groupId>org.onap.dcaegen2.analytics.tca</groupId>
\r
163 <artifactId>dcae-analytics-test</artifactId>
\r
164 <version>2.0.0-SNAPSHOT</version>
\r
165 <scope>test</scope>
\r
169 <groupId>co.cask.cdap</groupId>
\r
170 <artifactId>hydrator-test</artifactId>
\r
174 <groupId>co.cask.cdap</groupId>
\r
175 <artifactId>cdap-unit-test</artifactId>
\r
178 <artifactId>org.apache.httpcomponents</artifactId>
\r
179 <groupId>httpcore</groupId>
\r
191 <groupId>org.apache.felix</groupId>
\r
192 <artifactId>maven-bundle-plugin</artifactId>
\r
195 <!-- List of packages that are scanned for plugins -->
\r
197 org.openecomp.dcae.apod.analytics.dmaap.domain.response.*,
\r
198 org.openecomp.dcae.apod.analytics.dmaap.domain.config.*;
\r
199 org.openecomp.dcae.apod.analytics.dmaap.service.subscriber.*;
\r
200 org.openecomp.dcae.apod.analytics.dmaap.service.*;
\r
201 org.openecomp.dcae.apod.analytics.cdap.common.settings.*;
\r
202 org.openecomp.dcae.apod.analytics.cdap.plugins.common.*;
\r
203 org.openecomp.dcae.apod.analytics.cdap.plugins.batch.sink.dmaap.*;
\r
204 org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.dmaap.*;
\r
205 org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.filter.*;
\r
206 org.openecomp.dcae.apod.analytics.cdap.plugins.domain.config.tca.*;
\r
207 org.openecomp.dcae.apod.analytics.cdap.plugins.sparkcompute.tca.*;
\r
208 org.openecomp.dcae.apod.analytics.cdap.plugins.streaming.dmaap.*;
\r
209 org.openecomp.dcae.apod.analytics.cdap.plugins.transform.filter.*;
\r
210 com.google.common.base.*;
\r
211 com.google.inject.*;
\r
215 org.apache.commons.*
\r
223 <groupId>org.apache.maven.plugins</groupId>
\r
224 <artifactId>maven-antrun-plugin</artifactId>
\r
226 <!-- Create the config file for artifact which can be used to deploy the artifact.
\r
227 Sets the parents field to system:cdap-etl-batch and system:cdap-etl-realtime with whatever
\r
228 version range is set in the app.parents property.
\r
229 also sets a widget and doc property for each file contained in the widgets and docs directories. -->
\r
231 <id>create-artifact-config</id>
\r
232 <phase>prepare-package</phase>
\r
235 <script language="javascript"> <![CDATA[
\r
236 // for some reason, project.basedir evaluates to null if we just get the property here.
\r
237 // so we set main.basedir to project.basedir in the pom properties, then main.basedir is used here
\r
238 // where it evaluates correctly for whatever reason
\r
239 var baseDir = project.getProperty("main.basedir.plugins");
\r
240 var targetDir = project.getProperty("project.build.directory");
\r
241 var artifactId = project.getProperty("project.artifactId");
\r
242 var version = project.getProperty("project.version");
\r
244 var cfgFile = new java.io.File(targetDir, artifactId + "-" + version + ".json");
\r
245 if (!cfgFile.exists()) {
\r
246 cfgFile.createNewFile();
\r
249 var parents = project.getProperty("app.parents").split(",");
\r
254 for (i = 0; i < parents.length; i+=2) {
\r
255 // because name1[lo,hi],name2[lo,hi] gets split into "name1[lo", "hi]", "name2[lo", "hi]"
\r
256 // so we have to combine them again
\r
257 config.parents.push(parents[i] + "," + parents[i+1]);
\r
260 // look in widgets directory for widget config for each plugin
\r
261 var widgetsDir = new java.io.File(baseDir, project.getProperty("widgets.dir"));
\r
262 if (widgetsDir.isDirectory()) {
\r
263 var widgetsFiles = widgetsDir.listFiles();
\r
264 for (i = 0; i < widgetsFiles.length; i++) {
\r
265 var widgetsFile = widgetsFiles[i];
\r
266 if (widgetsFile.isFile()) {
\r
267 var propertyName = "widgets." + widgetsFile.getName();
\r
268 // if the filename ends with .json
\r
269 if (propertyName.indexOf(".json", propertyName.length - 5) !== -1) {
\r
271 propertyName = propertyName.slice(0, -5);
\r
272 var contents = new java.lang.String(java.nio.file.Files.readAllBytes(widgetsFile.toPath()), java.nio.charset.StandardCharsets.UTF_8);
\r
273 var contentsAsJson = JSON.parse(contents);
\r
274 config.properties[propertyName] = JSON.stringify(contentsAsJson);
\r
280 // look in the docs directory for docs for each plugin
\r
281 var docsDir = new java.io.File(baseDir, project.getProperty("docs.dir"));
\r
282 if (docsDir.isDirectory()) {
\r
283 var docFiles = docsDir.listFiles();
\r
284 for (i = 0; i < docFiles.length; i++) {
\r
285 var docFile = docFiles[i];
\r
286 if (docFile.isFile()) {
\r
287 var propertyName = "doc." + docFile.getName();
\r
288 // if the filename ends with .md
\r
289 if (propertyName.indexOf(".md", propertyName.length - 3) !== -1) {
\r
290 // strip the extension
\r
291 propertyName = propertyName.slice(0, -3);
\r
292 var contents = new java.lang.String(java.nio.file.Files.readAllBytes(docFile.toPath()), java.nio.charset.StandardCharsets.UTF_8);
\r
293 config.properties[propertyName] = contents + "";
\r
299 var fw = new java.io.BufferedWriter(new java.io.FileWriter(cfgFile.getAbsoluteFile()));
\r
300 fw.write(JSON.stringify(config, null, 2));
\r