Check license notes during build 73/58573/1
authorPiotr Jaszczyk <piotr.jaszczyk@nokia.com>
Wed, 13 Jun 2018 07:56:17 +0000 (09:56 +0200)
committerPiotr Jaszczyk <piotr.jaszczyk@nokia.com>
Thu, 2 Aug 2018 05:48:35 +0000 (07:48 +0200)
I wanted to use oparent as parent pom but unfortunately jacoco plugin is
configured differently there. Currently oparent provides support for
jacoco (static code analysis), checkstyle (licenses + code style) and
swagger api documentation.

In ves-hv:
* jacoco is preconfigured for kotlin (but currently not very usable as
it's not ready for kotlin-generated code ie. displayed coverage is
well under the actual coverage; there is an ongoing effort in jacoco
and kotlin communities to fix that).
* checkstyle - this task adds support for checking licenses using
oparent:checkstyle artifact. Static code analysis is already done
using Detekt.
* swagger - ves-hv is not exposing REST API so there is no need for
this.

Closes ONAP-364
Change-Id: If2727a97d826dcab473b2e1e80171d8124ae52d4
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Issue-ID: DCAEGEN2-601

hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/Router.kt
hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProvider.kt
hv-collector-core/src/main/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapter.kt
hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/ConsulConfigurationProviderTest.kt
hv-collector-core/src/test/kotlin/org/onap/dcae/collectors/veshv/impl/adapters/HttpAdapterTest.kt
hv-collector-dcae-app-simulator/src/test/kotlin/org/onap/dcae/collectors/veshv/simulators/dcaeapp/DummyTest.kt
pom.xml

index e66336d..f3f0a89 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.impl
 
 import org.onap.dcae.collectors.veshv.model.RoutedMessage
index 263e7d4..04e4927 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.impl.adapters
 
 import org.onap.dcae.collectors.veshv.boundary.ConfigurationProvider
index c09af01..236e3cb 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.impl.adapters
 
 import org.slf4j.LoggerFactory
index bf65c85..b2da430 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.impl.adapters
 
 import com.nhaarman.mockito_kotlin.mock
index 10e8b6b..6628845 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.impl.adapters
 
 import com.nhaarman.mockito_kotlin.mock
index 79b0e4b..0360fcc 100644 (file)
@@ -1,3 +1,22 @@
+/*
+ * ============LICENSE_START=======================================================
+ * dcaegen2-collectors-veshv
+ * ================================================================================
+ * Copyright (C) 2018 NOKIA
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
 package org.onap.dcae.collectors.veshv.simulators.dcaeapp
 
 import org.jetbrains.spek.api.Spek
diff --git a/pom.xml b/pom.xml
index d2c5886..af61407 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <description>VES HighVolume Collector</description>
     <packaging>pom</packaging>
 
-  <modules>
-    <module>hv-collector-analysis</module>
-    <module>hv-collector-client-simulator</module>
-    <module>hv-collector-core</module>
-    <module>hv-collector-coverage</module>
-    <module>hv-collector-ct</module>
-    <module>hv-collector-dcae-app-simulator</module>
-    <module>hv-collector-domain</module>
-    <module>hv-collector-main</module>
-    <module>hv-collector-utils</module>
-  </modules>
+    <modules>
+        <module>hv-collector-analysis</module>
+        <module>hv-collector-client-simulator</module>
+        <module>hv-collector-core</module>
+        <module>hv-collector-coverage</module>
+        <module>hv-collector-ct</module>
+        <module>hv-collector-dcae-app-simulator</module>
+        <module>hv-collector-domain</module>
+        <module>hv-collector-main</module>
+        <module>hv-collector-utils</module>
+    </modules>
 
     <properties>
         <kotlin.version>1.2.41</kotlin.version>
                             </dependency>
                         </dependencies>
                     </plugin>
+
+                    <plugin>
+                        <artifactId>maven-checkstyle-plugin</artifactId>
+                        <version>3.0.0</version>
+                        <dependencies>
+                            <dependency>
+                                <groupId>org.onap.oparent</groupId>
+                                <artifactId>checkstyle</artifactId>
+                                <version>1.1.1</version>
+                            </dependency>
+                        </dependencies>
+                        <executions>
+                            <execution>
+                                <id>onap-license</id>
+                                <goals>
+                                    <goal>check</goal>
+                                </goals>
+                                <phase>process-sources</phase>
+                                <configuration>
+                                    <configLocation>onap-checkstyle/check-license.xml</configLocation>
+                                    <includeResources>false</includeResources>
+                                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
+                                    <includeTestResources>false</includeTestResources>
+                                    <includes>**\/*.kt</includes>
+                                    <consoleOutput>true</consoleOutput>
+                                    <!--<failOnViolation>false</failOnViolation>-->
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
                 </plugins>
             </build>
         </profile>
     </reporting>
 
     <pluginRepositories>
+        <pluginRepository>
+            <id>40_openecomp-release</id>
+            <name>40_openecomp-release</name>
+            <url>https://nexus.onap.org/content/repositories/releases/</url>
+            <releases>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+
         <pluginRepository>
             <id>arturbosch-code-analysis</id>
             <name>arturbosch-code-analysis (for detekt)</name>
         </pluginRepository>
     </pluginRepositories>
 
+    <repositories>
+        <repository>
+            <id>40_openecomp-release</id>
+            <name>40_openecomp-release</name>
+            <url>https://nexus.onap.org/content/repositories/releases/</url>
+            <releases>
+                <enabled>true</enabled>
+                <updatePolicy>daily</updatePolicy>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+    </repositories>
+
     <dependencyManagement>
         <dependencies>
             <dependency>