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