Skip to content
Snippets Groups Projects
pom.xml 67.2 KiB
Newer Older
vitam-prg's avatar
vitam-prg committed
                    <groupId>org.apache.maven.plugins</groupId>
                    <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>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                </plugin>
                <plugin>
                    <!-- The Surefire Report Plugin parses the generated TEST-*.xml files
                         under ${basedir}/target/surefire-reports and renders them to DOXIA which
                        creates the web interface version of the test results. -->
                    <artifactId>maven-surefire-report-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.failsafe.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>${maven.antrun.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring.boot.version}</version>
                    <configuration>
                        <addResources>false</addResources>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <failOnMissingWebXml>false</failOnMissingWebXml>
                    </configuration>
                    <version>${maven.war.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok-maven-plugin</artifactId>
                    <version>${maven.lombok.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>delombok</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${maven.sonar.plugin.version}</version>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>sonar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${maven.jacoco.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>pre-integration-test</id>
                            <goals>
                                <goal>prepare-agent-integration</goal>
                            </goals>
                            <configuration>
                                <propertyName>itCoverageAgent</propertyName>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>${maven.exec.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>net.serenity-bdd.maven.plugins</groupId>
                    <artifactId>serenity-maven-plugin</artifactId>
                    <version>${serenity.maven.plugin}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jaxb2-maven-plugin</artifactId>
                    <version>${maven.jaxb2.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <!-- select non-aggregate reports -->
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>

        <!-- This profile is used to build frontend project for dev purposes. -->
        <profile>
            <id>dev</id>
            <properties>
                <angular.build.profile>:dev</angular.build.profile>
                <angular.test.profile>:conf-ci</angular.test.profile>
            </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 build frontend project for prod purposes. -->
        <profile>
            <id>prod</id>
            <properties>
                <angular.build.profile>:prod</angular.build.profile>
                <angular.test.profile>:conf-ci</angular.test.profile>
        		<rpm.publication.env>stable</rpm.publication.env>
            </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 build & test & push npm packages to repo. -->
 		<profile>
            <id>npm-publish</id>
            <properties>
                <angular.build.profile></angular.build.profile>
                <angular.test.profile>:conf-ci</angular.test.profile>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
			            <executions>
			                <execution>
			                    <id>npm publish</id>
			                    <phase>install</phase>
			                    <goals>
			                        <goal>npm</goal>
			                    </goals>
			                    <configuration>
			                        <arguments>run publish --loglevel warn</arguments>
			                    </configuration>
			                </execution>
			            </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- This profile is used to build rpm package.-->
        <profile>
            <id>rpm</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>rpm-package</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <executable>make</executable>
                                    <workingDirectory>target</workingDirectory>
                                    <skip>${rpm.skip}</skip>
                                    <arguments>
                                        <argument>-f</argument>
                                        <argument>${maven.multiModuleProjectDirectory}/tools/packaging/Makefile</argument>
                                        <argument>rpm</argument>
                                        <argument>NAME=${project.artifactId}</argument>
                                        <argument>VERSION=${project.version}</argument>
                                        <argument>JAR_FILE=${rpm.jar-file}</argument>
                                        <argument>USER=vitamui</argument>
                                        <!-- If you want to changes default dependencies (only systemd),
                                        define them as a comma separated list of packages -->
                                        <argument>DEPENDENCIES=systemd,java-1.8.0-openjdk</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- This profile is used to build rpm package.-->
        <profile>
            <id>rpm-publish</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>rpm-publish</id>
                                <phase>deploy</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <skip>${rpm.skip}</skip>
                                    <executable>${maven.multiModuleProjectDirectory}/tools/packaging/publish.sh</executable>
                                    <workingDirectory>target</workingDirectory>
                                    <arguments>
                                        <argument>${env.SERVICE_RPM_REPOSITORY_URL}/upload/${rpm.publication.env}/Packages</argument>
vitam-prg's avatar
vitam-prg committed
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- This profile is used to define skipTests value for Karma when -DskipTests is used during maven process. -->
        <profile>
            <id>skipTestsRun</id>
            <activation>
                <property>
                    <name>skipTests</name>
                </property>
            </activation>
            <properties>
                <webpack.test.skip>true</webpack.test.skip>
            </properties>
        </profile>

        <!-- This profile is used to update sonar informations.-->
        <profile>
            <id>sonar</id>
            <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-site-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <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>
            <properties>
                <angular.build.profile></angular.build.profile>
                <angular.test.profile>:sonar</angular.test.profile>
                <!-- Set project configuration file for test coverage -->
                <angular.additional.test.informations>--karma-config=${maven.multiModuleProjectDirectory}/ui/ui-frontend/projects/${angular.build.project}/karma.conf.ci.js</angular.additional.test.informations>
                <maven.test.failure.ignore>true</maven.test.failure.ignore>
                <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
                <sonar.coverage.exclusions>**/*Dto.java, **/domain/*.java, **/vitam/seda/*.java, **/*spec.ts, **/*.scss, **/*.css</sonar.coverage.exclusions>
                <sonar.cpd.exclusions>**/*Dto.java, **/domain/*.java, **/*spec.ts</sonar.cpd.exclusions>
                <sonar.exclusions>**/node_modules/**, **/sass/**</sonar.exclusions>
                <!-- TODO: This properties need to bo specify by the user who execute
                the report (ex: Jenkins or developper) -->
                <sonar.host.url />
                <!-- TODO: This properties need to bo specify by the user who execute
                the report (ex: Jenkins or developper) -->
                <sonar.login />
                <sonar.typescript.lcov.reportPaths>${maven.multiModuleProjectDirectory}/ui/ui-frontend/target/coverage/archive/lcov.info,${maven.multiModuleProjectDirectory}/ui/ui-frontend/target/coverage/commons/lcov.info,${maven.multiModuleProjectDirectory}/ui/ui-frontend/target/coverage/flow/lcov.info,${maven.multiModuleProjectDirectory}/ui/ui-frontend/target/coverage/identity/lcov.info,${maven.multiModuleProjectDirectory}/ui/ui-frontend/target/coverage/portal/lcov.info</sonar.typescript.lcov.reportPaths>
            </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>
            <build>
                <plugins>
                	<plugin>
	                    <groupId>org.apache.maven.plugins</groupId>
	                    <artifactId>maven-surefire-plugin</artifactId>
	                    <configuration>
	                        <test>SwaggerJsonFileGenerationTest.java</test>
	                    </configuration>
	                </plugin>
                </plugins>
            </build>
        </profile>

        <!-- This profile is used to generate swagger documentation. -->
        <profile>
            <id>swagger-docs</id>
            <build>
                <plugins>

					<plugin>
						<groupId>io.github.swagger2markup</groupId>
						<artifactId>swagger2markup-maven-plugin</artifactId>
						<version>${maven.swagger2markup.plugin.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>io.github.swagger2markup</groupId>
                                <artifactId>swagger2markup-import-files-ext</artifactId>
                                <version>${maven.swagger2markup.plugin.version}</version>
                            </dependency>
                            <dependency>
                                <groupId>io.github.swagger2markup</groupId>
                                <artifactId>swagger2markup-spring-restdocs-ext</artifactId>
                                <version>${maven.swagger2markup.plugin.version}</version>
                            </dependency>
                        </dependencies>
						<configuration>
							<swaggerInput>${maven.multiModuleProjectDirectory}/tools/swagger/docs/${swagger.dir}/${project.artifactId}/swagger.json</swaggerInput>
							<outputDir>${project.build.directory}/generated-sources/swagger/</outputDir>
							<config>
								<swagger2markup.markupLanguage>ASCIIDOC</swagger2markup.markupLanguage>
								<swagger2markup.outputLanguage>FR</swagger2markup.outputLanguage>
								<swagger2markup.generatedExamplesEnabled>TRUE</swagger2markup.generatedExamplesEnabled>
								<swagger2markup.pathsGroupedBy>TAGS</swagger2markup.pathsGroupedBy>
							</config>
                            <skip>${swagger.skip}</skip>
						</configuration>
						<executions>
							<execution>
								<phase>generate-resources</phase>
								<goals>
									<goal>convertSwagger2markup</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.asciidoctor</groupId>
						<artifactId>asciidoctor-maven-plugin</artifactId>
						<version>${maven.asciidoctor.plugin.version}</version>
						<dependencies>
                            <dependency>
                                <groupId>org.asciidoctor</groupId>
                                <artifactId>asciidoctorj-pdf</artifactId>
                                <version>${asciidoctorj.pdf.version}</version>
                            </dependency>
							<dependency>
								<groupId>org.jruby</groupId>
								<artifactId>jruby-complete</artifactId>
								<version>${jruby.complete.version}</version>
							</dependency>
						</dependencies>
						<configuration>
							<sourceDirectory>${maven.multiModuleProjectDirectory}/tools/swagger/config/</sourceDirectory>
							<sourceDocumentName>index.adoc</sourceDocumentName>
							<backend>html5</backend>
							<outputDirectory>${maven.multiModuleProjectDirectory}/tools/swagger/docs/${swagger.dir}/${project.artifactId}</outputDirectory>
							<attributes>
								<toc>left</toc>
								<toclevels>3</toclevels>
                                <numbered></numbered>
                                <hardbreaks></hardbreaks>
                                <sectlinks></sectlinks>
                                <sectanchors></sectanchors>
								<generated>${project.build.directory}/generated-sources/swagger/</generated>
							</attributes>
                            <skip>${swagger.skip}</skip>
						</configuration>
						<executions>
							<execution>
								<id>output-html</id>
								<phase>generate-resources</phase>
								<goals>
									<goal>process-asciidoc</goal>
								</goals>
							</execution>
                            <execution>
                                <id>output-pdf</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                                <configuration>
                                    <backend>pdf</backend>
                                    <outputDirectory>${maven.multiModuleProjectDirectory}/tools/swagger/docs/${swagger.dir}/${project.artifactId}</outputDirectory>
                                </configuration>
                            </execution>
						</executions>
					</plugin>
                </plugins>
            </build>
	       	<!-- Repositories used for swagger doc generation  -->
            <pluginRepositories>
		        <pluginRepository>
					<id>jcenter-snapshots</id>
					<name>jcenter</name>
					<url>http://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
		        </pluginRepository>
		        <pluginRepository>
		            <snapshots>
		                <enabled>false</enabled>
		            </snapshots>
		            <id>jcenter-releases</id>
		            <name>jcenter</name>
		            <url>http://jcenter.bintray.com</url>
		        </pluginRepository>
            </pluginRepositories>
        </profile>

        <profile>
            <!-- Profile to use for all Vitam internal developers -->
            <id>vitam</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <!-- Dépôts Maven privés -->
            <distributionManagement>
                <repository>
                    <id>releases</id>
                    <url>${env.SERVICE_NEXUS_URL}/repository/maven-releases/</url>
                </repository>
                <snapshotRepository>
                    <id>snapshots</id>
                    <url>${env.SERVICE_NEXUS_URL}/repository/maven-snapshots/</url>
                </snapshotRepository>
            </distributionManagement>


            <repositories>
                <repository>
                    <id>vitam</id>
                    <url>${env.SERVICE_NEXUS_URL}/repository/maven-public/</url>
                </repository>
            </repositories>

            <!-- Maven plugins repositories -->
            <pluginRepositories>
                <pluginRepository>
                    <id>vitam</id>
                    <url>${env.SERVICE_NEXUS_URL}/repository/maven-public/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>

            <properties>
                <serverId>vitam</serverId>
                <downloadRoot>${env.SERVICE_NEXUS_URL}/repository/node-distrib/</downloadRoot>
            </properties>

        </profile>

    </profiles>

</project>