Skip to content
Snippets Groups Projects
pom.xml 89.7 KiB
Newer Older
            </dependency>
            <dependency>
                <groupId>com.mikesamuel</groupId>
                <artifactId>json-sanitizer</artifactId>
                <version>${json-sanitize.version}</version>
            </dependency>
vitam-prg's avatar
vitam-prg committed
            <!-- Test -->
            <dependency>
                <groupId>fr.gouv.vitamui.commons</groupId>
                <artifactId>commons-test</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>${spring.boot.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${junit.jupiter.platform.version}</version>
                <scope>test</scope>
            </dependency>
Zerouali's avatar
Zerouali committed
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit.vintage.engine.version}</version>
                <scope>test</scope>
            </dependency>

vitam-prg's avatar
vitam-prg committed

            <dependency>
                <groupId>org.easymock</groupId>
                <artifactId>easymock</artifactId>
                <version>${easymock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-easymock</artifactId>
                <version>${powermock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.version}</version>
            </dependency>
            <dependency>
benemart's avatar
benemart committed
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito2</artifactId>
                <version>${powermock.version}</version>
            </dependency>
vitam-prg's avatar
vitam-prg committed
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>${jsonassert.version}</version>
                <scope>test</scope>
            </dependency>
benemart's avatar
benemart committed
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
            <dependency>
                <groupId>org.apache.pdfbox</groupId>
                <artifactId>pdfbox</artifactId>
                <version>${apache.pdfbox.version}</version>
                <scope>test</scope>
            </dependency>
vitam-prg's avatar
vitam-prg committed

            <!-- CUCUMBER SERENITY -->
            <dependency>
                <groupId>net.serenity-bdd</groupId>
                <artifactId>serenity-core</artifactId>
                <version>${serenity.version}</version>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                <scope>test</scope>
vitam-prg's avatar
vitam-prg committed
            </dependency>
            <dependency>
                <groupId>net.serenity-bdd</groupId>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                <artifactId>serenity-junit</artifactId>
                <version>${serenity.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.serenity-bdd</groupId>
                <artifactId>serenity-screenplay</artifactId>
                <version>${serenity.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.serenity-bdd</groupId>
                <artifactId>serenity-screenplay-webdriver</artifactId>
                <version>${serenity.version}</version>
vitam-prg's avatar
vitam-prg committed
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.serenity-bdd</groupId>
                <artifactId>serenity-spring</artifactId>
                <version>${serenity.spring.version}</version>
                <scope>test</scope>
            </dependency>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
            <dependency>
                <groupId>net.serenity-bdd</groupId>
                <artifactId>serenity-cucumber5</artifactId>
                <version>${serenity.cucumber.version}</version>
                <scope>test</scope>
            </dependency>

benemart's avatar
benemart committed
            <dependency>
                <groupId>com.github.stefanbirkner</groupId>
                <artifactId>fake-sftp-server-rule</artifactId>
                <version>${fake.sftp.server.rule.version}</version>
                <scope>test</scope>
            </dependency>
vitam-prg's avatar
vitam-prg committed

            <!-- XDocReport convert ODT to PDF -->
            <dependency>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
                <version>${xerces.version}</version>
            </dependency>

            <dependency>
                <groupId>fr.opensagres.xdocreport</groupId>
                <artifactId>fr.opensagres.odfdom.converter.core</artifactId>
                <version>${xdocreport.version}</version>
            </dependency>
            <dependency>
                <groupId>fr.opensagres.xdocreport</groupId>
                <artifactId>fr.opensagres.xdocreport.converter.odt.odfdom</artifactId>
                <version>${xdocreport.version}</version>
            </dependency>
            <dependency>
                <groupId>fr.opensagres.xdocreport</groupId>
                <artifactId>fr.opensagres.xdocreport.document.odt</artifactId>
                <version>${xdocreport.version}</version>
            </dependency>
            <dependency>
                <groupId>fr.opensagres.xdocreport</groupId>
                <artifactId>fr.opensagres.xdocreport.template.freemarker</artifactId>
                <version>${xdocreport.version}</version>
            </dependency>
            <dependency>
                <groupId>fr.opensagres.xdocreport</groupId>
                <artifactId>fr.opensagres.xdocreport.template.velocity</artifactId>
                <version>${xdocreport.version}</version>
            </dependency>

            <dependency>
                <groupId>com.opencsv</groupId>
                <artifactId>opencsv</artifactId>
                <version>${opencsv.version}</version>
            </dependency>

vitam-prg's avatar
vitam-prg committed
        </dependencies>
    </dependencyManagement>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
                <filtering>true</filtering>
                <excludes>
                    <exclude>*.cer</exclude>
                    <exclude>*.jks</exclude>
                </excludes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <!-- Security check for dependencies -->
                <groupId>org.owasp</groupId>
                <artifactId>dependency-check-maven</artifactId>
                <version>${maven.dependencycheck.version}</version>
                <inherited>false</inherited>
                <configuration>
                    <cveUrlModified>${env.SERVICE_REPOSITORY_URL}/nist/nvdcve-1.1-modified.json.gz</cveUrlModified>
                    <cveUrlBase>${env.SERVICE_REPOSITORY_URL}/nist/nvdcve-1.1-%d.json.gz</cveUrlBase>
vitam-prg's avatar
vitam-prg committed
                    <assemblyAnalyzerEnabled>false</assemblyAnalyzerEnabled>
                    <retireJsAnalyzerEnabled>false</retireJsAnalyzerEnabled>
                    <failOnError>false</failOnError>
                </configuration>

                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <inherited>false</inherited>
                <configuration>
                    <header>LICENSE.txt</header>
                    <properties>
                        <owner>VITAM UI</owner>
                        <email>contact@programmevitam.fr</email>
                    </properties>
                    <includes>
                        <include>**/src/main/java/**</include>
                        <include>**/*.ts</include>
                    </includes>
                    <excludes>
                        <exclude>**/org/apereo/cas/**</exclude>
                        <exclude>**/node_modules/**</exclude>
                        <exclude>**/target/**</exclude>
                        <exclude>**/dist/**</exclude>
                        <exclude>**/cas-server/src/main/resources/**</exclude>
                    </excludes>
                    <mapping>
                        <ts>SLASHSTAR_STYLE</ts>
                    </mapping>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven.resources.plugin.version}</version>
                <configuration>
                    <nonFilteredFileExtensions>
                        <nonFilteredFileExtension>jks</nonFilteredFileExtension>
                        <nonFilteredFileExtension>p12</nonFilteredFileExtension>
                        <nonFilteredFileExtension>pem</nonFilteredFileExtension>
                    </nonFilteredFileExtensions>
                </configuration>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.shared</groupId>
                        <artifactId>maven-filtering</artifactId>
                        <version>${maven.filtering.plugin.version}</version>
                    </dependency>
                </dependencies>
vitam-prg's avatar
vitam-prg committed
            </plugin>
            <!-- Directory plugin to find parent root directory absolute path -->
            <plugin>
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>${maven.directory.plugin.version}</version>
                <executions>
                    <execution>
                        <id>directories</id>
                        <goals>
                            <goal>highest-basedir</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>main.basedir</property>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
vitam-prg's avatar
vitam-prg committed
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven.compiler.plugin.version}</version>
                    <configuration>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
vitam-prg's avatar
vitam-prg committed
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                </plugin>
                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>${maven.deploy.plugin.version}</version>
                </plugin>
                <!-- find bugs in current project -->
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>${maven.spotbugs.plugin.version}</version>
vitam-prg's avatar
vitam-prg committed
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>${maven.pmd.plugin.version}</version>
                    <configuration>
                        <rulesets>
                            <ruleset>${main.basedir}/pmd-rulesets.xml</ruleset>
vitam-prg's avatar
vitam-prg committed
                        </rulesets>
                        <failOnViolation>false</failOnViolation>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven.jar.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven.site.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven.project.info.reports.plugin.version}</version>
                </plugin>
vitam-prg's avatar
vitam-prg committed
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>${maven.frontend.plugin.version}</version>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                    <configuration>
                        <workingDirectory>${main.basedir}/ui/ui-frontend</workingDirectory>
                        <installDirectory>${main.basedir}/ui/ui-frontend</installDirectory>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                        <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>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                            </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>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                            </configuration>
                        </execution>
                    </executions>
vitam-prg's avatar
vitam-prg committed
                </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>
                        <additionalProperties>
                            <version.release>${project.version}</version.release>
                        </additionalProperties>
vitam-prg's avatar
vitam-prg committed
                    </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>
vitam-prg's avatar
vitam-prg committed
                            <goals>
vitam-prg's avatar
vitam-prg committed
                            </goals>
                        </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-site-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
            </plugin>
vitam-prg's avatar
vitam-prg committed
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <rulesets>
                        <ruleset>${maven.multiModuleProjectDirectory}/pmd-rulesets.xml</ruleset>
                    </rulesets>
                </configuration>
vitam-prg's avatar
vitam-prg committed
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
vitam-prg's avatar
vitam-prg committed
            </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>
benemart's avatar
benemart committed
                <rpm.publication.env>stable</rpm.publication.env>
vitam-prg's avatar
vitam-prg committed
            </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>

benemart's avatar
benemart committed
        <!-- This profile is used to build & test & push npm packages to repo. -->
        <profile>
vitam-prg's avatar
vitam-prg committed
            <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>
benemart's avatar
benemart committed
                        <executions>
                            <execution>
                                <id>npm publish</id>
                                <phase>install</phase>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <configuration>
                                    <arguments>run publish --loglevel warn</arguments>
                                </configuration>
                            </execution>
                        </executions>
vitam-prg's avatar
vitam-prg committed
                    </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>${main.basedir}/tools/packaging/Makefile</argument>
vitam-prg's avatar
vitam-prg committed
                                        <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 -->
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                                        <argument>DEPENDENCIES=systemd,java-11-openjdk</argument>
vitam-prg's avatar
vitam-prg committed
                                    </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>${main.basedir}/tools/packaging/publish.sh</executable>
vitam-prg's avatar
vitam-prg committed
                                    <workingDirectory>target</workingDirectory>
                                    <arguments>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                                        <argument>${rpm.publication.env}</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>
Makhtar DIAGNE's avatar
Makhtar DIAGNE committed
                <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>
vitam-prg's avatar
vitam-prg committed
            </properties>
        </profile>

        <!-- This profile is used to generate sonar-metrics sonar informations.-->
vitam-prg's avatar
vitam-prg committed
        <profile>
vitam-prg's avatar
vitam-prg committed
            <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-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>@{argLine}</argLine>
                        </configuration>
vitam-prg's avatar
vitam-prg committed
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <version>${maven.spotbugs.plugin.version}</version>
                        <configuration>
                            <failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
vitam-prg's avatar
vitam-prg committed
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <configuration>
                            <rulesets>
                                <ruleset>${main.basedir}/pmd-rulesets.xml</ruleset>
                            </rulesets>
                        </configuration>
                        <executions>
                            <execution>
                                <id>check</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
vitam-prg's avatar
vitam-prg committed
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-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 -->
benemart's avatar
benemart committed
                <angular.additional.test.informations>
                    --karma-config=${main.basedir}/ui/ui-frontend/projects/${angular.build.project}/karma.conf.ci.js
benemart's avatar
benemart committed
                </angular.additional.test.informations>
vitam-prg's avatar
vitam-prg committed
                <maven.test.failure.ignore>true</maven.test.failure.ignore>
            </properties>
        </profile>
        <!-- This profile is used to update sonar informations.-->
        <profile>
            <id>sonar</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonarsource.scanner.maven</groupId>
                        <artifactId>sonar-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <properties>
vitam-prg's avatar
vitam-prg committed
                <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
benemart's avatar
benemart committed
                <sonar.coverage.exclusions>**/*Dto.java, **/domain/*.java, **/vitam/seda/*.java, **/*spec.ts, **/*.scss,
                    **/*.css
                </sonar.coverage.exclusions>
vitam-prg's avatar
vitam-prg committed
                <sonar.cpd.exclusions>**/*Dto.java, **/domain/*.java, **/*spec.ts</sonar.cpd.exclusions>
                <sonar.exclusions>**/node_modules/**, **/sass/**</sonar.exclusions>
                <sonar.java.spotbugs.reportPaths>./target/spotbugsXml.xml</sonar.java.spotbugs.reportPaths>
                <sonar.java.pmd.reportPaths>./target/pmd.xml</sonar.java.pmd.reportPaths>
vitam-prg's avatar
vitam-prg committed
                <!-- TODO: This properties need to bo specify by the user who execute
                the report (ex: Jenkins or developper) -->
benemart's avatar
benemart committed
                <sonar.host.url/>
vitam-prg's avatar
vitam-prg committed
                <!-- TODO: This properties need to bo specify by the user who execute
                the report (ex: Jenkins or developper) -->
benemart's avatar
benemart committed
                <sonar.login/>
                <sonar.typescript.lcov.reportPaths>
                    ${main.basedir}/ui/ui-frontend/target/coverage/commons/lcov.info,${main.basedir}/ui/ui-frontend/target/coverage/flow/lcov.info,${main.basedir}/ui/ui-frontend/target/coverage/identity/lcov.info,${main.basedir}/ui/ui-frontend/target/coverage/portal/lcov.info
                </sonar.typescript.lcov.reportPaths>
vitam-prg's avatar
vitam-prg committed
            </properties>

        </profile>

        <!-- This profile is used to generate swagger documentation. -->
        <profile>
            <id>swagger</id>
            <build>
                <plugins>
benemart's avatar
benemart committed
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <test>SwaggerJsonFileGenerationTest.java</test>
                        </configuration>
                    </plugin>
vitam-prg's avatar
vitam-prg committed
                </plugins>
            </build>
        </profile>

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

benemart's avatar
benemart committed
                    <plugin>
                        <groupId>io.github.swagger2markup</groupId>
                        <artifactId>swagger2markup-maven-plugin</artifactId>
                        <version>${maven.swagger2markup.plugin.version}</version>
vitam-prg's avatar
vitam-prg committed
                        <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>
                                ${main.basedir}/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>
vitam-prg's avatar
vitam-prg committed
                            <skip>${swagger.skip}</skip>
benemart's avatar
benemart committed
                        </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>
vitam-prg's avatar
vitam-prg committed
                            <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>${main.basedir}/tools/swagger/config/</sourceDirectory>
                            <sourceDocumentName>index.adoc</sourceDocumentName>
                            <backend>html5</backend>
                            <outputDirectory>${main.basedir}/tools/swagger/docs/${swagger.dir}/${project.artifactId}
                            </outputDirectory>
                            <attributes>
                                <toc>left</toc>
                                <toclevels>3</toclevels>
vitam-prg's avatar
vitam-prg committed
                                <numbered></numbered>
                                <hardbreaks></hardbreaks>
                                <sectlinks></sectlinks>
                                <sectanchors></sectanchors>
benemart's avatar
benemart committed
                                <generated>${project.build.directory}/generated-sources/swagger/</generated>
                            </attributes>
vitam-prg's avatar
vitam-prg committed
                            <skip>${swagger.skip}</skip>
benemart's avatar
benemart committed
                        </configuration>
                        <executions>
                            <execution>
                                <id>output-html</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                            </execution>
vitam-prg's avatar
vitam-prg committed
                            <execution>
                                <id>output-pdf</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>process-asciidoc</goal>
                                </goals>
                                <configuration>
                                    <backend>pdf</backend>
                                    <outputDirectory>
                                        ${main.basedir}/tools/swagger/docs/${swagger.dir}/${project.artifactId}
                                    </outputDirectory>
vitam-prg's avatar
vitam-prg committed
                                </configuration>
                            </execution>
benemart's avatar
benemart committed
                        </executions>
                    </plugin>
vitam-prg's avatar
vitam-prg committed
                </plugins>
            </build>
benemart's avatar
benemart committed
            <!-- Repositories used for swagger doc generation  -->
vitam-prg's avatar
vitam-prg committed
            <pluginRepositories>
benemart's avatar
benemart committed
                <pluginRepository>
                    <id>jcenter-snapshots</id>
                    <name>jcenter</name>
                    <url>https://oss.jfrog.org/artifactory/oss-snapshot-local/</url>
                </pluginRepository>
                <pluginRepository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>jcenter-releases</id>
                    <name>jcenter</name>
                    <url>https://jcenter.bintray.com</url>
                </pluginRepository>
vitam-prg's avatar
vitam-prg committed
            </pluginRepositories>
        </profile>