- <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
- <plugins>
- <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
- <plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <version>3.1.0</version>
- </plugin>
- <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>3.0.2</version>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>2.22.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.0.2</version>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
- <mainClass>org.onap.dcae.genprocessor.App</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-install-plugin</artifactId>
- <version>2.5.2</version>
- </plugin>
- <plugin>
- <artifactId>maven-deploy-plugin</artifactId>
- <version>2.8.2</version>
- </plugin>
- <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
- <plugin>
- <artifactId>maven-site-plugin</artifactId>
- <version>3.7.1</version>
- </plugin>
- <plugin>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>3.0.0</version>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <descriptorRefs>
- <descriptorRef>jar-with-dependencies</descriptorRef>
- </descriptorRefs>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib/</classpathPrefix>
- <mainClass>org.onap.dcae.genprocessor.App</mainClass>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- <!-- THIS DOES NOT RUN-->
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <outputDirectory>${project.build.directory}/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>io.fabric8</groupId>
+ <artifactId>docker-maven-plugin</artifactId>
+ <version>${docker.fabric.version}</version>
+ <configuration>
+ <verbose>true</verbose>
+ <pullRegistry>${docker.pull.registry}</pullRegistry>
+ <pushRegistry>${docker.push.registry}</pushRegistry>
+ <images>
+ <image>
+ <name>onap/${project.groupId}.${project.artifactId}-http</name>
+ <registry>${onap.nexus.dockerregistry.daily}</registry>
+ <build>
+ <from>nginx:latest</from>
+ <tags>
+ <tag>latest</tag>
+ <tag>${project.version}</tag>
+ <tag>${project.version}-${maven.build.timestamp}Z</tag>
+ </tags>
+ <assembly>
+ <targetDir>/</targetDir>
+ <inline>
+ <files>
+ <file>
+ <source>./nginx.conf</source>
+ <outputDirectory>/etc/nginx/conf.d</outputDirectory>
+ <destName>default.conf</destName>
+ </file>
+ </files>
+ </inline>
+ </assembly>
+ <runCmds>
+ <runCmd>sed -i /etc/nginx/nginx.conf -e '/^user /d' && touch /var/run/nginx.pid && mkdir -p /www/data && chown -R nginx:nginx /www /etc/nginx /var/cache/nginx /var/log/nginx /var/run/nginx.pid</runCmd>
+ </runCmds>
+ <user>nginx</user>
+ <entryPoint>
+ <exec>
+ <arg>nginx</arg>
+ <arg>-g</arg>
+ <arg>daemon off;</arg>
+ </exec>
+ </entryPoint>
+ </build>
+ </image>
+ <image>
+ <name>onap/${project.groupId}.${project.artifactId}-job</name>
+ <registry>${onap.nexus.dockerregistry.daily}</registry>
+ <build>
+ <from>openjdk:8</from>
+ <tags>
+ <tag>latest</tag>
+ <tag>${project.version}</tag>
+ <tag>${project.version}-${maven.build.timestamp}Z</tag>
+ </tags>
+ <assembly>
+ <descriptorRef>artifact-with-dependencies</descriptorRef>
+ </assembly>
+ <runCmds>
+ <runCmd>groupadd -g 1000 dcaemod && useradd --shell /bin/bash -u 1000 -g 1000 -m dcaemod</runCmd>
+ </runCmds>
+ <workdir>/maven</workdir>
+ <env>
+ <GENPROC_WORKING_DIR>/work</GENPROC_WORKING_DIR>
+ <GENPROC_ONBOARDING_API_HOST>http://onboarding-api:8080/onboarding</GENPROC_ONBOARDING_API_HOST>
+ <GENPROC_SLEEP_SEC>10</GENPROC_SLEEP_SEC>
+ </env>
+ <user>dcaemod</user>
+ <entryPoint>
+ <exec>
+ <arg>java</arg>
+ <arg>-cp</arg>
+ <arg>/maven/*</arg>
+ <arg>${start-class}</arg>
+ </exec>
+ </entryPoint>
+ </build>
+ </image>
+ </images>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>build</goal>
+ <goal>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>