d025a62b3e9bebd4eff65b9318ceb4b3ed72b3df
[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>3.0.2-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     </dependencies>
91     <build>
92         <plugins>
93             <plugin>
94                 <groupId>org.apache.maven.plugins</groupId>
95                 <artifactId>maven-surefire-plugin</artifactId>
96                 <configuration>
97                     <argLine>-Xss1m</argLine>
98                 </configuration>
99             </plugin>
100             <plugin>
101                 <groupId>org.codehaus.mojo</groupId>
102                 <artifactId>exec-maven-plugin</artifactId>
103                 <executions>
104                     <!-- Generate the APEX Policy JSON from the APEX CLI command -->
105                     <execution>
106                         <id>generate-policy</id>
107                         <phase>compile</phase>
108                         <goals>
109                             <goal>java</goal>
110                         </goals>
111                         <configuration>
112                             <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
113                             <classpathScope>compile</classpathScope>
114                             <arguments>
115                                 <argument>
116                                     --command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex
117                                 </argument>
118                                 <argument>
119                                     --output-model-file=${project.build.directory}/classes/${policymodel.name}.json
120                                 </argument>
121                                 <argument>
122                                     --log-file=${project.build.directory}/${policymodel.name}_policygeneration.log
123                                 </argument>
124                                 <argument>--working-dir=${project.basedir}</argument>
125                             </arguments>
126                         </configuration>
127                     </execution>
128                     <!-- Generate the APEX ToscaPolicy JSON file-->
129                     <execution>
130                         <id>generate-tosca-policy</id>
131                         <phase>compile</phase>
132                         <goals>
133                             <goal>java</goal>
134                         </goals>
135                         <configuration>
136                             <mainClass>org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain</mainClass>
137                             <classpathScope>compile</classpathScope>
138                             <arguments>
139                                 <argument>
140                                     --command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex
141                                 </argument>
142                                 <argument>
143                                     --output-tosca-file=${project.build.directory}/classes/${toscapolicy.name}.json
144                                 </argument>
145                                 <argument>
146                                     --log-file=${project.build.directory}/${policymodel.name}_policygeneration.log
147                                 </argument>
148                                 <argument>
149                                     --apex-config-file=${project.basedir}/src/main/resources/examples/config/APEXgRPC/ApexConfig.json
150                                 </argument>
151                                 <argument>
152                                     --tosca-template-file=${project.basedir}/src/main/resources/tosca/ToscaTemplate.json
153                                 </argument>
154                             </arguments>
155                         </configuration>
156                     </execution>
157                     <!-- Generate Tosca policy with metadataSet reference and a node template json file with policy model -->
158                     <execution>
159                         <id>generate-tosca-policy-metadataSet</id>
160                         <phase>compile</phase>
161                         <goals>
162                             <goal>java</goal>
163                         </goals>
164                         <configuration>
165                             <mainClass>org.onap.policy.apex.auth.clieditor.tosca.ApexCliToscaEditorMain</mainClass>
166                             <classpathScope>compile</classpathScope>
167                             <arguments>
168                                 <argument>
169                                     --command-file=${project.basedir}/src/main/resources/policy/${policymodel.name}.apex
170                                 </argument>
171                                 <argument>
172                                     --output-tosca-file=${project.build.directory}/classes/${toscapolicy.name}.metadataSet.json
173                                 </argument>
174                                 <argument>
175                                     --log-file=${project.build.directory}/${policymodel.name}_policygeneration.log
176                                 </argument>
177                                 <argument>
178                                     --apex-config-file=${project.basedir}/src/main/resources/examples/config/APEXgRPC/ApexConfig.json
179                                 </argument>
180                                 <argument>
181                                     --tosca-template-file=${project.basedir}/src/main/resources/tosca/ToscaTemplate.json
182                                 </argument>
183                                 <argument>--node-type=${nodeType.name}</argument>
184                                 <argument>
185                                     --output-node-template-file=${project.build.directory}/classes/${toscapolicy.name}.nodeTemplate.json
186                                 </argument>
187                             </arguments>
188                         </configuration>
189                     </execution>
190                 </executions>
191             </plugin>
192         </plugins>
193     </build>
194 </project>