Skip to content
Snippets Groups Projects
Select Git revision
  • 6d6b8e68ab7a6be2c700ee09e095d0396e413ceb
  • develop default protected
  • feature/refactor
  • feature/authentication
  • master
5 results

pom.xml

Blame
  • pom.xml 19.75 KiB
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>fr.univtln.bruno.exemple.simplerest</groupId>
        <artifactId>sample-jaxrs</artifactId>
        <packaging>jar</packaging>
        <version>2.0-SNAPSHOT</version>
        <name>Sample JAX-RS</name>
        <dependencyManagement>
            <dependencies>
                <!-- Jakarta RESTful Web Services (JAXRS) https://jakarta.ee/specifications/restful-ws/3.0/ -->
                <dependency>
                    <groupId>org.glassfish.jersey</groupId>
                    <artifactId>jersey-bom</artifactId>
                    <version>${jersey.version}</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-bom</artifactId>
                    <version>3.0.0</version>
                    <type>pom</type>
                    <scope>import</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.jersey.containers</groupId>
                <artifactId>jersey-container-grizzly2-http</artifactId>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.inject</groupId>
                <artifactId>jersey-hk2</artifactId>
            </dependency>
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-jaxb</artifactId>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-impl</artifactId>
                <scope>runtime</scope>
            </dependency>
    
            <dependency>
                <groupId>org.glassfish.jersey.media</groupId>
                <artifactId>jersey-media-json-jackson</artifactId>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jdk8</artifactId>
                <version>2.12.1</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-eclipse-collections</artifactId>
                <version>2.12.1</version>
            </dependency>
    
            <dependency>
                <groupId>org.glassfish.jersey.core</groupId>
                <artifactId>jersey-client</artifactId>
            </dependency>
    
            <!-- HTTP2 -->
            <dependency>
                <groupId>org.glassfish.grizzly</groupId>
                <artifactId>grizzly-http2</artifactId>
                <version>3.0.0</version>
            </dependency>
    
            <dependency>
                <groupId>org.glassfish.grizzly</groupId>
                <artifactId>grizzly-npn-bootstrap</artifactId>
                <version>2.0.0</version>
            </dependency>
    
            <!-- Eclipse Collections -->
            <dependency>
                <groupId>org.eclipse.collections</groupId>
                <artifactId>eclipse-collections</artifactId>
                <version>10.4.0</version>
            </dependency>
    
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>1.18.18</version>
                <scope>compile</scope>
            </dependency>
    
    
            <!-- Unit Tests -->
            <!-- Utilities test functions in unit tests -->
            <!-- Harmcrest Matchers http://hamcrest.org/JavaHamcrest/tutorial -->
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>2.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.1</version>
                <scope>test</scope>
            </dependency>
            <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.11</version>
                <scope>test</scope>
            </dependency>
    
            <!-- JWT -->
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-api</artifactId>
                <version>0.11.2</version>
            </dependency>
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-impl</artifactId>
                <scope>runtime</scope>
                <version>0.11.2</version>
            </dependency>
            <dependency>
                <groupId>io.jsonwebtoken</groupId>
                <artifactId>jjwt-jackson</artifactId>
                <version>0.11.2</version>
                <scope>compile</scope>
            </dependency>
    
    
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <inherited>true</inherited>
                    <configuration>
                        <source>15</source>
                        <target>15</target>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.6.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <mainClass>${main.class}</mainClass>
                    </configuration>
                </plugin>
    
                <!-- Unit and Integration Tests & Code coverage -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <configuration>
                        <!--suppress UnresolvedMavenProperty -->
                        <argLine>${surefire.jacoco.args}</argLine>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M4</version>
                    <configuration>
                        <!--suppress MavenModelInspection -->
                        <argLine>${failsafe.jacoco.args}</argLine>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.6</version>
                    <executions>
                        <!-- Surefire -->
                        <execution>
                            <id>before-unit-test-execution</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <destFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</destFile>
                                <propertyName>surefire.jacoco.args</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>after-unit-test-execution</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <dataFile>${project.build.directory}/jacoco-output/jacoco-unit-tests.exec</dataFile>
                                <outputDirectory>${project.reporting.outputDirectory}/jacoco-unit-test-coverage-report
                                </outputDirectory>
                            </configuration>
                        </execution>
    
                        <!-- Failsafe -->
                        <execution>
                            <id>before-integration-test-execution</id>
                            <phase>pre-integration-test</phase>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                            <configuration>
                                <destFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</destFile>
                                <propertyName>failsafe.jacoco.args</propertyName>
                            </configuration>
                        </execution>
                        <execution>
                            <id>after-integration-test-execution</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <dataFile>${project.build.directory}/jacoco-output/jacoco-integration-tests.exec</dataFile>
                                <outputDirectory>
                                    ${project.reporting.outputDirectory}/jacoco-integration-test-coverage-report
                                </outputDirectory>
                            </configuration>
                        </execution>
    
                        <!-- Merged test coverage report -->
                        <execution>
                            <id>merge-unit-and-integration</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>merge</goal>
                            </goals>
                            <configuration>
                                <fileSets>
                                    <fileSet>
                                        <directory>${project.build.directory}/jacoco-output/</directory>
                                        <includes>
                                            <include>*.exec</include>
                                        </includes>
                                    </fileSet>
                                </fileSets>
                                <destFile>${project.build.directory}/jacoco-output/merged.exec</destFile>
                            </configuration>
                        </execution>
                        <execution>
                            <id>create-merged-report</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                            <configuration>
                                <dataFile>${project.build.directory}/jacoco-output/merged.exec</dataFile>
                                <outputDirectory>${project.reporting.outputDirectory}/jacoco-merged-coverage-report
                                </outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.0.0-M3</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>3.5.4</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>15</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
    
                <!--Sonarquve -->
                <plugin>
                    <groupId>org.sonarsource.scanner.maven</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>3.7.0.1746</version>
                </plugin>
                <plugin>
                    <groupId>io.github.r0bb3n</groupId>
                    <artifactId>sonar-quality-gate-maven-plugin</artifactId>
                    <version>1.0.2</version>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.9.1</version>
                </plugin>
    
                <!-- Builds a jar that can merge the artifact and its dependencies
                    https://maven.apache.org/plugins/maven-shade-plugin/
                    WARNING minimizeJar can cause trouble, disable it in the child project if needed
    
                    The manifest mainclass can be given with the property ${app.main.class}.
    
                    Its is added to the package phase.
                    -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.3</version>
                    <configuration>
                        <createDependencyReducedPom>true</createDependencyReducedPom>
                        <minimizeJar>false</minimizeJar>
                        <!-- The shaded artifact is not the main artifact -->
                        <shadedArtifactAttached>true</shadedArtifactAttached>
                        <shadedClassifierName>withdependencies</shadedClassifierName>
    
                        <transformers>
                            <!-- merge services ressource for SPI -->
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
    
                            <!-- makes a default entry point in the shaded jar -->
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <manifestEntries>
                                    <Main-Class>${main.class}</Main-Class>
                                    <X-Compile-Source-JDK>${java.version}</X-Compile-Source-JDK>
                                    <X-Compile-Target-JDK>${java.version}</X-Compile-Target-JDK>
                                </manifestEntries>
                            </transformer>
    
                            <!-- keep a default config file -->
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                <resource>config.properties</resource>
                                <resource>log4j.properties</resource>
                            </transformer>
                        </transformers>
    
                        <!-- removes signatures in uberjar -->
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
    
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    
                <!-- SSL Certificates -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>keytool-maven-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <phase>generate-resources</phase>
                            <id>generateKeyPair</id>
                            <goals>
                                <goal>generateKeyPair</goal>
                            </goals>
                            <configuration>
                                <skipIfExist>true</skipIfExist>
                            </configuration>
                        </execution>
                        <execution>
                            <phase>generate-resources</phase>
                            <id>generateCertificateRequest</id>
                            <goals>
                                <goal>generateCertificateRequest</goal>
                            </goals>
                            <configuration>
                                <file>src/main/resources/ssl/test.csr</file>
                            </configuration>
                        </execution>
                        <execution>
                            <phase>generate-resources</phase>
                            <id>generateCertificate</id>
                            <goals>
                                <goal>generateCertificate</goal>
                            </goals>
                            <configuration>
                                <infile>src/main/resources/ssl/test.csr</infile>
                                <outfile>src/main/resources/ssl/test.crt</outfile>
                                <rfc>true</rfc>
                            </configuration>
                        </execution>
                    </executions>
                    <configuration>
                        <keystore>src/main/resources/ssl/cert.jks</keystore>
                        <storepass>storepass</storepass>
                        <keypass>storepass</keypass>
                        <alias>localhost</alias>
                        <validity>100</validity>
                        <sigalg>SHA256withRSA</sigalg>
                        <keyalg>RSA</keyalg>
                        <!--dname>cn=com.example</dname-->
                        <dname>cn=localhost.localdomain</dname>
                    </configuration>
                </plugin>
    
            </plugins>
        </build>
        <properties>
            <jersey.version>3.0.1</jersey.version>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco-merged-coverage-report/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
            <main.class>fr.univtln.bruno.samples.jaxrs.server.BiblioServer</main.class>
        </properties>
    </project>