From f94606aea2ac4a18028865c47dcd53b72a6d8c89 Mon Sep 17 00:00:00 2001 From: Dmitry Puzikov Date: Thu, 22 Aug 2019 15:30:56 +0200 Subject: [PATCH] Fixed project version parsing Change-Id: I488b42b187e78db90e862ca8683bb361fa1d9bf6 Issue-ID: INT-1152 Signed-off-by: Dmitry Puzikov --- .gitignore | 3 +- elasticsearch-sg/pom.xml | 197 ++-- pom.xml | 43 +- search-data-service-app/pom.xml | 1045 +++++++++++--------- .../src/main/assembly/descriptor.xml | 32 + search-data-service-app/src/main/docker/Dockerfile | 24 +- 6 files changed, 753 insertions(+), 591 deletions(-) create mode 100644 search-data-service-app/src/main/assembly/descriptor.xml diff --git a/.gitignore b/.gitignore index 79cde97..e6cb035 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ **/src/main/java-gen/ -/target/ +target/ /bin/ .project .settings/ @@ -7,3 +7,4 @@ .idea/ logs/ debug-logs/ +*.iml diff --git a/elasticsearch-sg/pom.xml b/elasticsearch-sg/pom.xml index 31bad6a..8b35a82 100644 --- a/elasticsearch-sg/pom.xml +++ b/elasticsearch-sg/pom.xml @@ -21,88 +21,129 @@ --> - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - - search-data-service - org.onap.aai - 1.6.0-SNAPSHOT - + + search-data-service + org.onap.aai + 1.6.0-SNAPSHOT + - org.onap.aai.search-data-service - elasticsearch-sg - ElasticSearch with SearchGuard - 1.6.0-SNAPSHOT - pom + org.onap.aai.search-data-service + elasticsearch-sg + ElasticSearch with SearchGuard + 1.6.0-SNAPSHOT + pom - - https://nexus.onap.org - + + + docker + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + + copy-docker-file + process-resources + + copy-resources + + + ${aai.build.directory} + true + + + ${basedir}/src/main/docker + + **/* + + + + + + + - - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - copy-docker-file - process-resources - - copy-resources - - - target - true - - - ${basedir}/src/main/docker - - **/* - - - - - - - - - - com.spotify - docker-maven-plugin - 0.4.11 - - true - docker-hub - ${docker.push.registry}/onap/${project.artifactId} - ${basedir}/target - - latest - - true - - - - org.apache.maven.plugins - maven-deploy-plugin - - - - - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - + + io.fabric8 + docker-maven-plugin + ${docker.fabric.version} + + true + 1.23 + + + ${docker.push.registry}/${aai.docker.namespace}/${project.artifactId}:%l + + + @ + + latest + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp} + + try + ${aai.build.directory} + + + + + + + clean-images + clean + + remove + + + true + + + + generate-images + package + + build + + + + push-images + deploy + + push + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + + + + + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}/content/repositories/releases/ + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}/content/repositories/snapshots/ + + diff --git a/pom.xml b/pom.xml index 43b920a..abbd898 100644 --- a/pom.xml +++ b/pom.xml @@ -41,18 +41,45 @@ https://nexus.onap.org + + 0.31.0 + 1.0.0 + onap + alpine + 1.6.0 + ${project.build.directory}/${project.artifactId}-build/ + + yyyyMMdd'T'HHmmss'Z' + + + docker + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + pre-clean + parse-version + + parse-version + + + + + + + + + + - - com.spotify - docker-maven-plugin - 0.4.11 - - true - - org.apache.maven.plugins maven-deploy-plugin diff --git a/search-data-service-app/pom.xml b/search-data-service-app/pom.xml index 9fd750c..0cf8043 100644 --- a/search-data-service-app/pom.xml +++ b/search-data-service-app/pom.xml @@ -21,506 +21,579 @@ --> - 4.0.0 - - - search-data-service - org.onap.aai - 1.6.0-SNAPSHOT - - - org.onap.aai.search-data-service - search-data-service-app - 1.6.0-SNAPSHOT - AAI Search Data Service Application - - - ${basedir}/target - search-data-service - https://nexus.onap.org - 1.8 - ${basedir}/src/main/java-gen - google_checks.xml - - java - jacoco - ${project.build.directory}/surefire-reports - - ${project.build.directory}/coverage-reports/jacoco.exec - - false - ${project.version} - 0.58 - 1.5.21.RELEASE - - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + + search-data-service + org.onap.aai + 1.6.0-SNAPSHOT + + + org.onap.aai.search-data-service + search-data-service-app + 1.6.0-SNAPSHOT + AAI Search Data Service Application + + + search-data-service + 1.8 + ${basedir}/src/main/java-gen + google_checks.xml + + java + jacoco + ${project.build.directory}/surefire-reports + + ${project.build.directory}/coverage-reports/jacoco.exec + + false + ${project.version} + 0.58 + 1.5.21.RELEASE + + + + - org.springframework.boot - spring-boot-starter-parent - ${spring.boot.version} - pom - import + org.springframework.boot + spring-boot-starter-parent + ${spring.boot.version} + pom + import - - - - - - - com.google.code.gson - gson - - - - org.hamcrest - hamcrest-library - test - - - - com.jayway.jsonpath - json-path - - - - com.googlecode.json-simple - json-simple - - - - org.dom4j - dom4j - 2.1.1 - provided - - - - commons-io - commons-io - 2.4 - - - - org.mockito - mockito-all - 1.10.19 - test - + + + + + + + com.google.code.gson + gson + + + + org.hamcrest + hamcrest-library + test + + + + com.jayway.jsonpath + json-path + + + + com.googlecode.json-simple + json-simple + + + + org.dom4j + dom4j + 2.1.1 + provided + + + + commons-io + commons-io + 2.4 + + + + org.mockito + mockito-all + 1.10.19 + test + - - org.onap.aai.logging-service - common-logging - 1.5.0 - - - - org.onap.aai.logging-service - logging-api - 1.5.0 - - - - org.onap.aai.logging-service - eelf-logging - 1.5.0 - + + org.onap.aai.logging-service + common-logging + 1.5.0 + + + + org.onap.aai.logging-service + logging-api + 1.5.0 + + + + org.onap.aai.logging-service + eelf-logging + 1.5.0 + - - com.fasterxml.jackson.core - jackson-databind - - - - org.apache.directory.studio - org.apache.commons.lang - 2.6 - - - - radeox - radeox - 0.9 - - - - com.github.fge - json-schema-validator - 2.0.0 - - - - org.json - json - 20180130 - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - - org.springframework.boot - spring-boot-starter-jetty - - - - org.springframework.boot - spring-boot-starter - - - ch.qos.logback - logback-classic - - - - - - org.springframework.boot - spring-boot-starter-jersey - - - org.springframework.boot - spring-boot-starter-tomcat - - - - - - org.springframework.boot - spring-boot-starter-actuator - - - - org.springframework.boot - spring-boot-starter-test - test - - - - org.springframework.boot - spring-boot-starter-security - + + com.fasterxml.jackson.core + jackson-databind + + + + org.apache.directory.studio + org.apache.commons.lang + 2.6 + + + + radeox + radeox + 0.9 + + + + com.github.fge + json-schema-validator + 2.0.0 + + + + org.json + json + 20180130 + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + org.springframework.boot + spring-boot-starter-jetty + + + + org.springframework.boot + spring-boot-starter + + + ch.qos.logback + logback-classic + + + + + + org.springframework.boot + spring-boot-starter-jersey + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.boot + spring-boot-starter-security + - - ch.qos.logback - logback-classic - - - - ch.qos.logback - logback-core - - - - - - - central - Maven 2 repository 2 - http://repo2.maven.org/maven2/ - - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - - ecomp-staging - ECOMP Staging Repository - ${nexusproxy}/content/repositories/staging/ - - - - - search-data-service-package - - - org.springframework.boot - spring-boot-maven-plugin - + + ch.qos.logback + logback-classic + + + + ch.qos.logback + logback-core + + + + + + + central + Maven 2 repository 2 + http://repo2.maven.org/maven2/ + + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}/content/repositories/releases/ + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}/content/repositories/snapshots/ + + + ecomp-staging + ECOMP Staging Repository + ${nexusproxy}/content/repositories/staging/ + + + + + + docker + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.0.0 + + + maven-assembly-plugin + + + src/main/assembly/descriptor.xml + + + + + make-assembly + package + + single + + + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + prepare-package + + execute + + + + def userAaiBaseImage = session.userProperties['aai.base.image'] + def userAaiCommonVersion = session.userProperties['aai.base.image.version'] + if (userAaiCommonVersion != null) { + project.properties['aai.base.image.version'] = userAaiCommonVersion + } + if (userAaiBaseImage != null) { + project.properties['aai.base.image'] = userAaiBaseImage + } + log.info 'Base image flavour: ' + project.properties['aai.base.image'] + log.info 'Base image version: ' + project.properties['aai.base.image.version'] + + + + + + + io.fabric8 + docker-maven-plugin + ${docker.fabric.version} + + true + 1.23 + + + ${docker.push.registry}/${aai.docker.namespace}/${docker.image.name.suffix}:%l + + + @ + + latest + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-latest + ${parsedVersion.majorVersion}.${parsedVersion.minorVersion}-STAGING-${maven.build.timestamp} + + try + ${project.basedir}/src/main/docker + + + + + ${aai.build.directory} + /${project.artifactId} + + + + + + + + + + + clean-images + clean + + remove + + + true + + + + generate-images + package + + build + + + + push-images + deploy + + push + + + + + + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + - - org.apache.maven.plugins - maven-site-plugin - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - - checkstyle - - - - - - - + + org.apache.maven.plugins + maven-site-plugin + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + + checkstyle + + + + + + + - - org.apache.maven.plugins - maven-compiler-plugin - - groovy-eclipse-compiler - true - 1.8 - 1.8 - - - - org.codehaus.groovy - groovy-eclipse-compiler - 2.9.0-01 - - - org.codehaus.groovy - groovy-eclipse-batch - 2.3.4-01 - - - - - com.spotify - docker-maven-plugin - 0.4.11 - - true - docker-hub - ${docker.push.registry}/onap/${docker.image.name.suffix} - ${docker.location} - - latest - - true - - + + org.apache.maven.plugins + maven-compiler-plugin + + groovy-eclipse-compiler + true + 1.8 + 1.8 + + + + org.codehaus.groovy + groovy-eclipse-compiler + 2.9.0-01 + + + org.codehaus.groovy + groovy-eclipse-batch + 2.3.4-01 + + + - - org.jsonschema2pojo - jsonschema2pojo-maven-plugin - 0.4.26 - - true - ${basedir}/src/main/resources/json/schema - ${generatedSourceDir} - org.onap.aai.sa.rest - - - - - generate - - - - - - - org.apache.maven.plugins - maven-resources-plugin - - - copy-docker-file - package - - copy-resources - - - target - true - - - ${basedir}/src/main/docker - true - - **/* - - - - ${basedir} - true - - bundleconfig-local/** - - - - ${basedir}/src/main/bin/ - - - - - - + + org.jsonschema2pojo + jsonschema2pojo-maven-plugin + 0.4.26 + + true + ${basedir}/src/main/resources/json/schema + ${generatedSourceDir} + org.onap.aai.sa.rest + + + + + generate + + + + + - - com.mycila - license-maven-plugin - 3.0 - -
License.txt
- - src/main/java/** - src/test/java/** - pom.xml - - true -
- - - - check - - validate - - -
- - org.apache.maven.plugins - maven-deploy-plugin - - - org.codehaus.mojo - sonar-maven-plugin - 3.2 - - - - org.jacoco - jacoco-maven-plugin - - - - pre-unit-test - - prepare-agent - - - - ${sonar.jacoco.reportPath} - surefireArgLine - - - - - post-unit-test - test - - report - - - - ${sonar.jacoco.reportPath} - - ${jacoco.path} - - - - - pre-integration-test - pre-integration-test - - prepare-agent - - - - ${sonar.jacoco.itReportPath} - - failsafeArgLine - - - - - post-integration-test - post-integration-test - - report - - - - ${sonar.jacoco.itReportPath}/ - - ${jacoco.itPath} - - - - default-check - - check - - - ${project.build.directory}/coverage-reports/jacoco.exec - - - - BUNDLE - - - LINE - COVEREDRATIO - ${jacoco.line.coverage.limit} - - - - - - - - + + com.mycila + license-maven-plugin + 3.0 + +
License.txt
+ + src/main/java/** + src/test/java/** + pom.xml + + true +
+ + + + check + + validate + + +
+ + org.apache.maven.plugins + maven-deploy-plugin + + + org.codehaus.mojo + sonar-maven-plugin + 3.2 + + + + org.jacoco + jacoco-maven-plugin + + + + pre-unit-test + + prepare-agent + + + + ${sonar.jacoco.reportPath} + surefireArgLine + + + + + post-unit-test + test + + report + + + + ${sonar.jacoco.reportPath} + + ${jacoco.path} + + + + + pre-integration-test + pre-integration-test + + prepare-agent + + + + ${sonar.jacoco.itReportPath} + + failsafeArgLine + + + + + post-integration-test + post-integration-test + + report + + + + ${sonar.jacoco.itReportPath}/ + + ${jacoco.itPath} + + + + default-check + + check + + + ${project.build.directory}/coverage-reports/jacoco.exec + + + + BUNDLE + + + LINE + COVEREDRATIO + ${jacoco.line.coverage.limit} + + + + + + + + - - maven-clean-plugin - - - - ${generatedSourceDir} - - - - -
-
- - - ecomp-releases - ECOMP Release Repository - ${nexusproxy}/content/repositories/releases/ - - - ecomp-snapshots - ECOMP Snapshot Repository - ${nexusproxy}/content/repositories/snapshots/ - - - ecomp-javadoc - dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version} - - + + maven-clean-plugin + + + + ${generatedSourceDir} + + + + +
+
+ + + ecomp-releases + ECOMP Release Repository + ${nexusproxy}/content/repositories/releases/ + + + ecomp-snapshots + ECOMP Snapshot Repository + ${nexusproxy}/content/repositories/snapshots/ + + + ecomp-javadoc + dav:https://ecomp-nexus:8443/repository/aai/search-data-service-javadoc/${project.version} + +
diff --git a/search-data-service-app/src/main/assembly/descriptor.xml b/search-data-service-app/src/main/assembly/descriptor.xml new file mode 100644 index 0000000..5e46871 --- /dev/null +++ b/search-data-service-app/src/main/assembly/descriptor.xml @@ -0,0 +1,32 @@ + + build + false + + dir + + + + ${project.basedir}/bundleconfig-local + /bundleconfig + + **/* + + + + ${project.basedir}/src/main/bin + /bin + + **/* + + + + + + ${project.build.directory}/${project.artifactId}.jar + ${project.parent.artifactId}-package.jar + / + + + diff --git a/search-data-service-app/src/main/docker/Dockerfile b/search-data-service-app/src/main/docker/Dockerfile index 1a70fd7..2d2abce 100644 --- a/search-data-service-app/src/main/docker/Dockerfile +++ b/search-data-service-app/src/main/docker/Dockerfile @@ -1,26 +1,14 @@ -FROM ubuntu:14.04 +FROM @aai.docker.namespace@/aai-common-@aai.base.image@:@aai.base.image.version@ ARG MICRO_HOME=/opt/app/search-data-service ARG BIN_HOME=$MICRO_HOME/bin -## Install and setup java8 -RUN apt-get update && apt-get install -y software-properties-common -## sudo -E is required to preserve the environment. If you remove that line, it will most like freeze at this step -RUN sudo -E add-apt-repository ppa:openjdk-r/ppa && apt-get update && apt-get install -y openjdk-8-jdk -## Setup JAVA_HOME, this is useful for docker commandline -ENV JAVA_HOME usr/lib/jvm/java-8-openjdk-amd64 -RUN export JAVA_HOME - # Build up the deployment folder structure -RUN mkdir -p $MICRO_HOME -RUN mkdir -p $MICRO_HOME/bundleconfig/etc -ADD *.jar $MICRO_HOME/ -RUN mkdir -p $BIN_HOME -COPY *.sh $BIN_HOME -COPY bundleconfig-local $MICRO_HOME/bundleconfig -COPY bundleconfig-local/etc/logback.xml $MICRO_HOME/bundleconfig/etc -RUN chmod 755 $BIN_HOME/* -RUN ln -s /logs $MICRO_HOME/logs +RUN mkdir -p $MICRO_HOME $USERS_HOME /logs +WORKDIR $MICRO_HOME +COPY /maven/@project.artifactId@/ . +RUN chmod 755 $BIN_HOME/* \ + && ln -snf /logs $MICRO_HOME/logs EXPOSE 9509 9509 -- 2.16.6