From abd3d52a1bd3026980035b3b0ebf1bde719f5656 Mon Sep 17 00:00:00 2001 From: Makhtar DIAGNE <makhtar.diagne@teamdlab.com> Date: Wed, 27 May 2020 20:03:00 +0200 Subject: [PATCH] [TECH] FIx ui frontend plugin & configuration --- pom.xml | 101 +++++++++++++++++++++++----------- ui/ui-commons/pom.xml | 3 - ui/ui-frontend-common/pom.xml | 37 ++----------- ui/ui-frontend/pom.xml | 4 -- ui/ui-identity/pom.xml | 63 +-------------------- ui/ui-portal/pom.xml | 60 +------------------- 6 files changed, 79 insertions(+), 189 deletions(-) diff --git a/pom.xml b/pom.xml index c887e195..765f6718 100644 --- a/pom.xml +++ b/pom.xml @@ -173,8 +173,6 @@ <angular.test.profile></angular.test.profile> <!-- we can specify the project name to build --> <!-- <angular.build.project></angular.build.project> --> - <!--we can choose between 'npm install' & 'npm ci'--> - <npm.install.arguments>install</npm.install.arguments> <rpm.jar-file>${project.build.finalName}.jar</rpm.jar-file> <!-- Put this properties to false sub-module when you want to use profile --> <rpm.skip>true</rpm.skip> @@ -183,9 +181,9 @@ <swagger.dir>.</swagger.dir> <swagger.skip>true</swagger.skip> <!--we can choose to build angular project and embedded it in our jar or not--> - <webpack.skip>true</webpack.skip> + <skipAllFrontend>true</skipAllFrontend> <!--we can choose to execute Karma tests or not--> - <webpack.test.skip>true</webpack.test.skip> + <skipAllFrontendTests>true</skipAllFrontendTests> <itCoverageAgent></itCoverageAgent> </properties> @@ -1085,10 +1083,63 @@ <artifactId>maven-project-info-reports-plugin</artifactId> <version>${maven.project.info.reports.plugin.version}</version> </plugin> + <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>${maven.frontend.plugin.version}</version> + <configuration> + <workingDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</workingDirectory> + <installDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</installDirectory> + <skip>${skipAllFrontend}</skip> + </configuration> + <executions> + <execution> + <id>install node and npm</id> + <goals> + <goal>install-node-and-npm</goal> + </goals> + <phase>initialize</phase> + <configuration> + <skip>${skipAllFrontend}</skip> + <nodeVersion>${node.version}</nodeVersion> + <npmVersion>${npm.version}</npmVersion> + </configuration> + </execution> + <execution> + <id>npm install</id> + <goals> + <goal>npm</goal> + </goals> + <phase>generate-sources</phase> + <configuration> + <skip>${skipAllFrontend}</skip> + <arguments>install --loglevel warn</arguments> + </configuration> + </execution> + <execution> + <id>npm run build</id> + <goals> + <goal>npm</goal> + </goals> + <phase>process-sources</phase> + <configuration> + <skip>${skipAllFrontend}</skip> + <arguments>run build${angular.build.profile} -- --project=${angular.build.project} --output-path=${project.basedir}/target/www --base-href=${angular.base.href} --deploy-url=${angular.base.href}</arguments> + </configuration> + </execution> + <execution> + <id>npm test</id> + <phase>test</phase> + <goals> + <goal>npm</goal> + </goals> + <configuration> + <skip>${skipAllFrontendTests}</skip> + <arguments>run test${angular.test.profile} -- --project=${angular.build.project} ${angular.additional.test.informations}</arguments> + </configuration> + </execution> + </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> @@ -1383,7 +1434,20 @@ </property> </activation> <properties> - <webpack.test.skip>true</webpack.test.skip> + <skipAllFrontendTests>true</skipAllFrontendTests> + </properties> + </profile> + + <!-- This profile is used to define skipTests value for Karma when -DskipAllFrontend is used during maven process. --> + <profile> + <id>skipAllFrontendTestsRun</id> + <activation> + <property> + <name>skipAllFrontend</name> + </property> + </activation> + <properties> + <skipAllFrontendTests>true</skipAllFrontendTests> </properties> </profile> @@ -1451,33 +1515,6 @@ </properties> </profile> - <!-- This profile is used to build frontend project in Jenkins. --> - <profile> - <id>webpack</id> - <properties> - <angular.build.profile></angular.build.profile> - <angular.test.profile>:conf-ci</angular.test.profile> - <!--<npm.install.arguments>ci</npm.install.arguments>--> - </properties> - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - </resource> - <resource> - <directory>target/www/</directory> - <targetPath>static/</targetPath> - </resource> - </resources> - <plugins> - <plugin> - <groupId>com.github.eirslett</groupId> - <artifactId>frontend-maven-plugin</artifactId> - </plugin> - </plugins> - </build> - </profile> - <!-- This profile is used to generate swagger documentation. --> <profile> <id>swagger</id> diff --git a/ui/ui-commons/pom.xml b/ui/ui-commons/pom.xml index 852ef468..11dc53fe 100644 --- a/ui/ui-commons/pom.xml +++ b/ui/ui-commons/pom.xml @@ -15,9 +15,6 @@ <properties> <sonar.sources>src/main/java</sonar.sources> - <!--<webpack.skip>false</webpack.skip>--> - <!--<webpack.test.skip>false</webpack.test.skip>--> - <!--<angular.build.project>commons</angular.build.project>--> </properties> <dependencies> diff --git a/ui/ui-frontend-common/pom.xml b/ui/ui-frontend-common/pom.xml index 8db3139b..0004b78c 100644 --- a/ui/ui-frontend-common/pom.xml +++ b/ui/ui-frontend-common/pom.xml @@ -15,8 +15,8 @@ </parent> <properties> - <skipTests>false</skipTests> <skipAllFrontend>false</skipAllFrontend> + <skipAllFrontendTests>false</skipAllFrontendTests> </properties> <build> @@ -24,35 +24,12 @@ <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> - <version>${maven.frontend.plugin.version}</version> <configuration> - <workingDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend-common</workingDirectory> - <installDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend-common</installDirectory> + <workingDirectory>.</workingDirectory> + <installDirectory>.</installDirectory> + <skip>${skipAllFrontend}</skip> </configuration> <executions> - <execution> - <id>install node and npm</id> - <goals> - <goal>install-node-and-npm</goal> - </goals> - <phase>initialize</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <nodeVersion>${node.version}</nodeVersion> - <npmVersion>${npm.version}</npmVersion> - </configuration> - </execution> - <execution> - <id>npm install</id> - <goals> - <goal>npm</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <arguments>install --loglevel warn</arguments> - </configuration> - </execution> <execution> <id>npm run build</id> <goals> @@ -82,7 +59,7 @@ <goal>npm</goal> </goals> <configuration> - <skip>${skipTests}</skip> + <skip>${skipAllFrontendTests}</skip> <arguments>run test:conf-ci</arguments> </configuration> </execution> @@ -108,10 +85,6 @@ <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.sonarsource.scanner.maven</groupId> - <artifactId>sonar-maven-plugin</artifactId> - </plugin> </plugins> </build> diff --git a/ui/ui-frontend/pom.xml b/ui/ui-frontend/pom.xml index b168a513..fb4b9df3 100644 --- a/ui/ui-frontend/pom.xml +++ b/ui/ui-frontend/pom.xml @@ -117,10 +117,6 @@ <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> </plugin> - <plugin> - <groupId>org.sonarsource.scanner.maven</groupId> - <artifactId>sonar-maven-plugin</artifactId> - </plugin> </plugins> </build> diff --git a/ui/ui-identity/pom.xml b/ui/ui-identity/pom.xml index 209a522b..50c944a2 100644 --- a/ui/ui-identity/pom.xml +++ b/ui/ui-identity/pom.xml @@ -17,12 +17,10 @@ <angular.build.project>identity</angular.build.project> <rpm.skip>false</rpm.skip> <sonar.sources>src/main/java</sonar.sources> + <skipAllFrontend>false</skipAllFrontend> + <skipAllFrontendTests>false</skipAllFrontendTests> <swagger.dir>ui</swagger.dir> <swagger.skip>false</swagger.skip> - <webpack.skip>false</webpack.skip> - <webpack.test.skip>false</webpack.test.skip> - <skipTests>false</skipTests> - <skipAllFrontend>false</skipAllFrontend> </properties> <dependencies> @@ -194,63 +192,6 @@ </arguments> </configuration> </plugin> - <plugin> - <groupId>com.github.eirslett</groupId> - <artifactId>frontend-maven-plugin</artifactId> - <version>${maven.frontend.plugin.version}</version> - <configuration> - <workingDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</workingDirectory> - <installDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</installDirectory> - </configuration> - <executions> - <execution> - <id>install node and npm</id> - <goals> - <goal>install-node-and-npm</goal> - </goals> - <phase>initialize</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <nodeVersion>${node.version}</nodeVersion> - <npmVersion>${npm.version}</npmVersion> - </configuration> - </execution> - <execution> - <id>npm install</id> - <goals> - <goal>npm</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <arguments>install --loglevel warn</arguments> - </configuration> - </execution> - <execution> - <id>npm run build</id> - <goals> - <goal>npm</goal> - </goals> - <phase>process-sources</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <arguments>run build -- --project=identity --output-path=${project.basedir}/target/www --base-href=${angular.base.href} --deploy-url=${angular.base.href}</arguments> - </configuration> - </execution> - <execution> - <id>npm test</id> - <phase>test</phase> - <goals> - <goal>npm</goal> - </goals> - <configuration> - <skip>${skipTests}</skip> - <arguments>run test:conf-ci</arguments> - </configuration> - </execution> - </executions> - </plugin> - </plugins> </build> diff --git a/ui/ui-portal/pom.xml b/ui/ui-portal/pom.xml index 5d46439a..de4c6ed7 100644 --- a/ui/ui-portal/pom.xml +++ b/ui/ui-portal/pom.xml @@ -13,15 +13,13 @@ </parent> <properties> + <angular.build.project>portal</angular.build.project> <rpm.skip>false</rpm.skip> + <skipAllFrontend>false</skipAllFrontend> + <skipAllFrontendTests>false</skipAllFrontendTests> <sonar.sources>src/main/java</sonar.sources> <swagger.dir>ui</swagger.dir> <swagger.skip>false</swagger.skip> - <webpack.skip>false</webpack.skip> - <webpack.test.skip>false</webpack.test.skip> - <angular.build.project>portal</angular.build.project> - <skipTests>false</skipTests> - <skipAllFrontend>false</skipAllFrontend> </properties> <dependencies> @@ -185,58 +183,6 @@ <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> - <version>${maven.frontend.plugin.version}</version> - <configuration> - <workingDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</workingDirectory> - <installDirectory>${maven.multiModuleProjectDirectory}/ui/ui-frontend</installDirectory> - </configuration> - <executions> - <execution> - <id>install node and npm</id> - <goals> - <goal>install-node-and-npm</goal> - </goals> - <phase>initialize</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <nodeVersion>${node.version}</nodeVersion> - <npmVersion>${npm.version}</npmVersion> - </configuration> - </execution> - <execution> - <id>npm install</id> - <goals> - <goal>npm</goal> - </goals> - <phase>generate-sources</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <arguments>install --loglevel warn</arguments> - </configuration> - </execution> - <execution> - <id>npm run build</id> - <goals> - <goal>npm</goal> - </goals> - <phase>process-sources</phase> - <configuration> - <skip>${skipAllFrontend}</skip> - <arguments>run build -- --project=portal --output-path=${project.basedir}/target/www --base-href=${angular.base.href} --deploy-url=${angular.base.href}</arguments> - </configuration> - </execution> - <execution> - <id>npm test</id> - <phase>test</phase> - <goals> - <goal>npm</goal> - </goals> - <configuration> - <skip>${skipTests}</skip> - <arguments>run test:conf-ci</arguments> - </configuration> - </execution> - </executions> </plugin> </plugins> </build> -- GitLab