Run apex-pdp in Java 11: base changes
[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         <policymodel1.name>MyFirstPolicyModel_0.0.1</policymodel1.name>
38         <policymodel2.name>MyFirstPolicyModel_0.0.1</policymodel2.name>
39     </properties>
40
41     <dependencies>
42         <dependency>
43             <groupId>org.onap.policy.apex-pdp.model</groupId>
44             <artifactId>policy-model</artifactId>
45             <version>${project.version}</version>
46         </dependency>
47         <dependency>
48             <groupId>org.onap.policy.apex-pdp.core</groupId>
49             <artifactId>core-engine</artifactId>
50             <version>${project.version}</version>
51             <scope>test</scope>
52         </dependency>
53         <dependency>
54             <groupId>org.onap.policy.apex-pdp.core</groupId>
55             <artifactId>core-infrastructure</artifactId>
56             <version>${project.version}</version>
57             <scope>test</scope>
58         </dependency>
59         <dependency>
60             <groupId>org.onap.policy.apex-pdp.auth</groupId>
61             <artifactId>cli-editor</artifactId>
62             <version>${project.version}</version>
63         </dependency>
64         <dependency>
65             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
66             <artifactId>plugins-executor-mvel</artifactId>
67             <version>${project.version}</version>
68             <scope>test</scope>
69         </dependency>
70         <dependency>
71             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
72             <artifactId>plugins-executor-javascript</artifactId>
73             <version>${project.version}</version>
74             <scope>test</scope>
75         </dependency>
76     </dependencies>
77
78     <build>
79         <plugins>
80             <plugin>
81                 <groupId>org.codehaus.mojo</groupId>
82                 <artifactId>exec-maven-plugin</artifactId>
83                 <executions>
84                     <execution>
85                         <id>generate-models</id>
86                         <phase>compile</phase>
87                         <goals>
88                             <goal>java</goal>
89                         </goals>
90                         <configuration>
91                             <mainClass>org.onap.policy.apex.examples.myfirstpolicy.model.MfpDomainModelSaver</mainClass>
92                             <classpathScope>compile</classpathScope>
93                             <arguments>
94                                 <argument>${project.build.directory}/classes/examples/models/MyFirstPolicy</argument>
95                             </arguments>
96                         </configuration>
97                     </execution>
98                 </executions>
99             </plugin>
100             <plugin>
101                 <groupId>org.codehaus.mojo</groupId>
102                 <artifactId>exec-maven-plugin</artifactId>
103                 <executions>
104                     <!-- Generate the APEX Policy JSON files from the APEX CLI command -->
105                     <execution>
106                         <id>generate-policy1</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>--command-file=${project.basedir}/src/main/resources/examples/models/MyFirstPolicy/1/${policymodel1.name}.apex</argument>
116                                 <argument>--output-model-file=${project.build.directory}/classes/examples/models/MyFirstPolicy/1/${policymodel1.name}.json</argument>
117                                 <argument>--log-file=${project.build.directory}/${policymodel1.name}_policygeneration.log</argument>
118                                 <argument>--working-dir=${project.basedir}</argument>
119                             </arguments>
120                         </configuration>
121                     </execution>
122                     <execution>
123                         <id>generate-policy2</id>
124                         <phase>compile</phase>
125                         <goals>
126                             <goal>java</goal>
127                         </goals>
128                         <configuration>
129                             <mainClass>org.onap.policy.apex.auth.clieditor.ApexCommandLineEditorMain</mainClass>
130                             <classpathScope>compile</classpathScope>
131                             <arguments>
132                                 <argument>--command-file=${project.basedir}/src/main/resources/examples/models/MyFirstPolicy/2/${policymodel2.name}.apex</argument>
133                                 <argument>--output-model-file=${project.build.directory}/classes/examples/models/MyFirstPolicy/2/${policymodel2.name}.json</argument>
134                                 <argument>--log-file=${project.build.directory}/${policymodel2.name}_policygeneration.log</argument>
135                                 <argument>--working-dir=${project.basedir}</argument>
136                             </arguments>
137                         </configuration>
138                     </execution>
139                 </executions>
140             </plugin>
141         </plugins>
142     </build>
143
144     <profiles>
145         <profile>
146             <id>apexSite</id>
147             <activation>
148                 <property>
149                     <name>apexSite</name>
150                 </property>
151             </activation>
152             <properties>
153                 <adsite-examples-myfirstpolicy-dir>${project.basedir}/src</adsite-examples-myfirstpolicy-dir>
154             </properties>
155             <distributionManagement>
156                 <site>
157                     <id>${project.artifactId}-site</id>
158                     <url>${apex.adsite.prefix}/modules/${project.parent.artifactId}/${project.artifactId}/</url>
159                 </site>
160             </distributionManagement>
161             <build>
162                 <plugins>
163                     <plugin>
164                         <groupId>org.apache.maven.plugins</groupId>
165                         <artifactId>maven-resources-plugin</artifactId>
166                         <version>3.0.2</version>
167                         <executions>
168                             <execution>
169                                 <id>copy-domain-mfp-images</id>
170                                 <phase>initialize</phase>
171                                 <goals>
172                                     <goal>copy-resources</goal>
173                                 </goals>
174                                 <configuration>
175                                     <resources>
176                                         <resource>
177                                             <directory>${project.basedir}/src/site-docs/adoc/resources/images</directory>
178                                             <includes>
179                                                 <include>**/*.jpg</include>
180                                                 <include>**/*.png</include>
181                                             </includes>
182                                         </resource>
183                                     </resources>
184                                     <outputDirectory>${project.build.directory}/site/images</outputDirectory>
185                                 </configuration>
186                             </execution>
187                         </executions>
188                     </plugin>
189                 </plugins>
190             </build>
191         </profile>
192     </profiles>
193 </project>