diff options
32 files changed, 1198 insertions, 804 deletions
diff --git a/asdctool/sdc-cassandra-init/Dockerfile b/asdctool/sdc-cassandra-init/Dockerfile index 1beec7e2f6..e35f841984 100644 --- a/asdctool/sdc-cassandra-init/Dockerfile +++ b/asdctool/sdc-cassandra-init/Dockerfile @@ -1,4 +1,33 @@ -FROM onap/base_sdc-cqlsh:1.7.0 +FROM onap/policy-jdk-debian:2.0.1 + +#RUN addgroup --gid 1000 sdc +RUN addgroup sdc +#RUN adduser --gecos "sdc sdc,1,1,1" -u 1000 --disabled-password --ingroup sdc --shell /bin/sh sdc +RUN adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc +USER sdc +RUN mkdir ~/.cassandra/ && \ + echo '[cql]' > ~/.cassandra/cqlshrc && \ + echo 'version=3.4.4' >> ~/.cassandra/cqlshrc +USER root + +RUN apt-get update && apt-get install -y python-pip && \ + pip install cqlsh && \ + mkdir ~/.cassandra/ && \ + echo '[cql]' > ~/.cassandra/cqlshrc && \ + echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \ + set -ex && \ + pip install cqlsh && \ + apt-get install -y \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install chef:13.8.5 berkshelf:6.3.1 io-console:0.4.6 etc webrick --no-document && \ + apt-get update -y && \ + apt-get install -y binutils && apt-get clean && gem cleanup +USER sdc COPY --chown=sdc:sdc chef-solo /home/sdc/chef-solo/ diff --git a/asdctool/sdc-cassandra-init/startup.sh b/asdctool/sdc-cassandra-init/startup.sh index 3e474f3c89..2a20eaa67d 100644 --- a/asdctool/sdc-cassandra-init/startup.sh +++ b/asdctool/sdc-cassandra-init/startup.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh cd /home/sdc/chef-solo chef-solo -c solo.rb -E ${ENVNAME} rc=$? -if [[ $rc != 0 ]]; then exit $rc; fi +if [ $rc -ne 0 ]; then exit $rc; fi diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml index eef3d7c7dc..89be979b65 100644 --- a/catalog-be/pom.xml +++ b/catalog-be/pom.xml @@ -749,10 +749,10 @@ <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <forkCount>1</forkCount> - </configuration> + <artifactId>maven-surefire-plugin</artifactId> + <configuration> + <forkCount>1</forkCount> + </configuration> </plugin> <plugin> <!-- Download Swagger UI webjar. --> @@ -870,6 +870,18 @@ <groupId>com.jcabi</groupId> <artifactId>jcabi-maven-plugin</artifactId> <version>${jcabi.maven.plugin.version}</version> + <dependencies> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjtools</artifactId> + <version>1.9.2</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.9.2</version> + </dependency> + </dependencies> <executions> <execution> <goals> diff --git a/catalog-be/sdc-backend/Dockerfile b/catalog-be/sdc-backend/Dockerfile index 2a60ce77ad..bc4f27a79a 100644 --- a/catalog-be/sdc-backend/Dockerfile +++ b/catalog-be/sdc-backend/Dockerfile @@ -1,13 +1,55 @@ -FROM onap/base_sdc-jetty:1.7.0 - +FROM jetty:9.4.31-jre11-slim + +USER root + +# Install Chef +RUN set -ex && \ + apt-get update -y && \ + apt-get install -y \ + jq \ + curl \ + curl \ + vim \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install \ + chef:13.8.5 \ + berkshelf:6.3.1 \ + io-console:0.4.6 \ + etc webrick \ + --no-document && \ + gem cleanup && \ + apt-get update -y && \ + apt-get install -y binutils jq && \ + apt-get clean + +# Replace Jetty user ID +ENV USER_JETTY="jetty" +ENV GROUP_JETTY="jetty" +ENV UID_JETTY="352070" +ENV GID_JETTY="35953" + +# Remove user: +RUN deluser ${USER_JETTY} +#RUN delgroup ${GROUP_JETTY} +RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd +RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group +RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow +RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} +RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty + +USER jetty + COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/ COPY --chown=jetty:jetty chef-repo/cookbooks/. ${JETTY_BASE}/chef-solo/cookbooks/ - ADD --chown=jetty:jetty catalog-be-*.war ${JETTY_BASE}/webappwar/ ADD --chown=jetty:jetty context.xml ${JETTY_BASE}/webapps/ - -COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/ +COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/ RUN chmod 770 ${JETTY_BASE}/startup.sh -ENTRYPOINT ${JETTY_BASE}/startup.sh +ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
\ No newline at end of file diff --git a/catalog-be/sdc-backend/startup.sh b/catalog-be/sdc-backend/startup.sh index 4f5ef8ca2e..0dc54a8849 100644 --- a/catalog-be/sdc-backend/startup.sh +++ b/catalog-be/sdc-backend/startup.sh @@ -15,18 +15,16 @@ cd /var/lib/jetty/chef-solo chef-solo -c solo.rb -E ${ENVNAME} status=$? -if [ $status != 0 ]; then +if [ $status -ne 0 ]; then echo "[ERROR] Problem detected while running chef. Aborting !" exit 1 fi # Execute Jetty cd /var/lib/jetty -/docker-entrypoint.sh & -exec "$@"; +java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar" -while true; do sleep 2; done diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/impl/aaf/RoleAuthorizationHandlerTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/aaf/RoleAuthorizationHandlerTest.java index c488a9a6ca..30a123dcad 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/impl/aaf/RoleAuthorizationHandlerTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/impl/aaf/RoleAuthorizationHandlerTest.java @@ -22,8 +22,9 @@ package org.openecomp.sdc.be.impl.aaf; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; +import org.hibernate.validator.internal.util.annotationfactory.AnnotationDescriptor; +import org.hibernate.validator.internal.util.annotationfactory.AnnotationFactory; import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; @@ -36,15 +37,12 @@ import org.openecomp.sdc.be.components.impl.exceptions.ComponentException; import org.openecomp.sdc.be.config.ConfigurationManager; import org.openecomp.sdc.be.dao.api.ActionStatus; import org.openecomp.sdc.be.servlets.BeGenericServlet; -import org.openecomp.sdc.common.api.ConfigurationSource; import org.openecomp.sdc.common.api.FilterDecisionEnum; import org.openecomp.sdc.common.impl.ExternalConfiguration; import org.openecomp.sdc.common.impl.FSConfigurationSource; import org.openecomp.sdc.common.util.ThreadLocalsHolder; -import sun.reflect.annotation.AnnotationParser; import javax.servlet.http.HttpServletRequest; -import java.util.Collections; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.catchThrowable; @@ -78,8 +76,9 @@ public class RoleAuthorizationHandlerTest { @Test public void testAuthorizeRoleOnePermittedRole() { String[] permsAllowed = {AafPermission.PermNames.WRITE_VALUE}; - PermissionAllowed rolesAllowed = - (PermissionAllowed) AnnotationParser.annotationForMap(PermissionAllowed.class, Collections.singletonMap("value", permsAllowed)); + AnnotationDescriptor<PermissionAllowed> permissionDescriptor = new AnnotationDescriptor<PermissionAllowed>(PermissionAllowed.class); + permissionDescriptor.setValue("value", permsAllowed); + PermissionAllowed rolesAllowed = (PermissionAllowed) AnnotationFactory.create(permissionDescriptor); when(httpServletRequest.isUserInRole(AafPermission.getEnumByString(permsAllowed[0]).getFullPermission())) .thenReturn(true); roleAuthorizationHandler.authorizeRole(joinPoint, rolesAllowed); @@ -88,8 +87,9 @@ public class RoleAuthorizationHandlerTest { @Test public void testAuthorizeRoleTwoPermittedRole() { String[] permsAllowed = {AafPermission.PermNames.WRITE_VALUE, AafPermission.PermNames.READ_VALUE}; - PermissionAllowed rolesAllowed = - (PermissionAllowed) AnnotationParser.annotationForMap(PermissionAllowed.class, Collections.singletonMap("value", permsAllowed)); + AnnotationDescriptor<PermissionAllowed> permissionDescriptor = new AnnotationDescriptor<PermissionAllowed>(PermissionAllowed.class); + permissionDescriptor.setValue("value", permsAllowed); + PermissionAllowed rolesAllowed = (PermissionAllowed)AnnotationFactory.create(permissionDescriptor); when(httpServletRequest.isUserInRole(AafPermission.getEnumByString(permsAllowed[0]).getFullPermission())) .thenReturn(true); roleAuthorizationHandler.authorizeRole(joinPoint, rolesAllowed); @@ -98,8 +98,9 @@ public class RoleAuthorizationHandlerTest { @Test public void testAuthorizeRoleNonPermittedRole() { String[] permsAllowed = {AafPermission.PermNames.WRITE_VALUE, AafPermission.PermNames.READ_VALUE}; - PermissionAllowed rolesAllowed = - (PermissionAllowed) AnnotationParser.annotationForMap(PermissionAllowed.class, Collections.singletonMap("value", permsAllowed)); + AnnotationDescriptor<PermissionAllowed> permissionDescriptor = new AnnotationDescriptor<PermissionAllowed>(PermissionAllowed.class); + permissionDescriptor.setValue("value", permsAllowed); + PermissionAllowed rolesAllowed = (PermissionAllowed)AnnotationFactory.create(permissionDescriptor); when(httpServletRequest.isUserInRole(AafPermission.getEnumByString(permsAllowed[0]).getFullPermission())) .thenReturn(false); @@ -110,8 +111,9 @@ public class RoleAuthorizationHandlerTest { @Test public void testAuthorizeRoleEmptyRole() { String[] permsAllowed = {}; - PermissionAllowed rolesAllowed = - (PermissionAllowed) AnnotationParser.annotationForMap(PermissionAllowed.class, Collections.singletonMap("value", permsAllowed)); + AnnotationDescriptor<PermissionAllowed> permissionDescriptor = new AnnotationDescriptor<PermissionAllowed>(PermissionAllowed.class); + permissionDescriptor.setValue("value", permsAllowed); + PermissionAllowed rolesAllowed = (PermissionAllowed)AnnotationFactory.create(permissionDescriptor); ComponentException thrown = (ComponentException) catchThrowable(()->roleAuthorizationHandler.authorizeRole(joinPoint, rolesAllowed)); assertThat(thrown.getActionStatus()).isEqualTo(ActionStatus.AUTH_FAILED); diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml index d1762ba985..be4b0651ff 100644 --- a/catalog-fe/pom.xml +++ b/catalog-fe/pom.xml @@ -232,30 +232,37 @@ <scope>compile</scope> </dependency> - <!-- Inserted for ECOMP Portal Integration --> - <dependency> - <groupId>org.onap.portal.sdk</groupId> - <artifactId>epsdk-fw</artifactId> - <version>${ecomp.version}</version> - <scope>compile</scope> - <exclusions> - <exclusion> - <groupId>com.att.nsa</groupId> - <artifactId>cambriaClient</artifactId> - </exclusion> - <exclusion> - <artifactId>slf4j-log4j12</artifactId> - <groupId>org.slf4j</groupId> - </exclusion> - </exclusions> - </dependency> - <!-- System metrics --> - <dependency> - <groupId>org.fusesource</groupId> - <artifactId>sigar</artifactId> - <version>${sigar.version}</version> - <scope>compile</scope> - </dependency> + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>${jaxb-api.version}</version> + <scope>compile</scope> + </dependency> + + <!-- Inserted for ECOMP Portal Integration --> + <dependency> + <groupId>org.onap.portal.sdk</groupId> + <artifactId>epsdk-fw</artifactId> + <version>${ecomp.version}</version> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>com.att.nsa</groupId> + <artifactId>cambriaClient</artifactId> + </exclusion> + <exclusion> + <artifactId>slf4j-log4j12</artifactId> + <groupId>org.slf4j</groupId> + </exclusion> + </exclusions> + </dependency> + <!-- System metrics --> + <dependency> + <groupId>org.fusesource</groupId> + <artifactId>sigar</artifactId> + <version>${sigar.version}</version> + <scope>compile</scope> + </dependency> <!-- TEST --> <dependency> @@ -337,6 +344,18 @@ <groupId>com.jcabi</groupId> <artifactId>jcabi-maven-plugin</artifactId> <version>${jcabi.maven.plugin.version}</version> + <dependencies> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjtools</artifactId> + <version>1.9.2</version> + </dependency> + <dependency> + <groupId>org.aspectj</groupId> + <artifactId>aspectjweaver</artifactId> + <version>1.9.2</version> + </dependency> + </dependencies> <executions> <execution> <goals> diff --git a/catalog-fe/sdc-frontend/Dockerfile b/catalog-fe/sdc-frontend/Dockerfile index 9d4029c32a..3a2359c4ab 100644 --- a/catalog-fe/sdc-frontend/Dockerfile +++ b/catalog-fe/sdc-frontend/Dockerfile @@ -1,4 +1,48 @@ -FROM onap/base_sdc-jetty:1.7.0 +FROM jetty:9.4.31-jre11-slim + +USER root + +# Install Chef +RUN set -ex && \ + apt-get update -y && \ + apt-get install -y \ + jq \ + curl \ + curl \ + vim \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install \ + chef:13.8.5 \ + berkshelf:6.3.1 \ + io-console:0.4.6 \ + etc webrick \ + --no-document && \ + gem cleanup && \ + apt-get update -y && \ + apt-get install -y binutils jq && \ + apt-get clean + +# Replace Jetty user ID +ENV USER_JETTY="jetty" +ENV GROUP_JETTY="jetty" +ENV UID_JETTY="352070" +ENV GID_JETTY="35953" + +# Remove user: +RUN deluser ${USER_JETTY} +#RUN delgroup ${GROUP_JETTY} +RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd +RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group +RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow +RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} +RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty + +USER jetty RUN mkdir -p ${JETTY_BASE}/config/catalog-fe @@ -14,4 +58,4 @@ COPY --chown=jetty:jetty startup.sh ${JETTY_BASE} RUN chmod 770 ${JETTY_BASE}/startup.sh -ENTRYPOINT ${JETTY_BASE}/startup.sh +ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"]
\ No newline at end of file diff --git a/catalog-fe/sdc-frontend/startup.sh b/catalog-fe/sdc-frontend/startup.sh index 9eb742fd2b..b2443f1aee 100644 --- a/catalog-fe/sdc-frontend/startup.sh +++ b/catalog-fe/sdc-frontend/startup.sh @@ -14,6 +14,5 @@ cd /var/lib/jetty/chef-solo chef-solo -c solo.rb -E ${ENVNAME} cd /var/lib/jetty -/docker-entrypoint.sh & -while true; do sleep 2; done +java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar" diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java index fccb41bc99..35b775a227 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/servlets/PortalServletTest.java @@ -28,7 +28,6 @@ import org.junit.BeforeClass; import org.junit.Test; import org.mockito.Mockito; import org.mockito.stubbing.Answer; -import org.onap.sdc.security.CipherUtil; import org.openecomp.sdc.common.api.Constants; import org.openecomp.sdc.fe.config.Configuration; import org.openecomp.sdc.fe.config.ConfigurationManager; @@ -64,7 +63,6 @@ public class PortalServletTest extends JerseyTest { private final static Configuration configuration = Mockito.mock(Configuration.class); private final static HttpServletResponse response = Mockito.spy(HttpServletResponse.class); private final static RequestDispatcher rd = Mockito.spy(RequestDispatcher.class); - private static CipherUtil cipherUtil = Mockito.mock(CipherUtil.class); final static Configuration.CookieConfig cookieConfiguration = Mockito.mock(Configuration.CookieConfig.class); @SuppressWarnings("serial") diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java index 71abc54cb7..034f6fab92 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/tosca/ToscaType.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; import java.text.DateFormat; import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.List; import java.util.Locale; import java.util.Map; @@ -90,7 +91,7 @@ public enum ToscaType { return true; case TIMESTAMP: try { - DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US).parse(value); + new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a", Locale.US).parse(value); return true; } catch (ParseException e) { return false; @@ -168,7 +169,7 @@ public enum ToscaType { return Long.valueOf(value); case TIMESTAMP: try { - return DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.US).parse(value); + return new SimpleDateFormat("MMM dd, yyyy hh:mm:ss a", Locale.US).parse(value); } catch (ParseException e) { throw new IllegalArgumentException("Value must be a valid timestamp", e); } diff --git a/common-app-api/pom.xml b/common-app-api/pom.xml index 39be0353af..ee5f412249 100644 --- a/common-app-api/pom.xml +++ b/common-app-api/pom.xml @@ -268,6 +268,31 @@ </dependencies> <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <excludes> + <exclude>**/*.zip</exclude> + </excludes> + <filtering>true</filtering> + </testResource> + <testResource> + <directory>src/test/resources/zip</directory> + <includes> + <include>**.zip</include> + </includes> + <filtering>false</filtering> + <targetPath>zip</targetPath> + </testResource> + <testResource> + <directory>src/test/resources/zip-slip</directory> + <includes> + <include>**.zip</include> + </includes> + <filtering>false</filtering> + <targetPath>zip-slip</targetPath> + </testResource> + </testResources> <plugins> <plugin> <groupId>com.github.sylvainlaurent.maven</groupId> diff --git a/common/onap-tosca-datatype/pom.xml b/common/onap-tosca-datatype/pom.xml index 9a621e02f1..e6c6bc5b28 100644 --- a/common/onap-tosca-datatype/pom.xml +++ b/common/onap-tosca-datatype/pom.xml @@ -33,7 +33,7 @@ <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.17</version> + <version>${snakeyaml.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> @@ -90,4 +90,12 @@ <scope>test</scope> </dependency> </dependencies> + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + </build> </project> diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java index 82f1581fa9..ae1ca01673 100644 --- a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java +++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/NodeTemplate.java @@ -20,16 +20,23 @@ package org.onap.sdc.tosca.datatypes.model; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; + import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; + +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.onap.sdc.tosca.error.ToscaRuntimeException; +import org.onap.sdc.tosca.services.ToscaExtensionYamlUtil; import org.onap.sdc.tosca.services.YamlUtil; +import org.yaml.snakeyaml.constructor.ConstructorException; @Getter @@ -37,6 +44,7 @@ import org.onap.sdc.tosca.services.YamlUtil; @EqualsAndHashCode public class NodeTemplate implements Template, Cloneable { + private static final String INVALID_TOSCA_REQUIREMENT_SECTION = "Invalid TOSCA requirement section"; private String type; private String description; private Map<String, String> metadata; @@ -50,6 +58,62 @@ public class NodeTemplate implements Template, Cloneable { private NodeFilter node_filter; private String copy; + public void setRequirements(List requirementAssignmentObj) { + this.requirements = convertToscaRequirementAssignment(requirementAssignmentObj); + } + + public static List<Map<String, RequirementAssignment>> convertToscaRequirementAssignment(List<?> requirementAssignmentObj) { + + List<Map<String, RequirementAssignment>> convertedRequirements = new ArrayList<>(); + if (CollectionUtils.isEmpty(requirementAssignmentObj)) { + return null; + } + for (Object requirementEntry : requirementAssignmentObj) { + convertToscaRequirementAssignmentEntry(convertedRequirements, requirementEntry); + } + return convertedRequirements; + } + + private static void convertToscaRequirementAssignmentEntry(List<Map<String, RequirementAssignment>> convertedRequirements, Object requirementEntry) { + if (requirementEntry instanceof Map) { + try { + Set<Map.Entry<String, RequirementAssignment>> requirementEntries = ((Map)requirementEntry).entrySet(); + for (Map.Entry<String, RequirementAssignment> toscaRequirements : requirementEntries) { + String key = toscaRequirements.getKey(); + Object requirementValue = toscaRequirements.getValue(); + if (requirementValue instanceof Map) { + RequirementAssignment requirementObject; + try { + YamlUtil yamlUtil = new YamlUtil(); + requirementObject = yamlUtil + .yamlToObject(yamlUtil.objectToYaml(requirementValue), RequirementAssignment.class); + } catch (ConstructorException ex) { + // The requirement might contains extended attribute, so try to parse it into RequirementAssignmentExt as well + ToscaExtensionYamlUtil toscaExtensionYamlUtil = new ToscaExtensionYamlUtil(); + requirementObject = toscaExtensionYamlUtil + .yamlToObject(toscaExtensionYamlUtil.objectToYaml(requirementValue), RequirementAssignment.class); + } + Map<String, RequirementAssignment> convertedToscaRequirement = new HashMap<>(); + convertedToscaRequirement.put(key, requirementObject); + convertedRequirements.add(convertedToscaRequirement); + } else if (requirementValue instanceof RequirementAssignment) { + Map<String, RequirementAssignment> convertedToscaRequirement = new HashMap<>(); + convertedToscaRequirement.put(key, (RequirementAssignment)requirementValue); + convertedRequirements.add(convertedToscaRequirement); + } + } + } catch (Exception ex) { + throw new ToscaRuntimeException(INVALID_TOSCA_REQUIREMENT_SECTION, ex); + } + } + } + + public void addRequirements(Map<String, RequirementAssignment> newRequirement) { + if (CollectionUtils.isEmpty(this.requirements)) { + this.requirements = new ArrayList<Map<String, RequirementAssignment>>(); + } + this.requirements.add(newRequirement); + } public Map<String, InterfaceDefinitionTemplate> getNormalizeInterfaces() { if (MapUtils.isEmpty(interfaces)) { diff --git a/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/NodeTemplateTest.java b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/NodeTemplateTest.java index b9f2b838c2..e265d4bd8b 100644 --- a/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/NodeTemplateTest.java +++ b/common/onap-tosca-datatype/src/test/java/org/onap/sdc/tosca/datatypes/model/NodeTemplateTest.java @@ -75,17 +75,17 @@ public class NodeTemplateTest { @Test public void shouldHaveValidGettersAndSetters() { - assertThat(NodeTemplate.class, hasValidGettersAndSettersExcluding("normalizeInterfaces")); + assertThat(NodeTemplate.class, hasValidGettersAndSettersExcluding("requirements", "normalizeInterfaces")); } @Test public void shouldHaveValidEquals() { - assertThat(NodeTemplate.class, hasValidBeanEqualsExcluding("normalizeInterfaces")); + assertThat(NodeTemplate.class, hasValidBeanEqualsExcluding("requirements", "normalizeInterfaces")); } @Test public void shouldHaveValidHashCode() { - assertThat(NodeTemplate.class, hasValidBeanHashCodeExcluding("normalizeInterfaces")); + assertThat(NodeTemplate.class, hasValidBeanHashCodeExcluding("requirements", "normalizeInterfaces")); } private InterfaceDefinitionTemplate createInterfaceDefinitionTemplate() { diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index e292195c38..ce38c9ee9c 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -485,9 +485,7 @@ limitations under the License. <SDC_PASSWORD>${it.sdc.password}</SDC_PASSWORD> <ENVNAME>${it.env.name}</ENVNAME> <SDC_CERT_DIR>onap/cert</SDC_CERT_DIR> - <JAVA_OPTIONS>-Xdebug - -agentlib:jdwp=transport=dt_socket,address=4001,server=y,suspend=n -Xmx1g -Xms1g - </JAVA_OPTIONS> + <JAVA_OPTIONS>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:4001 -Xmx1g -Xms1g</JAVA_OPTIONS> </env> <hostname>sdc-onboard-BE</hostname> <volumes> @@ -498,7 +496,7 @@ limitations under the License. </bind> </volumes> <wait> - <time>30000</time> + <time>300000</time> <tcp> <host>sdc-onboard-BE</host> <mode>direct</mode> @@ -531,10 +529,8 @@ limitations under the License. <env> <cassandra_ssl_enabled>${it.cassandra.ssl.enabled}</cassandra_ssl_enabled> <ENVNAME>${it.env.name}</ENVNAME> - <JAVA_OPTIONS>-Xdebug - -agentlib:jdwp=transport=dt_socket,address=4000,server=y,suspend=n -Xmx1536m - -Xms1536m - </JAVA_OPTIONS> + <JAVA_OPTIONS>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:4000 + -Xmx1536m -Xms1536m</JAVA_OPTIONS> </env> <hostname>sdc-BE</hostname> <volumes> @@ -601,10 +597,8 @@ limitations under the License. <run> <env> <ENVNAME>${it.env.name}</ENVNAME> - <JAVA_OPTIONS>-Xdebug - -agentlib:jdwp=transport=dt_socket,address=6000,server=y,suspend=n -Xmx256m - -Xms256m - </JAVA_OPTIONS> + <JAVA_OPTIONS>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:6000 + -Xmx256m -Xms256m</JAVA_OPTIONS> </env> <hostname>sdc-FE</hostname> <volumes> diff --git a/onboarding/pom.xml b/onboarding/pom.xml index 034c642de3..55823b1163 100644 --- a/onboarding/pom.xml +++ b/onboarding/pom.xml @@ -38,13 +38,10 @@ <properties> <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile> - <maven.compiler.source>1.8</maven.compiler.source> - <maven.compiler.targer>1.8</maven.compiler.targer> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!-- Maven plugin versions --> <mvn.assembly.version>2.1</mvn.assembly.version> - <mvn.compiler.version>3.7.0</mvn.compiler.version> <mvn.clean.version>2.5</mvn.clean.version> <mvn.resource.version>3.1.0</mvn.resource.version> <mvn.deploy.version>2.4</mvn.deploy.version> diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile index 78a8f64a93..9c6275d87a 100644 --- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/Dockerfile @@ -1,15 +1,54 @@ -FROM onap/base_sdc-jetty:1.7.0 +FROM jetty:9.4.31-jre11-slim -COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/ +USER root -COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/ +# Install Chef +RUN set -ex && \ + apt-get update -y && \ + apt-get install -y \ + jq \ + curl \ + vim \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install \ + chef:13.8.5 \ + berkshelf:6.3.1 \ + io-console:0.4.6 \ + etc webrick \ + --no-document && \ + gem cleanup && \ + apt-get update -y && \ + apt-get install -y binutils jq && \ + apt-get clean -ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/ +# Replace Jetty user ID +ENV USER_JETTY="jetty" +ENV GROUP_JETTY="jetty" +ENV UID_JETTY="352070" +ENV GID_JETTY="35953" -ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/ +# Remove user: +RUN deluser ${USER_JETTY} +#RUN delgroup ${GROUP_JETTY} +RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd +RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group +RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow +RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} +RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty + +USER jetty -COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/ +COPY --chown=jetty:jetty chef-solo ${JETTY_BASE}/chef-solo/ +COPY --chown=jetty:jetty chef-repo/cookbooks ${JETTY_BASE}/chef-solo/cookbooks/ +ADD --chown=jetty:jetty onboarding-be-*.war ${JETTY_BASE}/webapps/ +ADD --chown=jetty:jetty api-docs.war ${JETTY_BASE}/webapps/ +COPY --chown=jetty:jetty startup.sh ${JETTY_BASE}/ RUN chmod 770 ${JETTY_BASE}/startup.sh -ENTRYPOINT ${JETTY_BASE}/startup.sh +ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"] diff --git a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh index df8cefbd85..cf1b6227ad 100644 --- a/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh +++ b/openecomp-be/dist/sdc-onboard-backend-docker/artifacts/startup.sh @@ -1,10 +1,9 @@ #!/bin/sh - cd /var/lib/jetty/chef-solo chef-solo -c solo.rb -E ${ENVNAME} rc=$? -if [[ $rc != 0 ]]; then +if [ $rc -ne 0 ]; then echo "Chef exaction failed." exit $rc; fi @@ -19,6 +18,4 @@ JAVA_OPTIONS=" ${JAVA_OPTIONS} \ cd /var/lib/jetty -/docker-entrypoint.sh & - -while true; do sleep 2; done +java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar" diff --git a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile index 788ca48ecc..226654ddc3 100644 --- a/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile +++ b/openecomp-be/dist/sdc-onboard-db-init-docker/artifacts/Dockerfile @@ -1,4 +1,34 @@ -FROM onap/base_sdc-cqlsh:1.7.0 +FROM onap/policy-jdk-debian:2.0.1 + +#RUN addgroup --gid 1000 sdc +RUN addgroup sdc +#RUN adduser --gecos "sdc sdc,1,1,1" -u 1000 --disabled-password --ingroup sdc --shell /bin/sh sdc +RUN adduser --gecos "sdc sdc,1,1,1" --disabled-password --ingroup sdc --shell /bin/sh sdc +USER sdc +RUN mkdir ~/.cassandra/ && \ + echo '[cql]' > ~/.cassandra/cqlshrc && \ + echo 'version=3.4.4' >> ~/.cassandra/cqlshrc +USER root + +RUN apt-get update && apt-get install -y python-pip && \ + pip install cqlsh && \ + mkdir ~/.cassandra/ && \ + echo '[cql]' > ~/.cassandra/cqlshrc && \ + echo 'version=3.4.4' >> ~/.cassandra/cqlshrc && \ + set -ex && \ + pip install cqlsh && \ + apt-get install -y \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install chef:13.8.5 berkshelf:6.3.1 io-console:0.4.6 etc webrick --no-document && \ + apt-get update -y && \ + apt-get install -y binutils && apt-get clean && gem cleanup + +USER sdc COPY --chown=sdc:sdc init_keyspaces.cql /home/sdc/ diff --git a/openecomp-be/lib/openecomp-heat-lib/pom.xml b/openecomp-be/lib/openecomp-heat-lib/pom.xml index f20b24aa95..eee0b85e40 100644 --- a/openecomp-be/lib/openecomp-heat-lib/pom.xml +++ b/openecomp-be/lib/openecomp-heat-lib/pom.xml @@ -72,6 +72,12 @@ <version>${project.version}</version> </dependency> </dependencies> - - + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> + </build> </project> diff --git a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml index cf0150a58e..950f5dc923 100644 --- a/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-logging-lib/openecomp-sdc-logging-api/pom.xml @@ -31,6 +31,11 @@ <artifactId>lombok</artifactId> <scope>compile</scope> </dependency> + <dependency> + <groupId>javax.xml.bind</groupId> + <artifactId>jaxb-api</artifactId> + <version>${jaxb-api.version}</version> + </dependency> </dependencies> </project> diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml index d635fb0a08..83ad8738d5 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/pom.xml @@ -81,6 +81,12 @@ </dependencies> <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <filtering>true</filtering> + </testResource> + </testResources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml index a63fc9bfdd..eeca992bc8 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml @@ -58,5 +58,23 @@ </parent> <artifactId>openecomp-tosca-converter-core</artifactId> - + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <excludes> + <exclude>**/*.csar</exclude> + </excludes> + <filtering>true</filtering> + </testResource> + <testResource> + <directory>src/test/resources/csar</directory> + <includes> + <include>**.csar</include> + </includes> + <filtering>false</filtering> + <targetPath>csar</targetPath> + </testResource> + </testResources> + </build> </project>
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java index f130f262a7..a9ee1a7518 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/test/java/org/openecomp/core/impl/ToscaSolConverterVnfTest.java @@ -135,7 +135,7 @@ public class ToscaSolConverterVnfTest { } private byte[] getFileResource(final String filePath) { - try (final InputStream inputStream = ClassLoader.class.getResourceAsStream(filePath)) { + try (final InputStream inputStream = this.getClass().getResourceAsStream(filePath)) { return IOUtils.toByteArray(inputStream); } catch (final IOException ex) { fail(String.format("Could not load file: %s", filePath)); diff --git a/openecomp-be/lib/openecomp-tosca-lib/pom.xml b/openecomp-be/lib/openecomp-tosca-lib/pom.xml index 6867d17cde..fd1728e905 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/pom.xml +++ b/openecomp-be/lib/openecomp-tosca-lib/pom.xml @@ -109,6 +109,24 @@ <properties> <useSystemClassLoader>false</useSystemClassLoader> </properties> - + <build> + <testResources> + <testResource> + <directory>src/test/resources</directory> + <excludes> + <exclude>**/*.csar</exclude> + </excludes> + <filtering>true</filtering> + </testResource> + <testResource> + <directory>src/test/resources/mock/analyzerService</directory> + <includes> + <include>**.csar</include> + </includes> + <filtering>false</filtering> + <targetPath>mock/analyzerService</targetPath> + </testResource> + </testResources> + </build> </project> diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index 70cae71f17..f7188379dc 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -373,12 +373,9 @@ public class DataModelUtil { throw new CoreException(new InvalidRequirementAssignmentErrorBuilder(requirementId).build()); } - if (nodeTemplate.getRequirements() == null) { - nodeTemplate.setRequirements(new ArrayList<>()); - } Map<String, RequirementAssignment> requirement = new HashMap<>(); requirement.put(requirementId, requirementAssignment); - nodeTemplate.getRequirements().add(requirement); + nodeTemplate.addRequirements(requirement); } /** diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java index 4ad4d2b53e..5a19eacf3e 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/datatypes/ToscaModelTest.java @@ -268,8 +268,7 @@ public class ToscaModelTest { Map<String, RequirementAssignment> nodeTemplateRequirement2 = new HashMap<>(); nodeTemplateRequirement1.put(REQ1, reqAssignment1); nodeTemplateRequirement2.put(REQ2, reqAssignment2); - nodeTemplate.setRequirements(new ArrayList<>()); - nodeTemplate.getRequirements().add(nodeTemplateRequirement1); + nodeTemplate.addRequirements(nodeTemplateRequirement1); nodeTemplate.getRequirements().add(nodeTemplateRequirement2); CapabilityAssignment capAss = new CapabilityAssignment(); diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java index fe4a37f39b..8b732df95c 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/services/DataModelUtilTest.java @@ -681,7 +681,7 @@ public class DataModelUtilTest { requirementAssignment1.setRelationship("relationshipId"); DataModelUtil.removeRequirementAssignment(nodeTemplate, REQUIREMENT_KEY, requirementAssignment); - assertTrue(requirementList.isEmpty()); + assertTrue(nodeTemplate.getRequirements().isEmpty()); } @Test @@ -20,9 +20,9 @@ Modifications copyright (c) 2018-2019 Nokia ================================================================================ --> <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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> <groupId>org.openecomp.sdc</groupId> <artifactId>sdc-main</artifactId> @@ -30,695 +30,699 @@ Modifications copyright (c) 2018-2019 Nokia <packaging>pom</packaging> <name>sdc</name> - <parent> - <groupId>org.onap.oparent</groupId> - <artifactId>oparent</artifactId> - <version>2.0.0</version> - <relativePath/> - </parent> - - <properties> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - - <tosca.datatype.version>${project.version}</tosca.datatype.version> - - <!-- 3rd parties versions --> - <bean-matcher.version>0.11</bean-matcher.version> - <lang3.version>3.10</lang3.version> - <guava.version>18.0</guava.version> - <janusgraph.version>0.3.1</janusgraph.version> - <spring.version>4.3.18.RELEASE</spring.version> - <jersey-bom.version>2.27</jersey-bom.version> - <netty.version>4.1.48.Final</netty.version> - <servlet-api.version>3.1.0</servlet-api.version> - <wire-mock.version>2.26.3</wire-mock.version> - <ecomp.version>2.6.0</ecomp.version> - <cassandra.unit.version>4.3.1.0</cassandra.unit.version> - <cadi.version>2.1.8</cadi.version> - <lombok.version>1.18.12</lombok.version> - <commons-beanutils>1.9.4</commons-beanutils> - <commons-configuration>2.3</commons-configuration> - <apache-poi.version>4.1.0</apache-poi.version> - <onap.logging.version>1.6.1</onap.logging.version> - <apache-commons-text.version>1.9</apache-commons-text.version> - - <commons.collections.version>4.1</commons.collections.version> - <ws.rs.version>2.1</ws.rs.version> - - <jetty.version>9.4.18.v20190429</jetty.version> - - <!-- JSON and YAML Parsing --> - <jackson.version>2.11.0</jackson.version> - <jackson-annotations.version>${jackson.version}</jackson-annotations.version> - - <clearspring.version>2.1.1</clearspring.version> - <skipYamlJsonValidator>false</skipYamlJsonValidator> - - <!-- Yaml for properties --> - <snakeyaml.version>1.14</snakeyaml.version> - <functionaljava.version>4.7</functionaljava.version> - <httpclient.version>4.5.3</httpclient.version> - <httpcore.version>4.4.1</httpcore.version> - <json-simple.version>1.1</json-simple.version> - - <!-- Logging start --> - <!-- logback --> - <logback.version>1.2.3</logback.version> - <slf4j-api.version>1.7.25</slf4j-api.version> - <commons-codec>1.10</commons-codec> - <commons-logging>1.2</commons-logging> - <janino.version>3.0.6</janino.version> - <log4j.version>2.13.1</log4j.version> - - <!-- aspects --> - <jcabi.version>0.20.1</jcabi.version> - <aspectjrt.version>1.8.4</aspectjrt.version> - <aspectj.version>1.7.4</aspectj.version> - <jcabi.maven.plugin.version>0.13.2</jcabi.maven.plugin.version> - - <!-- Logging end --> - <!-- System Metrics --> - <sigar.version>1.6.4</sigar.version> - - <regex.version>3.0.3</regex.version> - - <!--GSON--> - <gson.version>2.3.1</gson.version> - - <!--listen to file changes--> - <commons-jci-core.version>1.1</commons-jci-core.version> - - <!--TESTING--> - <mockito.version>3.3.3</mockito.version> - <mockitoJupiter.version>3.3.3</mockitoJupiter.version> - <jmockit.version>1.35</jmockit.version> - <junit.version>4.12</junit.version> - <junit.platform.version>1.6.0</junit.platform.version> - <junitJupiter.version>5.6.0</junitJupiter.version> - <assertj.version>3.16.0</assertj.version> - <testng.version>7.2.0</testng.version> - <cucumber.version>5.6.0</cucumber.version> - <bean-matchers.version>0.11</bean-matchers.version> - <hamcrest.version>2.1</hamcrest.version> - <hamcrest-all.version>1.3</hamcrest-all.version> - <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> - <maven-jar-plugin.version>2.4</maven-jar-plugin.version> - - <!-- parser--> - <sdc-tosca-parser.version>1.6.5</sdc-tosca-parser.version> - - <!-- sonar --> - <sonar.projectVersion>${project.version}</sonar.projectVersion> - <sonar.nodejs.executable>${project.basedir}/node/node</sonar.nodejs.executable> - <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports - </sonar.surefire.reportsPath> - <sonar.javascript.lcov.reportPaths>${project.build.directory}/code-coverage/lcov.info - </sonar.javascript.lcov.reportPaths> - <sonar.coverage.jacoco.xmlReportPaths> - ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml - </sonar.coverage.jacoco.xmlReportPaths> - <sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding> - <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir> - <sonar.coverage.exclusions>pom.xml,src/test</sonar.coverage.exclusions> - <!--cassandra --> - <cassandra.driver.version>3.8.0</cassandra.driver.version> - <!-- maven central (Nexus) --> - <nexus.id.release>nexus</nexus.id.release> - <nexus.id.snapshot>nexus</nexus.id.snapshot> - - <!--nexus--> - <npm.registry>https://registry.npmjs.org/</npm.registry> - <nexus.proxy>https://nexus.onap.org</nexus.proxy> - <sitePath>/content/sites/site/org/openecomp/sdc/${project.version}</sitePath> - <staging.profile.id>176c31dfe190a</staging.profile.id> - <!--maven--> - <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> - <!--docker tags--> - <docker.tag>${project.version}-${maven.build.timestamp}</docker.tag> - <!--togglz version--> - <togglz.version>2.6.1.Final</togglz.version> - - <joda.time.version>2.9.9</joda.time.version> - - <!--sdc-security-utils--> - <security.util.lib.version>1.6.0</security.util.lib.version> - <!--jacoco--> - <jacoco.version>0.8.5</jacoco.version> - <java.driver.core.version>4.5.1</java.driver.core.version> - - <!-- Surefire parameters --> - <surefire.forkCount>1C</surefire.forkCount> - <surefire.reuseForks>true</surefire.reuseForks> - </properties> - - <dependencyManagement> - <dependencies> - <dependency> - <groupId>com.google.guava</groupId> - <artifactId>guava</artifactId> - <version>${guava.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.jersey.ext</groupId> - <artifactId>jersey-bean-validation</artifactId> - <version>${jersey-bom.version}</version> - </dependency> - - <dependency> - <groupId>org.glassfish.hk2.external</groupId> - <artifactId>asm-all-repackaged</artifactId> - <version>2.4.0</version> - </dependency> - - <dependency> - <groupId>org.assertj</groupId> - <artifactId>assertj-core</artifactId> - <version>${assertj.version}</version> - </dependency> - - <dependency> - <groupId>org.jmockit</groupId> - <artifactId>jmockit</artifactId> - <version>${jmockit.version}</version> - </dependency> - - <dependency> - <groupId>com.github.tomakehurst</groupId> - <artifactId>wiremock-standalone</artifactId> - <version>${wire-mock.version}</version> - </dependency> - - <dependency> - <groupId>io.cucumber</groupId> - <artifactId>cucumber-java</artifactId> - <version>${cucumber.version}</version> - </dependency> - - <dependency> - <groupId>io.cucumber</groupId> - <artifactId>cucumber-junit</artifactId> - <version>${cucumber.version}</version> - </dependency> - - <dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-lang3</artifactId> - <version>${lang3.version}</version> - </dependency> - <dependency> - <groupId>org.codehaus.groovy</groupId> - <artifactId>groovy</artifactId> - <version>2.4.13</version> - </dependency> - <dependency> - <groupId>io.netty</groupId> - <artifactId>netty-all</artifactId> - <version>${netty.version}</version> - </dependency> - <dependency> - <groupId>io.netty</groupId> - <artifactId>netty-handler</artifactId> - <version>${netty.version}</version> - </dependency> - </dependencies> - </dependencyManagement> - - <dependencies> - <dependency> - <!-- must be on the classpath --> - <groupId>org.jacoco</groupId> - <artifactId>org.jacoco.agent</artifactId> - <classifier>runtime</classifier> - <version>${jacoco.version}</version> - <scope>test</scope> - </dependency> - <!--JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API --> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <version>${junitJupiter.version}</version> - <scope>test</scope> - </dependency> - <!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API --> - <dependency> - <groupId>org.junit.vintage</groupId> - <artifactId>junit-vintage-engine</artifactId> - <version>${junitJupiter.version}</version> - <scope>test</scope> - </dependency> - - <dependency> - <groupId>org.mockito</groupId> - <artifactId>mockito-core</artifactId> - <version>${mockito.version}</version> - <scope>test</scope> - </dependency> - </dependencies> - - <reporting> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-javadoc-plugin</artifactId> - <version>3.0.1</version> - <configuration> - <failOnError>false</failOnError> - <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> - <docletArtifact> - <groupId>org.umlgraph</groupId> - <artifactId>umlgraph</artifactId> - <version>5.6</version> - </docletArtifact> - <useStandardDocletOptions>true</useStandardDocletOptions> - </configuration> - </plugin> - </plugins> - </reporting> - - <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <version>${jacoco.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-assembly-plugin</artifactId> - <version>3.1.0</version> - <configuration> - <tarLongFileMode>posix</tarLongFileMode> - </configuration> - </plugin> - - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <version>1.6.0</version> - </plugin> - <plugin> - <groupId>org.sonarsource.scanner.maven</groupId> - <artifactId>sonar-maven-plugin</artifactId> - <version>3.7.0.1746</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-clean-plugin</artifactId> - <version>3.1.0</version> - </plugin> - <plugin> - <groupId>ru.yaal.maven</groupId> - <artifactId>write-text-files-maven-plugin</artifactId> - <version>1.1</version> - </plugin> - <plugin> - <groupId>org.codehaus.gmaven</groupId> - <artifactId>gmaven-plugin</artifactId> - <version>1.5</version> - </plugin> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <version>3.2.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-deploy-plugin</artifactId> - <version>2.8.2</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-shade-plugin</artifactId> - <version>3.1.1</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-resources-plugin</artifactId> - <version>3.2.0</version> - </plugin> - <plugin> - <groupId>io.fabric8</groupId> - <artifactId>docker-maven-plugin</artifactId> - <version>0.31.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>3.2.2</version> - </plugin> - <plugin> - <groupId>com.github.eirslett</groupId> - <artifactId>frontend-maven-plugin</artifactId> - <version>1.8.0</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <version>${maven-surefire-plugin.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <version>${maven-surefire-plugin.version}</version> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <version>3.8.0</version> - </plugin> - <plugin> - <groupId>com.github.sylvainlaurent.maven</groupId> - <artifactId>yaml-json-validator-maven-plugin</artifactId> - <version>1.0.2</version> - </plugin> - <plugin> - <groupId>pl.project13.maven</groupId> - <artifactId>git-commit-id-plugin</artifactId> - <version>4.0.0</version> - </plugin> - </plugins> - </pluginManagement> - - <plugins> - <plugin> - <artifactId>maven-checkstyle-plugin</artifactId> - <version>2.17</version> - <configuration> - <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation> - <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression> - <skip>${checkstyle.skip}</skip> - </configuration> - </plugin> - <!-- plugin for parsing the project version --> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>build-helper-maven-plugin</artifactId> - <executions> - <execution> - <id>parse-version</id> - <phase>pre-clean</phase> - <goals> - <goal>parse-version</goal> - </goals> - </execution> - </executions> - </plugin> - - <!-- Java Code Coverage --> - <plugin> - <groupId>org.jacoco</groupId> - <artifactId>jacoco-maven-plugin</artifactId> - <inherited>false</inherited> - <executions> - <execution> - <id>default-instrument</id> - <goals> - <goal>instrument</goal> - </goals> - </execution> - <execution> - <id>default-restore-instrumented-classes</id> - <goals> - <goal>restore-instrumented-classes</goal> - </goals> - </execution> - <execution> - <id>default-report</id> - <goals> - <goal>report</goal> - </goals> - <configuration> - <dataFile>${project.build.directory}/jacoco.exec</dataFile> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-site-plugin</artifactId> - <version>3.7.1</version> - <dependencies> - <dependency> - <groupId>org.apache.maven.wagon</groupId> - <artifactId>wagon-webdav-jackrabbit</artifactId> - <version>3.0.0</version> - </dependency> - </dependencies> - </plugin> - - <!-- Set the deployment repositories properties. --> - <plugin> - <groupId>org.codehaus.gmaven</groupId> - <artifactId>gmaven-plugin</artifactId> - <executions> - <execution> - <inherited>false</inherited> - <phase>integration-test</phase> - <goals> - <goal>execute</goal> - </goals> - <configuration> - <source> - pom.properties['deploy.url'] = - pom.version.contains('-SNAPSHOT') ? - project.distributionManagement.snapshotRepository.url : - project.distributionManagement.repository.url; - pom.properties['repo.id'] = pom.version.contains('-SNAPSHOT') ? - project.distributionManagement.snapshotRepository.id : - project.distributionManagement.repository.id; - </source> - </configuration> - </execution> - </executions> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.8</source> - <target>1.8</target> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> + <parent> + <groupId>org.onap.oparent</groupId> + <artifactId>oparent</artifactId> + <version>2.0.0</version> + <relativePath/> + </parent> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + + <tosca.datatype.version>${project.version}</tosca.datatype.version> + + <!-- 3rd parties versions --> + <bean-matcher.version>0.11</bean-matcher.version> + <lang3.version>3.10</lang3.version> + <guava.version>18.0</guava.version> + <janusgraph.version>0.3.1</janusgraph.version> + <spring.version>4.3.18.RELEASE</spring.version> + <jersey-bom.version>2.27</jersey-bom.version> + <netty.version>4.1.48.Final</netty.version> + <servlet-api.version>3.1.0</servlet-api.version> + <wire-mock.version>2.26.3</wire-mock.version> + <ecomp.version>2.6.0</ecomp.version> + <cassandra.unit.version>4.3.1.0</cassandra.unit.version> + <cadi.version>2.1.8</cadi.version> + <lombok.version>1.18.12</lombok.version> + <commons-beanutils>1.9.4</commons-beanutils> + <commons-configuration>2.3</commons-configuration> + <apache-poi.version>4.1.0</apache-poi.version> + <onap.logging.version>1.6.1</onap.logging.version> + <apache-commons-text.version>1.9</apache-commons-text.version> + <jaxb-api.version>2.3.1</jaxb-api.version> + + <commons.collections.version>4.1</commons.collections.version> + <ws.rs.version>2.1</ws.rs.version> + + <jetty.version>9.4.18.v20190429</jetty.version> + + <!-- JSON and YAML Parsing --> + <jackson.version>2.11.0</jackson.version> + <jackson-annotations.version>${jackson.version}</jackson-annotations.version> + + <clearspring.version>2.1.1</clearspring.version> + <skipYamlJsonValidator>false</skipYamlJsonValidator> + + <!-- Yaml for properties --> + <snakeyaml.version>1.14</snakeyaml.version> + <functionaljava.version>4.7</functionaljava.version> + <httpclient.version>4.5.3</httpclient.version> + <httpcore.version>4.4.1</httpcore.version> + <json-simple.version>1.1</json-simple.version> + + <!-- Logging start --> + <!-- logback --> + <logback.version>1.2.3</logback.version> + <slf4j-api.version>1.7.25</slf4j-api.version> + <commons-codec>1.10</commons-codec> + <commons-logging>1.2</commons-logging> + <janino.version>3.0.6</janino.version> + <log4j.version>2.13.1</log4j.version> + + <!-- aspects --> + <jcabi.version>0.20.1</jcabi.version> + <aspectjrt.version>1.8.4</aspectjrt.version> + <aspectj.version>1.7.4</aspectj.version> + <jcabi.maven.plugin.version>0.13.2</jcabi.maven.plugin.version> + + <!-- Logging end --> + <!-- System Metrics --> + <sigar.version>1.6.4</sigar.version> + + <regex.version>3.0.3</regex.version> + + <!--GSON--> + <gson.version>2.3.1</gson.version> + + <!--listen to file changes--> + <commons-jci-core.version>1.1</commons-jci-core.version> + + <!--TESTING--> + <mockito.version>3.3.3</mockito.version> + <mockitoJupiter.version>3.3.3</mockitoJupiter.version> + <jmockit.version>1.35</jmockit.version> + <junit.version>4.12</junit.version> + <junit.platform.version>1.6.0</junit.platform.version> + <junitJupiter.version>5.6.0</junitJupiter.version> + <assertj.version>3.16.0</assertj.version> + <testng.version>7.2.0</testng.version> + <cucumber.version>5.6.0</cucumber.version> + <bean-matchers.version>0.11</bean-matchers.version> + <hamcrest.version>2.1</hamcrest.version> + <hamcrest-all.version>1.3</hamcrest-all.version> + <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> + <maven-jar-plugin.version>2.4</maven-jar-plugin.version> + + <!-- parser--> + <sdc-tosca-parser.version>1.6.5</sdc-tosca-parser.version> + + <!-- sonar --> + <sonar.projectVersion>${project.version}</sonar.projectVersion> + <sonar.nodejs.executable>${project.basedir}/node/node</sonar.nodejs.executable> + <sonar.surefire.reportsPath>${project.build.directory}/surefire-reports + </sonar.surefire.reportsPath> + <sonar.javascript.lcov.reportPaths>${project.build.directory}/code-coverage/lcov.info + </sonar.javascript.lcov.reportPaths> + <sonar.coverage.jacoco.xmlReportPaths> + ${project.reporting.outputDirectory}/jacoco-ut/jacoco.xml + </sonar.coverage.jacoco.xmlReportPaths> + <sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding> + <sonar.projectBaseDir>${project.basedir}</sonar.projectBaseDir> + <sonar.coverage.exclusions>pom.xml,src/test</sonar.coverage.exclusions> + <!--cassandra --> + <cassandra.driver.version>3.8.0</cassandra.driver.version> + <!-- maven central (Nexus) --> + <nexus.id.release>nexus</nexus.id.release> + <nexus.id.snapshot>nexus</nexus.id.snapshot> + + <!--nexus--> + <npm.registry>https://registry.npmjs.org/</npm.registry> + <nexus.proxy>https://nexus.onap.org</nexus.proxy> + <sitePath>/content/sites/site/org/openecomp/sdc/${project.version}</sitePath> + <staging.profile.id>176c31dfe190a</staging.profile.id> + <!--maven--> + <maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format> + <!--docker tags--> + <docker.tag>${project.version}-${maven.build.timestamp}</docker.tag> + <!--togglz version--> + <togglz.version>2.6.1.Final</togglz.version> + + <joda.time.version>2.9.9</joda.time.version> + + <!--sdc-security-utils--> + <security.util.lib.version>1.6.0</security.util.lib.version> + <!--jacoco--> + <jacoco.version>0.8.5</jacoco.version> + + <java.driver.core.version>4.5.1</java.driver.core.version> + + <!-- Surefire parameters --> + <surefire.forkCount>1C</surefire.forkCount> + <surefire.reuseForks>true</surefire.reuseForks> + </properties> + + <dependencyManagement> <dependencies> - <dependency> - <groupId>org.apache.maven.surefire</groupId> - <artifactId>surefire-junit-platform</artifactId> - <version>${maven-surefire-plugin.version}</version> - </dependency> + <dependency> + <groupId>com.google.guava</groupId> + <artifactId>guava</artifactId> + <version>${guava.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.ext</groupId> + <artifactId>jersey-bean-validation</artifactId> + <version>${jersey-bom.version}</version> + </dependency> + + <dependency> + <groupId>org.glassfish.hk2.external</groupId> + <artifactId>asm-all-repackaged</artifactId> + <version>2.4.0</version> + </dependency> + + <dependency> + <groupId>org.assertj</groupId> + <artifactId>assertj-core</artifactId> + <version>${assertj.version}</version> + </dependency> + + <dependency> + <groupId>org.jmockit</groupId> + <artifactId>jmockit</artifactId> + <version>${jmockit.version}</version> + </dependency> + + <dependency> + <groupId>com.github.tomakehurst</groupId> + <artifactId>wiremock-standalone</artifactId> + <version>${wire-mock.version}</version> + </dependency> + + <dependency> + <groupId>io.cucumber</groupId> + <artifactId>cucumber-java</artifactId> + <version>${cucumber.version}</version> + </dependency> + + <dependency> + <groupId>io.cucumber</groupId> + <artifactId>cucumber-junit</artifactId> + <version>${cucumber.version}</version> + </dependency> + + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>${lang3.version}</version> + </dependency> + <dependency> + <groupId>org.codehaus.groovy</groupId> + <artifactId>groovy</artifactId> + <version>2.4.13</version> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-all</artifactId> + <version>${netty.version}</version> + </dependency> + <dependency> + <groupId>io.netty</groupId> + <artifactId>netty-handler</artifactId> + <version>${netty.version}</version> + </dependency> </dependencies> - <configuration> - <printSummary>false</printSummary> - <systemPropertyVariables> - <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile> - </systemPropertyVariables> - <forkCount>${surefire.forkCount}</forkCount> - <reuseForks>${surefire.reuseForks}</reuseForks> - <parallel>methods</parallel> - </configuration> - </plugin> - <plugin> - <groupId>pl.project13.maven</groupId> - <artifactId>git-commit-id-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>revision</goal> - </goals> - </execution> - </executions> - <configuration> - <generateGitPropertiesFile>true</generateGitPropertiesFile> - <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/git.properties - </generateGitPropertiesFilename> - <failOnNoGitDirectory>true</failOnNoGitDirectory> - <verbose>false</verbose> - <includeOnlyProperties> - <includeOnlyProperty>git.build.version</includeOnlyProperty> - <includeOnlyProperty>git.build.time</includeOnlyProperty> - <includeOnlyProperty>git.commit.id</includeOnlyProperty> - <includeOnlyProperty>git.commit.time</includeOnlyProperty> - <includeOnlyProperty>git.commit.user.name</includeOnlyProperty> - <includeOnlyProperty>git.commit.user.email</includeOnlyProperty> - <includeOnlyProperty>git.commit.message.short</includeOnlyProperty> - <includeOnlyProperty>git.commit.message.full</includeOnlyProperty> - </includeOnlyProperties> - <gitDescribe> - <skip>true</skip> - </gitDescribe> - <useNativeGit>false</useNativeGit> - </configuration> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>all</id> - <activation> - <activeByDefault>true</activeByDefault> - </activation> - <properties> - <checkstyle.skip>true</checkstyle.skip> - </properties> - <modules> - <module>onboarding</module> - <module>common-app-logging</module> - <module>common-app-api</module> - <module>common-be</module> - <module>catalog-dao</module> - <module>catalog-model</module> - <module>catalog-be</module> - <module>catalog-be-plugins</module> - <module>asdctool</module> - <module>catalog-ui</module> - <module>catalog-fe</module> - <module>sdc-os-chef</module> - <module>utils/webseal-simulator</module> - <module>integration-tests</module> - </modules> - </profile> - <profile> - <id>skip-integration-tests</id> - <activation> - <property> - <name>skipITs</name> - <value>true</value> - </property> - </activation> - <properties> - <checkstyle.skip>true</checkstyle.skip> - </properties> - <modules> - <module>onboarding</module> - <module>common-app-logging</module> - <module>common-app-api</module> - <module>common-be</module> - <module>catalog-dao</module> - <module>catalog-model</module> - <module>catalog-be</module> - <module>asdctool</module> - <module>catalog-ui</module> - <module>catalog-fe</module> - <module>sdc-os-chef</module> - <module>utils/webseal-simulator</module> - </modules> - </profile> - <profile> - <id>fast-build</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <properties> - <maven.test.skip>true</maven.test.skip> - <skipYamlJsonValidator>true</skipYamlJsonValidator> - <checkstyle.skip>true</checkstyle.skip> - <jacoco.skip>true</jacoco.skip> - </properties> - <modules> - <module>onboarding</module> - <module>common-app-logging</module> - <module>common-app-api</module> - <module>common-be</module> - <module>catalog-be-plugins</module> - <module>catalog-dao</module> - <module>catalog-model</module> - <module>catalog-be</module> - <module>asdctool</module> - <module>catalog-ui</module> - <module>catalog-fe</module> - <module>sdc-os-chef</module> - <module>utils/webseal-simulator</module> - </modules> - </profile> - <profile> - <id>start-sdc</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <properties> - <maven.test.skip>true</maven.test.skip> - <skipYamlJsonValidator>true</skipYamlJsonValidator> - <checkstyle.skip>true</checkstyle.skip> - <jacoco.skip>true</jacoco.skip> - <docker.keepRunning>true</docker.keepRunning> - </properties> - <modules> - <module>integration-tests</module> - </modules> - </profile> - <profile> - <id>stop-sdc</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <properties> - <maven.test.skip>true</maven.test.skip> - <skipYamlJsonValidator>true</skipYamlJsonValidator> - <checkstyle.skip>true</checkstyle.skip> - <jacoco.skip>true</jacoco.skip> - <docker.skip.run>true</docker.skip.run> - </properties> - <modules> - <module>integration-tests</module> - </modules> - </profile> - <profile> - <id>run-integration-tests</id> - <activation> - <activeByDefault>false</activeByDefault> - </activation> - <properties> - <skipYamlJsonValidator>true</skipYamlJsonValidator> - <checkstyle.skip>true</checkstyle.skip> - <docker.skip>true</docker.skip> - </properties> - <modules> - <module>integration-tests</module> - </modules> - </profile> - </profiles> - - <repositories> - <!-- LF repositories --> - <repository> - <id>ecomp-releases</id> - <name>Release Repository</name> - <url>${nexus.proxy}/content/repositories/releases/</url> - </repository> - <repository> - <id>ecomp-snapshots</id> - <name>Snapshots Repository</name> - <url>${nexus.proxy}/content/repositories/snapshots/</url> - </repository> - <repository> - <id>ecomp-public</id> - <name>Public Repository</name> - <url>${nexus.proxy}/content/repositories/public/</url> - </repository> - <!-- LF repositories END--> - </repositories> - - <distributionManagement> - <repository> - <id>ecomp-releases</id> - <name>Release Repository</name> - <url>${nexus.proxy}/content/repositories/releases/</url> - </repository> - <snapshotRepository> - <id>ecomp-snapshots</id> - <name>Snapshot Repository</name> - <url>${nexus.proxy}/content/repositories/snapshots/</url> - </snapshotRepository> - <site> - <id>ecomp-site</id> - <url>dav:${nexus.proxy}${sitePath}</url> - </site> - </distributionManagement> + </dependencyManagement> + + <dependencies> + <dependency> + <!-- must be on the classpath --> + <groupId>org.jacoco</groupId> + <artifactId>org.jacoco.agent</artifactId> + <classifier>runtime</classifier> + <version>${jacoco.version}</version> + <scope>test</scope> + </dependency> + <!--JUnit Jupiter Engine to depend on the JUnit5 engine and JUnit 5 API --> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>${junitJupiter.version}</version> + <scope>test</scope> + </dependency> + <!--JUnit Jupiter Engine to depend on the JUnit4 engine and JUnit 4 API --> + <dependency> + <groupId>org.junit.vintage</groupId> + <artifactId>junit-vintage-engine</artifactId> + <version>${junitJupiter.version}</version> + <scope>test</scope> + </dependency> + + <dependency> + <groupId>org.mockito</groupId> + <artifactId>mockito-core</artifactId> + <version>${mockito.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <reporting> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.0.1</version> + <configuration> + <failOnError>false</failOnError> + <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> + <docletArtifact> + <groupId>org.umlgraph</groupId> + <artifactId>umlgraph</artifactId> + <version>5.6</version> + </docletArtifact> + <useStandardDocletOptions>true</useStandardDocletOptions> + </configuration> + </plugin> + </plugins> + </reporting> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>${jacoco.version}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-assembly-plugin</artifactId> + <version>3.1.0</version> + <configuration> + <tarLongFileMode>posix</tarLongFileMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.6.0</version> + </plugin> + <plugin> + <groupId>org.sonarsource.scanner.maven</groupId> + <artifactId>sonar-maven-plugin</artifactId> + <version>3.7.0.1746</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-clean-plugin</artifactId> + <version>3.1.0</version> + </plugin> + <plugin> + <groupId>ru.yaal.maven</groupId> + <artifactId>write-text-files-maven-plugin</artifactId> + <version>1.1</version> + </plugin> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>gmaven-plugin</artifactId> + <version>1.5</version> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.2.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>2.8.2</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-shade-plugin</artifactId> + <version>3.1.1</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-resources-plugin</artifactId> + <version>3.2.0</version> + </plugin> + <plugin> + <groupId>io.fabric8</groupId> + <artifactId>docker-maven-plugin</artifactId> + <version>0.31.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>3.2.2</version> + </plugin> + <plugin> + <groupId>com.github.eirslett</groupId> + <artifactId>frontend-maven-plugin</artifactId> + <version>1.8.0</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>${maven-surefire-plugin.version}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>${maven-surefire-plugin.version}</version> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + </plugin> + <plugin> + <groupId>com.github.sylvainlaurent.maven</groupId> + <artifactId>yaml-json-validator-maven-plugin</artifactId> + <version>1.0.2</version> + </plugin> + <plugin> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <version>4.0.0</version> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <artifactId>maven-checkstyle-plugin</artifactId> + <version>2.17</version> + <configuration> + <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation> + <suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression> + <skip>${checkstyle.skip}</skip> + </configuration> + </plugin> + <!-- plugin for parsing the project version --> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>parse-version</id> + <phase>pre-clean</phase> + <goals> + <goal>parse-version</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- Java Code Coverage --> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <inherited>false</inherited> + <executions> + <execution> + <id>default-instrument</id> + <goals> + <goal>instrument</goal> + </goals> + </execution> + <execution> + <id>default-restore-instrumented-classes</id> + <goals> + <goal>restore-instrumented-classes</goal> + </goals> + </execution> + <execution> + <id>default-report</id> + <goals> + <goal>report</goal> + </goals> + <configuration> + <dataFile>${project.build.directory}/jacoco.exec</dataFile> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-site-plugin</artifactId> + <version>3.7.1</version> + <dependencies> + <dependency> + <groupId>org.apache.maven.wagon</groupId> + <artifactId>wagon-webdav-jackrabbit</artifactId> + <version>3.0.0</version> + </dependency> + </dependencies> + </plugin> + + <!-- Set the deployment repositories properties. --> + <plugin> + <groupId>org.codehaus.gmaven</groupId> + <artifactId>gmaven-plugin</artifactId> + <executions> + <execution> + <inherited>false</inherited> + <phase>integration-test</phase> + <goals> + <goal>execute</goal> + </goals> + <configuration> + <source> + pom.properties['deploy.url'] = + pom.version.contains('-SNAPSHOT') ? + project.distributionManagement.snapshotRepository.url : + project.distributionManagement.repository.url; + pom.properties['repo.id'] = pom.version.contains('-SNAPSHOT') ? + project.distributionManagement.snapshotRepository.id : + project.distributionManagement.repository.id; + </source> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>11</source> + <target>11</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-junit-platform</artifactId> + <version>${maven-surefire-plugin.version}</version> + </dependency> + </dependencies> + <configuration> + <printSummary>false</printSummary> + <systemPropertyVariables> + <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile> + </systemPropertyVariables> + <forkCount>${surefire.forkCount}</forkCount> + <reuseForks>${surefire.reuseForks}</reuseForks> + <parallel>methods</parallel> + </configuration> + </plugin> + <plugin> + <groupId>pl.project13.maven</groupId> + <artifactId>git-commit-id-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>revision</goal> + </goals> + </execution> + </executions> + <configuration> + <generateGitPropertiesFile>true</generateGitPropertiesFile> + <generateGitPropertiesFilename>${project.build.outputDirectory}/META-INF/git.properties + </generateGitPropertiesFilename> + <failOnNoGitDirectory>true</failOnNoGitDirectory> + <verbose>false</verbose> + <includeOnlyProperties> + <includeOnlyProperty>git.build.version</includeOnlyProperty> + <includeOnlyProperty>git.build.time</includeOnlyProperty> + <includeOnlyProperty>git.commit.id</includeOnlyProperty> + <includeOnlyProperty>git.commit.time</includeOnlyProperty> + <includeOnlyProperty>git.commit.user.name</includeOnlyProperty> + <includeOnlyProperty>git.commit.user.email</includeOnlyProperty> + <includeOnlyProperty>git.commit.message.short</includeOnlyProperty> + <includeOnlyProperty>git.commit.message.full</includeOnlyProperty> + </includeOnlyProperties> + <gitDescribe> + <skip>true</skip> + </gitDescribe> + <useNativeGit>false</useNativeGit> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>all</id> + <activation> + <activeByDefault>true</activeByDefault> + </activation> + <properties> + <checkstyle.skip>true</checkstyle.skip> + </properties> + <modules> + <module>onboarding</module> + <module>common-app-logging</module> + <module>common-app-api</module> + <module>common-be</module> + <module>catalog-dao</module> + <module>catalog-model</module> + <module>catalog-be</module> + <module>catalog-be-plugins</module> + <module>asdctool</module> + <module>catalog-ui</module> + <module>catalog-fe</module> + <module>sdc-os-chef</module> + <module>utils/webseal-simulator</module> + <module>integration-tests</module> + </modules> + </profile> + <profile> + <id>skip-integration-tests</id> + <activation> + <property> + <name>skipITs</name> + <value>true</value> + </property> + </activation> + <properties> + <checkstyle.skip>true</checkstyle.skip> + </properties> + <modules> + <module>onboarding</module> + <module>common-app-logging</module> + <module>common-app-api</module> + <module>common-be</module> + <module>catalog-dao</module> + <module>catalog-model</module> + <module>catalog-be</module> + <module>catalog-be-plugins</module> + <module>asdctool</module> + <module>catalog-ui</module> + <module>catalog-fe</module> + <module>sdc-os-chef</module> + <module>utils/webseal-simulator</module> + </modules> + </profile> + <profile> + <id>fast-build</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.test.skip>true</maven.test.skip> + <skipYamlJsonValidator>true</skipYamlJsonValidator> + <checkstyle.skip>true</checkstyle.skip> + <jacoco.skip>true</jacoco.skip> + </properties> + <modules> + <module>onboarding</module> + <module>common-app-logging</module> + <module>common-app-api</module> + <module>common-be</module> + <module>catalog-dao</module> + <module>catalog-model</module> + <module>catalog-be</module> + <module>catalog-be-plugins</module> + <module>asdctool</module> + <module>catalog-ui</module> + <module>catalog-fe</module> + <module>sdc-os-chef</module> + <module>utils/webseal-simulator</module> + </modules> + </profile> + <profile> + <id>start-sdc</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.test.skip>true</maven.test.skip> + <skipYamlJsonValidator>true</skipYamlJsonValidator> + <checkstyle.skip>true</checkstyle.skip> + <jacoco.skip>true</jacoco.skip> + <docker.keepRunning>true</docker.keepRunning> + </properties> + <modules> + <module>integration-tests</module> + </modules> + </profile> + <profile> + <id>stop-sdc</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <maven.test.skip>true</maven.test.skip> + <skipYamlJsonValidator>true</skipYamlJsonValidator> + <checkstyle.skip>true</checkstyle.skip> + <jacoco.skip>true</jacoco.skip> + <docker.skip.run>true</docker.skip.run> + </properties> + <modules> + <module>integration-tests</module> + </modules> + </profile> + <profile> + <id>run-integration-tests</id> + <activation> + <activeByDefault>false</activeByDefault> + </activation> + <properties> + <skipYamlJsonValidator>true</skipYamlJsonValidator> + <checkstyle.skip>true</checkstyle.skip> + <docker.skip>true</docker.skip> + </properties> + <modules> + <module>integration-tests</module> + </modules> + </profile> + + </profiles> + + <repositories> + <!-- LF repositories --> + <repository> + <id>ecomp-releases</id> + <name>Release Repository</name> + <url>${nexus.proxy}/content/repositories/releases/</url> + </repository> + <repository> + <id>ecomp-snapshots</id> + <name>Snapshots Repository</name> + <url>${nexus.proxy}/content/repositories/snapshots/</url> + </repository> + <repository> + <id>ecomp-public</id> + <name>Public Repository</name> + <url>${nexus.proxy}/content/repositories/public/</url> + </repository> + <!-- LF repositories END--> + </repositories> + + <distributionManagement> + <repository> + <id>ecomp-releases</id> + <name>Release Repository</name> + <url>${nexus.proxy}/content/repositories/releases/</url> + </repository> + <snapshotRepository> + <id>ecomp-snapshots</id> + <name>Snapshot Repository</name> + <url>${nexus.proxy}/content/repositories/snapshots/</url> + </snapshotRepository> + <site> + <id>ecomp-site</id> + <url>dav:${nexus.proxy}${sitePath}</url> + </site> + </distributionManagement> </project> diff --git a/utils/webseal-simulator/sdc-simulator/Dockerfile b/utils/webseal-simulator/sdc-simulator/Dockerfile index d217d5aabf..24a7dd1943 100644 --- a/utils/webseal-simulator/sdc-simulator/Dockerfile +++ b/utils/webseal-simulator/sdc-simulator/Dockerfile @@ -1,4 +1,48 @@ -FROM onap/base_sdc-jetty:1.7.0 +FROM jetty:9.4.31-jre11-slim + +USER root + +# Install Chef +RUN set -ex && \ + apt-get update -y && \ + apt-get install -y \ + jq \ + curl \ + curl \ + vim \ + make \ + gcc \ + ruby \ + ruby-dev \ + libffi-dev \ + libxml2-dev && \ + gem install \ + chef:13.8.5 \ + berkshelf:6.3.1 \ + io-console:0.4.6 \ + etc webrick \ + --no-document && \ + gem cleanup && \ + apt-get update -y && \ + apt-get install -y binutils jq && \ + apt-get clean + +# Replace Jetty user ID +ENV USER_JETTY="jetty" +ENV GROUP_JETTY="jetty" +ENV UID_JETTY="352070" +ENV GID_JETTY="35953" + +# Remove user: +RUN deluser ${USER_JETTY} +#RUN delgroup ${GROUP_JETTY} +RUN echo "${USER_JETTY}:x:${UID_JETTY}:${GID_JETTY}::/home/${USER_JETTY}:Linux User,,,:/home/jetty:/bin/false" >> /etc/passwd +RUN echo "${GROUP_JETTY}:x:${GID_JETTY}:${USER_JETTY}" >> /etc/group +RUN echo "${USER_JETTY}:!:17501:0:99999:7:::" >> /etc/shadow +RUN mkdir /home/${USER_JETTY} && chown ${USER_JETTY}:${GROUP_JETTY} /home/${USER_JETTY} +RUN chown -R jetty:jetty ${JETTY_BASE}/webapps /var/lib/jetty + +USER jetty COPY chef-solo /root/chef-solo/ @@ -10,8 +54,8 @@ USER root RUN chown -R jetty:jetty ${JETTY_BASE}/webapps -COPY startup.sh /root/ +COPY startup.sh ${JETTY_BASE}/ -RUN chmod 777 /root/startup.sh +RUN chmod 777 ${JETTY_BASE}/startup.sh -ENTRYPOINT [ "/root/startup.sh" ] +ENTRYPOINT [ "sh", "-c", "${JETTY_BASE}/startup.sh"] diff --git a/utils/webseal-simulator/sdc-simulator/startup.sh b/utils/webseal-simulator/sdc-simulator/startup.sh index 66add3a75e..3f6e2a02b5 100644 --- a/utils/webseal-simulator/sdc-simulator/startup.sh +++ b/utils/webseal-simulator/sdc-simulator/startup.sh @@ -1,11 +1,9 @@ #!/bin/sh - - cd /root/chef-solo chef-solo -c solo.rb -E ${ENVNAME} rc=$? -if [[ $rc != 0 ]]; then +if [ $rc -ne 0 ]; then echo "Chef exaction failed." exit $rc; fi @@ -21,5 +19,6 @@ JAVA_OPTIONS=" ${JAVA_OPTIONS} \ cd /var/lib/jetty -/docker-entrypoint.sh + +java $JAVA_OPTIONS -jar "$JETTY_HOME/start.jar" |