df4df53730c4c27b789d4a0a3b6826b8f30b1990
[policy/apex-pdp.git] / examples / examples-grpc / pom.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3   ============LICENSE_START=======================================================
4    Copyright (C) 2020 Nordix Foundation.
5    Modifications Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18
19   SPDX-License-Identifier: Apache-2.0
20   ============LICENSE_END=========================================================
21 -->
22 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24    <modelVersion>4.0.0</modelVersion>
25    <parent>
26       <groupId>org.onap.policy.apex-pdp.examples</groupId>
27       <artifactId>examples</artifactId>
28       <version>2.8.0-SNAPSHOT</version>
29    </parent>
30    <artifactId>examples-grpc</artifactId>
31    <name>examples-grpc</name>
32    <description>Specific code for the APEX gRPC Example</description>
33    <properties>
34       <policymodel.name>APEXgRPCPolicy</policymodel.name>
35       <toscapolicy.name>APEXgRPCToscaPolicy</toscapolicy.name>
36       <!-- Update the required node type value for generating a node template -->
37       <nodeType.name>org.onap.nodetypes.policy.MetadataSet</nodeType.name>
38    </properties>
39    <dependencies>
40       <dependency>
41          <groupId>org.onap.policy.apex-pdp.auth</groupId>
42          <artifactId>cli-editor</artifactId>
43          <version>${project.version}</version>
44       </dependency>
45       <dependency>
46          <groupId>org.onap.policy.apex-pdp.services</groupId>
47          <artifactId>services-engine</artifactId>
48          <version>${project.version}</version>
49       </dependency>
50       <dependency>
51          <groupId>org.onap.policy.apex-pdp.plugins.plugins-context.plugins-context-schema</groupId>
52          <artifactId>plugins-context-schema-avro</artifactId>
53          <version>${project.version}</version>
54       </dependency>
55       <dependency>
56          <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
57          <artifactId>plugins-executor-javascript</artifactId>
58          <version>${project.version}</version>
59       </dependency>
60       <dependency>
61          <groupId>org.onap.policy.apex-pdp.plugins.plugins-event.plugins-event-carrier</groupId>
62          <artifactId>plugins-event-carrier-grpc</artifactId>
63          <version>${project.version}</version>
64       </dependency>
65       <dependency>
66          <groupId>org.onap.policy.apex-pdp.plugins.plugins-event.plugins-event-carrier</groupId>
67          <artifactId>plugins-event-carrier-restclient</artifactId>
68          <version>${project.version}</version>
69       </dependency>
70       <dependency>
71          <groupId>org.onap.policy.models.policy-models-interactions.model-impl</groupId>
72          <artifactId>events</artifactId>
73          <version>${version.policy.models}</version>
74       </dependency>
75       <dependency>
76         <groupId>org.onap.policy.models.policy-models-interactions</groupId>
77         <artifactId>simulators</artifactId>
78          <version>${version.policy.models}</version>
79       </dependency>
80       <dependency>
81          <groupId>org.onap.policy.common</groupId>
82          <artifactId>policy-endpoints</artifactId>
83       </dependency>
84       <dependency>
85          <groupId>junit</groupId>
86          <artifactId>junit</artifactId>
87          <scope>test</scope>
88       </dependency>
89    </dependencies>
90    <build>
91       <plugins>
92          <plugin>
93             <groupId>org.codehaus.mojo</groupId>
94             <artifactId>exec-maven-plugin</artifactId>
95             <executions>
96                <!-- Generate the APEX Policy JSON from the APEX CLI command -->
97                <execution>
98                   <id>generate-policy</id>
99                   <phase>compile</phase>
100                   <goals>
101                      <goal>java</goal>
102                   </goals>
103                   <configuration>
104                      <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
105                      <classpathScope>compile</classpathScope>
106                      <arguments>
107                         <argument>--command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex</argument>
108                         <argument>--output-model-file=${project.build.directory}/classes/${policymodel.name}.json</argument>
109                         <argument>--log-file=${project.build.directory}/${policymodel.name}_policygeneration.log</argument>
110                         <argument>--working-dir=${project.basedir}</argument>
111                      </arguments>
112                   </configuration>
113                </execution>
114                <!-- Generate the APEX ToscaPolicy JSON file-->
115                <execution>
116                   <id>generate-tosca-policy</id>
117                   <phase>compile</phase>
118                   <goals>
119                      <goal>java</goal>
120                   </goals>
121                   <configuration>
122                      <mainClass>org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain</mainClass>
123                      <classpathScope>compile</classpathScope>
124                      <arguments>
125                         <argument>--command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex</argument>
126                         <argument>--output-tosca-file=${project.build.directory}/classes/${toscapolicy.name}.json</argument>
127                         <argument>--log-file=${project.build.directory}/${policymodel.name}_policygeneration.log</argument>
128                         <argument>--apex-config-file=${project.basedir}/src/main/resources/examples/config/APEXgRPC/ApexConfig.json</argument>
129                         <argument>--tosca-template-file=${project.basedir}/src/main/resources/tosca/ToscaTemplate.json</argument>
130                      </arguments>
131                   </configuration>
132                </execution>
133                <!-- Generate Tosca policy with metadataSet reference and a node template json file with policy model -->
134                <execution>
135                   <id>generate-tosca-policy-metadataSet</id>
136                   <phase>compile</phase>
137                   <goals>
138                      <goal>java</goal>
139                   </goals>
140                   <configuration>
141                      <mainClass>org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain</mainClass>
142                      <classpathScope>compile</classpathScope>
143                      <arguments>
144                         <argument>--command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex</argument>
145                         <argument>--output-tosca-file=${project.build.directory}/classes/${toscapolicy.name}.metadataSet.json</argument>
146                         <argument>--log-file=${project.build.directory}/${policymodel.name}_policygeneration.log</argument>
147                         <argument>--apex-config-file=${project.basedir}/src/main/resources/examples/config/APEXgRPC/ApexConfig.json</argument>
148                         <argument>--tosca-template-file=${project.basedir}/src/main/resources/tosca/ToscaTemplate.json</argument>
149                         <argument>--node-type=${nodeType.name}</argument>
150                         <argument>--output-node-template-file=${project.build.directory}/classes/${toscapolicy.name}.nodeTemplate.json</argument>
151                      </arguments>
152                   </configuration>
153                </execution>
154             </executions>
155          </plugin>
156       </plugins>
157    </build>
158 </project>