[OOM-CERT-SERVICE]Fix Apache log4j2 vulnerability
[oom/platform/cert-service.git] / certService / pom.xml
index da8f89f..13fed00 100644 (file)
        ============LICENSE_END=========================================================
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
     <parent>
-        <groupId>org.onap.aaf</groupId>
-        <artifactId>aaf-certservice-parent</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
+        <groupId>org.onap.oom.platform.cert-service</groupId>
+        <artifactId>oom-certservice</artifactId>
+        <version>2.5.0-SNAPSHOT</version>
     </parent>
-
-    <artifactId>cert-service</artifactId>
-    <version>0.0.1-SNAPSHOT</version>
-    <name>cert-service</name>
-    <description>Certification service</description>
+    <artifactId>oom-certservice-api</artifactId>
+    <version>2.5.0-SNAPSHOT</version>
+    <name>oom-certservice-api</name>
+    <description>OOM Certification Service Api</description>
     <packaging>jar</packaging>
 
-    <properties>
-        <java.version>11</java.version>
-        <assertj-core.version>3.11.1</assertj-core.version>
-        <mockito-core.version>3.2.4</mockito-core.version>
-        <spring-core.version>5.2.3.RELEASE</spring-core.version>
-        <spring-boot-starter.version>2.2.4.RELEASE</spring-boot-starter.version>
-        <maven-javadoc-plugin.version>3.0.1</maven-javadoc-plugin.version>
-        <maven-surefire-plugin.version>3.0.0-M1</maven-surefire-plugin.version>
-        <spring-boot-starter-actuator.version>2.2.4.RELEASE</spring-boot-starter-actuator.version>
-        <spring-boot-starter-log4j2.version>2.1.5.RELEASE</spring-boot-starter-log4j2.version>
-        <springdoc-openapi-ui.version>1.2.21</springdoc-openapi-ui.version>
-        <bouncycastle.version>1.60</bouncycastle.version>
-        <docker-maven-plugin.version>0.33.0</docker-maven-plugin.version>
-        <docker.tag>${project.version}</docker.tag>
-        <springdoc-openapi-maven-plugin.apiDocsUrl>http://localhost:8080/v3/api-docs
-        </springdoc-openapi-maven-plugin.apiDocsUrl>
-    </properties>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <!-- Import dependency management from Spring Boot -->
-                <groupId>org.springframework.boot</groupId>
-                <artifactId>spring-boot-dependencies</artifactId>
-                <version>${spring-boot-starter.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
     <dependencies>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
-            <version>${spring-boot-starter.version}</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-starter-logging</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-log4j2</artifactId>
-            <version>${spring-boot-starter-log4j2.version}</version>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <version>${log4j2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <version>${log4j2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <version>${log4j2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-jul</artifactId>
+            <version>${log4j2.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-test</artifactId>
-            <version>${spring-boot-starter.version}</version>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.junit.vintage</groupId>
-                    <artifactId>junit-vintage-engine</artifactId>
-                </exclusion>
-            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.mockito</groupId>
             <artifactId>mockito-core</artifactId>
-            <version>${mockito-core.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <version>${assertj-core.version}</version>
-            <scope>test</scope>
         </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-actuator</artifactId>
-            <version>${spring-boot-starter-actuator.version}</version>
         </dependency>
         <dependency>
             <groupId>org.springdoc</groupId>
             <artifactId>springdoc-openapi-ui</artifactId>
-            <version>${springdoc-openapi-ui.version}</version>
         </dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcpkix-jdk15on</artifactId>
-            <version>${bouncycastle.version}</version>
         </dependency>
         <dependency>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk15on</artifactId>
-            <version>${bouncycastle.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.code.gson</groupId>
+            <artifactId>gson</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-bootstrap</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.hibernate.validator</groupId>
+            <artifactId>hibernate-validator</artifactId>
         </dependency>
     </dependencies>
 
     <build>
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.springframework.boot</groupId>
-                    <artifactId>spring-boot-maven-plugin</artifactId>
-                    <version>${spring-boot-starter.version}</version>
-                </plugin>
-                <plugin>
-                    <artifactId>maven-javadoc-plugin</artifactId>
-                    <version>${maven-javadoc-plugin.version}</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-surefire-plugin</artifactId>
-                    <version>${maven-surefire-plugin.version}</version>
-                </plugin>
-            </plugins>
-        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>repackage</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>pre-integration-test</id>
-                        <goals>
-                            <goal>start</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>post-integration-test</id>
-                        <goals>
-                            <goal>stop</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
-                <configuration>
-                    <quiet>true</quiet>
-                    <verbose>false</verbose>
-                    <useStandardDocletOptions>false</useStandardDocletOptions>
-                    <javadocExecutable>${java.home}/bin/javadoc</javadocExecutable>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>aggregate</id>
-                        <phase>site</phase>
-                        <goals>
-                            <goal>aggregate</goal>
-                        </goals>
-                    </execution>
-                    <execution>
-                        <id>attach-javadoc</id>
-                        <goals>
-                            <goal>jar</goal>
-                        </goals>
-                    </execution>
-                </executions>
             </plugin>
             <plugin>
                 <groupId>org.springdoc</groupId>
                 <artifactId>springdoc-openapi-maven-plugin</artifactId>
-                <version>0.2</version>
-                <executions>
-                    <execution>
-                        <phase>integration-test</phase>
-                        <goals>
-                            <goal>generate</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <apiDocsUrl>${springdoc-openapi-maven-plugin.apiDocsUrl}</apiDocsUrl>
-                    <outputFileName>api-docs.json</outputFileName>
-                    <outputDir>${project.build.directory}</outputDir>
-                </configuration>
             </plugin>
         </plugins>
     </build>
 
     <profiles>
+        <profile>
+            <id>dev</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.springframework.boot</groupId>
+                    <artifactId>spring-boot-devtools</artifactId>
+                    <optional>true</optional>
+                </dependency>
+            </dependencies>
+        </profile>
         <profile>
             <id>docker-staging</id>
             <properties>
             <activation>
                 <activeByDefault>false</activeByDefault>
             </activation>
+            <properties>
+                <os.detected.name>linux</os.detected.name>
+                <os.detected.arch>x86_64</os.detected.arch>
+                <os.detected.classifier>${os.detected.name}-${os.detected.arch}</os.detected.classifier>
+            </properties>
             <build>
                 <plugins>
                     <plugin>
                         <version>${docker-maven-plugin.version}</version>
                         <executions>
                             <execution>
-                                <id>clean-images</id>
-                                <phase>pre-clean</phase>
-                                <goals>
-                                    <goal>remove</goal>
-                                </goals>
-                                <configuration>
-                                    <removeAll>true</removeAll>
-                                    <image>onap/cert-service</image>
-                                </configuration>
-                            </execution>
-                            <execution>
-                                <id>generate-images</id>
-                                <phase>install</phase>
+                                <id>docker-build-image</id>
+                                <phase>package</phase>
                                 <goals>
                                     <goal>build</goal>
                                 </goals>
                             </execution>
-<!--                            It has to be published on nexus firstly to uncomment integration tests-->
-<!--                            <execution>-->
-<!--                                <id>start</id>-->
-<!--                                <phase>pre-integration-test</phase>-->
-<!--                                <goals>-->
-<!--                                    <goal>start</goal>-->
-<!--                                </goals>-->
-<!--                            </execution>-->
-<!--                            <execution>-->
-<!--                                <id>stop</id>-->
-<!--                                <phase>post-integration-test</phase>-->
-<!--                                <goals>-->
-<!--                                    <goal>stop</goal>-->
-<!--                                </goals>-->
-<!--                            </execution>-->
                             <execution>
-                                <id>push-images</id>
+                                <id>docker-push-image</id>
                                 <phase>deploy</phase>
                                 <goals>
                                     <goal>push</goal>
                                 </goals>
-                                <configuration>
-                                    <image>onap/cert-service</image>
-                                </configuration>
                             </execution>
                         </executions>
                         <configuration>
-                            <apiVersion>1.23</apiVersion>
-                            <registry>nexus3.onap.org:10001</registry>
-                            <authConfig>
-                                <pull>
-                                    <username>docker</username>
-                                    <password>docker</password>
-                                </pull>
-                            </authConfig>
+                            <skipPush>${skipDockerPush}</skipPush>
+                            <verbose>true</verbose>
+                            <imagePullPolicy>IfNotPresent</imagePullPolicy>
                             <images>
                                 <image>
-                                    <name>onap/cert-service</name>
-                                    <alias>cert-service</alias>
+                                    <alias>${project.artifactId}</alias>
+                                    <name>${docker-image.namespace}/${docker-image.name}:${docker-image.tag.latest}
+                                    </name>
+                                    <registry>${docker-image.registry}</registry>
                                     <build>
-                                        <dockerFile>${project.basedir}/Dockerfile</dockerFile >
+                                        <dockerFileDir>${project.basedir}</dockerFileDir>
                                         <tags>
-                                            <tag>${docker.tag}</tag>
+                                            <tag>${project.version}-${maven.build.timestamp}Z</tag>
                                         </tags>
                                     </build>
-                                    <run>
-                                        <ports>
-                                            <port>8080:8080</port>
-                                        </ports>
-                                        <wait>
-                                            <!-- Check for this URL to return a 200 return code .... -->
-                                            <url>http://localhost:8080/actuator/health</url>
-                                            <time>120000</time>
-                                        </wait>
-                                    </run>
                                 </image>
                             </images>
                         </configuration>
     <distributionManagement>
         <repository>
             <id>ecomp-releases</id>
-            <name>AAF Release Repository</name>
+            <name>OOM Release Repository</name>
             <url>${nexusproxy}${releaseNexusPath}</url>
         </repository>
         <snapshotRepository>
             <id>ecomp-snapshots</id>
-            <name>AAF Snapshot Repository</name>
+            <name>OOM Snapshot Repository</name>
             <url>${nexusproxy}${snapshotNexusPath}</url>
         </snapshotRepository>
         <site>