Convert examples to Rhino Javascript format
[policy/apex-pdp.git] / examples / examples-myfirstpolicy / pom.xml
1 <!--
2   ============LICENSE_START=======================================================
3    Copyright (C) 2018 Ericsson. All rights reserved.
4    Modifications Copyright (C) 2020 Nordix Foundation.
5   ================================================================================
6   Licensed under the Apache License, Version 2.0 (the "License");
7   you may not use this file except in compliance with the License.
8   You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12   Unless required by applicable law or agreed to in writing, software
13   distributed under the License is distributed on an "AS IS" BASIS,
14   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   See the License for the specific language governing permissions and
16   limitations under the License.
17
18   SPDX-License-Identifier: Apache-2.0
19   ============LICENSE_END=========================================================
20 -->
21 <project
22     xmlns="http://maven.apache.org/POM/4.0.0"
23     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.3.0-SNAPSHOT</version>
30     </parent>
31
32     <artifactId>examples-myfirstpolicy</artifactId>
33     <name>${project.artifactId}</name>
34     <description>Specific code for the Apex MyFirstPolicy Example</description>
35
36     <properties>
37         <policymodel1m.name>MyFirstPolicyModelMvel_0.0.1</policymodel1m.name>
38         <policymodel1j.name>MyFirstPolicyModelJavascript_0.0.1</policymodel1j.name>
39         <policymodel2.name>MyFirstPolicyModel_0.0.1</policymodel2.name>
40     </properties>
41
42     <dependencies>
43         <dependency>
44             <groupId>org.onap.policy.apex-pdp.model</groupId>
45             <artifactId>policy-model</artifactId>
46             <version>${project.version}</version>
47         </dependency>
48         <dependency>
49             <groupId>org.onap.policy.apex-pdp.core</groupId>
50             <artifactId>core-engine</artifactId>
51             <version>${project.version}</version>
52             <scope>test</scope>
53         </dependency>
54         <dependency>
55             <groupId>org.onap.policy.apex-pdp.core</groupId>
56             <artifactId>core-infrastructure</artifactId>
57             <version>${project.version}</version>
58             <scope>test</scope>
59         </dependency>
60         <dependency>
61             <groupId>org.onap.policy.apex-pdp.auth</groupId>
62             <artifactId>cli-editor</artifactId>
63             <version>${project.version}</version>
64         </dependency>
65         <dependency>
66             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
67             <artifactId>plugins-executor-mvel</artifactId>
68             <version>${project.version}</version>
69             <scope>test</scope>
70         </dependency>
71         <dependency>
72             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
73             <artifactId>plugins-executor-javascript</artifactId>
74             <version>${project.version}</version>
75             <scope>test</scope>
76         </dependency>
77     </dependencies>
78
79     <build>
80         <plugins>
81             <plugin>
82                 <groupId>org.codehaus.mojo</groupId>
83                 <artifactId>exec-maven-plugin</artifactId>
84                 <executions>
85                     <!-- Generate the APEX Policy JSON files from the APEX CLI command -->
86                     <execution>
87                         <id>generate-policy1m</id>
88                         <phase>compile</phase>
89                         <goals>
90                             <goal>java</goal>
91                         </goals>
92                         <configuration>
93                             <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
94                             <classpathScope>compile</classpathScope>
95                             <arguments>
96                                 <argument>--command-file=${project.basedir}/src/main/resources/examples/models/MyFirstPolicy/1/${policymodel1m.name}.apex</argument>
97                                 <argument>--output-model-file=${project.build.directory}/classes/examples/models/MyFirstPolicy/1/${policymodel1m.name}.json</argument>
98                                 <argument>--log-file=${project.build.directory}/${policymodel1.name}_policygeneration.log</argument>
99                                 <argument>--working-dir=${project.basedir}</argument>
100                             </arguments>
101                         </configuration>
102                     </execution>
103                     <execution>
104                         <id>generate-policy1j</id>
105                         <phase>compile</phase>
106                         <goals>
107                             <goal>java</goal>
108                         </goals>
109                         <configuration>
110                             <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
111                             <classpathScope>compile</classpathScope>
112                             <arguments>
113                                 <argument>--command-file=${project.basedir}/src/main/resources/examples/models/MyFirstPolicy/1/${policymodel1j.name}.apex</argument>
114                                 <argument>--output-model-file=${project.build.directory}/classes/examples/models/MyFirstPolicy/1/${policymodel1j.name}.json</argument>
115                                 <argument>--log-file=${project.build.directory}/${policymodel1.name}_policygeneration.log</argument>
116                                 <argument>--working-dir=${project.basedir}</argument>
117                             </arguments>
118                         </configuration>
119                     </execution>
120                     <execution>
121                         <id>generate-policy2</id>
122                         <phase>compile</phase>
123                         <goals>
124                             <goal>java</goal>
125                         </goals>
126                         <configuration>
127                             <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
128                             <classpathScope>compile</classpathScope>
129                             <arguments>
130                                 <argument>--command-file=${project.basedir}/src/main/resources/examples/models/MyFirstPolicy/2/${policymodel2.name}.apex</argument>
131                                 <argument>--output-model-file=${project.build.directory}/classes/examples/models/MyFirstPolicy/2/${policymodel2.name}.json</argument>
132                                 <argument>--log-file=${project.build.directory}/${policymodel2.name}_policygeneration.log</argument>
133                                 <argument>--working-dir=${project.basedir}</argument>
134                             </arguments>
135                         </configuration>
136                     </execution>
137                 </executions>
138             </plugin>
139         </plugins>
140     </build>
141
142     <profiles>
143         <profile>
144             <id>apexSite</id>
145             <activation>
146                 <property>
147                     <name>apexSite</name>
148                 </property>
149             </activation>
150             <properties>
151                 <adsite-examples-myfirstpolicy-dir>${project.basedir}/src</adsite-examples-myfirstpolicy-dir>
152             </properties>
153             <distributionManagement>
154                 <site>
155                     <id>${project.artifactId}-site</id>
156                     <url>${apex.adsite.prefix}/modules/${project.parent.artifactId}/${project.artifactId}/</url>
157                 </site>
158             </distributionManagement>
159             <build>
160                 <plugins>
161                     <plugin>
162                         <groupId>org.apache.maven.plugins</groupId>
163                         <artifactId>maven-resources-plugin</artifactId>
164                         <version>3.0.2</version>
165                         <executions>
166                             <execution>
167                                 <id>copy-domain-mfp-images</id>
168                                 <phase>initialize</phase>
169                                 <goals>
170                                     <goal>copy-resources</goal>
171                                 </goals>
172                                 <configuration>
173                                     <resources>
174                                         <resource>
175                                             <directory>${project.basedir}/src/site-docs/adoc/resources/images</directory>
176                                             <includes>
177                                                 <include>**/*.jpg</include>
178                                                 <include>**/*.png</include>
179                                             </includes>
180                                         </resource>
181                                     </resources>
182                                     <outputDirectory>${project.build.directory}/site/images</outputDirectory>
183                                 </configuration>
184                             </execution>
185                         </executions>
186                     </plugin>
187                 </plugins>
188             </build>
189         </profile>
190     </profiles>
191 </project>