Changes for populating ReactJS component library
[clamp.git] / pom.xml
diff --git a/pom.xml b/pom.xml
index a7498ed..bb22596 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -39,7 +39,7 @@
        <description>
               This is the MAVEN project that builds everything for ONAP CLAMP.
               Docker engine is normally requires to perfom all possible tasks (including integration tests)
-              
+
            It can build:
            - The ONAP CLAMP JAR that contains CLAMP back-end code.
            - The DOCKER images for:
@@ -53,7 +53,7 @@
             - The CLAMP backend, JAVA unit testing
             - The CLAMP backend, JAVA integration tests (with Spring + docker mariadb database + docker policy/dcae emulator written in python)
             - The CLAMP frontend, Javascrip tests (NodeJS(NPM) + JEST + Enzyme fro React)
-           
+
            The test coverage for dev's can be found after a "clean install" build in:
             - Clamp backend: target/jacoco-dev.exec (unit tests + integration tests merged)
                 or separately target/coverage-reports/jacoco.exec and target/coverage-reports/jacoco-it.exec
                <python.http.proxy.param />
                <tomcat.version>9.0.27</tomcat.version>
                <ui.react.src>ui-react</ui.react.src>
+               <ui.react.lib.src>ui-react-lib</ui.react.lib.src>
                <npm.publish.url>https://nexus3.onap.org/repository/npm.release/</npm.publish.url>
        </properties>
 
                        </testResource>
                </testResources>
                <resources>
-                       <!-- For AAF folder maven should not try to filter Keystores/Truststores ... Otherwise 
+                       <!-- For AAF folder maven should not try to filter Keystores/Truststores ... Otherwise
                                they will be broken and unreadable -->
                        <resource>
                                <directory>src/main/resources</directory>
                        </resource>
                        <resource>
                                <directory>${ui.react.src}</directory>
+                               <excludes>
+                                       <exclude>node_modules</exclude>
+                               </excludes>
                                <includes>
                                        <include>src/**</include>
                                        <include>public/**</include>
                                <filtering>true</filtering>
                                <targetPath>${project.build.directory}/${ui.react.src}</targetPath>
                        </resource>
+                       <resource>
+                               <directory>${ui.react.src}</directory>
+                               <includes>
+                                       <include>src/**</include>
+                               </includes>
+                               <excludes>
+                                       <exclude>**/__snapshots__/**</exclude>
+                                       <exclude>**/**.test.js</exclude>
+                               </excludes>
+                               <filtering>true</filtering>
+                               <targetPath>${project.build.directory}/${ui.react.lib.src}</targetPath>
+                       </resource>
+                       <resource>
+                               <directory>${ui.react.lib.src}</directory>
+                               <includes>
+                                       <include>**</include>
+                               </includes>
+                               <excludes>
+                                       <exclude>node_modules/**</exclude>
+                                       <exclude>package-lock.json</exclude>
+                               </excludes>
+                               <filtering>true</filtering>
+                               <targetPath>${project.build.directory}/${ui.react.lib.src}</targetPath>
+                       </resource>
                </resources>
 
                <plugins>
                                </executions>
 
                        </plugin>
-                       <!-- Read the swagger.json file and the definition from SwaggerConfig.java; generate 
+                       <!-- Read the swagger.json file and the definition from SwaggerConfig.java; generate
                                a list of .adoc files containing the APIs info in more structured way -->
                        <plugin>
                                <groupId>io.github.swagger2markup</groupId>
                                </executions>
                        </plugin>
 
-                       <!-- Run the generated asciidoc through Asciidoctor to generate other documentation 
+                       <!-- Run the generated asciidoc through Asciidoctor to generate other documentation
                                types, such as PDFs or HTML5 -->
                        <plugin>
                                <groupId>org.asciidoctor</groupId>
                                                                        <tag>${project.docker.latesttagtimestamp.version}</tag>
                                                                        <tag>${project.docker.latesttag.version}</tag>
                                                                </tags>
-                                                               <!-- A relative path is looked up in ${project.basedir}/src/main/docker by 
+                                                               <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
                                                                        default -->
                                                                <dockerFile>backend/Dockerfile</dockerFile>
                                                                <assembly>
                                                                        <tag>${project.docker.latesttagtimestamp.version}</tag>
                                                                        <tag>${project.docker.latesttag.version}</tag>
                                                                </tags>
-                                                               <!-- A relative path is looked up in ${project.basedir}/src/main/docker by 
+                                                               <!-- A relative path is looked up in ${project.basedir}/src/main/docker by
                                                                        default -->
                                                                <dockerFile>frontend/Dockerfile</dockerFile>
                                                                <assembly>
                                <version>1.8.0</version>
                                <configuration>
                                        <installDirectory>${project.build.directory}/${ui.react.src}</installDirectory>
-                                       <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
                                </configuration>
                                <executions>
                                        <execution>
                                                </goals>
                                                <phase>generate-sources</phase>
                                                <configuration>
-                                               <nodeVersion>v12.13.0</nodeVersion>
-                                               <npmVersion>6.13.0</npmVersion>
+                                                       <nodeVersion>v12.13.0</nodeVersion>
+                                                       <npmVersion>6.13.0</npmVersion>
                                                </configuration>
                                        </execution>
                                        <execution>
                                                </goals>
                                                <phase>compile</phase>
                                                <configuration>
+                                                       <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
                                                        <arguments>install</arguments>
                                                </configuration>
                                        </execution>
                                                <phase>test</phase>
                                                <configuration>
                                                        <arguments>run-script test:coverage</arguments>
+                                                       <workingDirectory>${project.build.directory}/${ui.react.src}</workingDirectory>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>npm_install_lib</id>
+                                               <goals>
+                                                       <goal>npm</goal>
+                                               </goals>
+                                               <phase>deploy</phase>
+                                               <configuration>
+                                                       <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
+                                                       <arguments>install</arguments>
+                                               </configuration>
+                                       </execution>
+                                       <execution>
+                                               <id>npm_build_lib</id>
+                                               <goals>
+                                                       <goal>npm</goal>
+                                               </goals>
+                                               <phase>deploy</phase>
+                                               <configuration>
+                                                       <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
+                                                       <arguments>run build</arguments>
                                                </configuration>
                                        </execution>
                                        <execution>
                                                </goals>
                                                <phase>deploy</phase>
                                                <configuration>
+                                                       <workingDirectory>${project.build.directory}/${ui.react.lib.src}</workingDirectory>
                                                        <arguments>publish</arguments>
                                                </configuration>
                                        </execution>