<!--
  ~ /*
  ~
  ~   ******************************************************************************
  ~
  ~    Copyright (c) 2023-24 Harman International
  ~
  ~
  ~
  ~    Licensed under the Apache License, Version 2.0 (the "License");
  ~
  ~    you may not use this file except in compliance with the License.
  ~
  ~    You may obtain a copy of the License at
  ~
  ~
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~
  ~    Unless required by applicable law or agreed to in writing, software
  ~
  ~    distributed under the License is distributed on an "AS IS" BASIS,
  ~
  ~    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~
  ~    See the License for the specific language governing permissions and
  ~
  ~    limitations under the License.
  ~
  ~
  ~
  ~    SPDX-License-Identifier: Apache-2.0
  ~
  ~    *******************************************************************************
  ~
  ~  */
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.eclipse.ecsp</groupId>
    <artifactId>transformers</artifactId>
    <version>1.0.0</version>
    <name>transformers</name>
    <description>Transformers to convert to and from binary data</description>
    <url>https://github.com/eclipse-ecsp/transformers</url>

    <scm>
        <connection>scm:git:https://github.com/eclipse-ecsp/transformers.git</connection>
        <url>https://github.com/eclipse-ecsp/transformers</url>
        <tag>HEAD</tag>
    </scm>
    
    <developers>
        <developer>
            <id>ihussainbadshah</id>
            <name>Hussain Badshah</name>
            <email>Hussain.Badshah@harman.com</email>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/eclipse-ecsp/transformers/issues</url>
    </issueManagement>

    <organization>
        <url>https://github.com/eclipse-ecsp</url>
        <name>eclipse-ecsp</name>
    </organization>

    <properties>
		<java.version>17</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.test.version>6.1.14</spring.test.version>
        <utils.version>1.1.0</utils.version>
        <entities.version>1.1.1</entities.version>
        <maven.surefire.version>2.18.1</maven.surefire.version>
        <!--Checkstyle plugin properties -->
        <checkstyle.version>10.13.0</checkstyle.version>
        <maven.checkstyle.version>3.3.1</maven.checkstyle.version>
        <checkstyle.config.location>${project.basedir}/checkstyle_checks.xml</checkstyle.config.location>
        <checkstyle.suppressions.location>${project.basedir}/checkstyle-suppressions.xml
        </checkstyle.suppressions.location>
        <sonar.java.checkstyle.reportPaths>${project.build.directory}/checkstyle-result.xml
        </sonar.java.checkstyle.reportPaths>
        <!-- Sonar plugin properties -->
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
        <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco-ut/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <sonar.java.source>17</sonar.java.source>
        <sonar.java.target>17</sonar.java.target>
        <sonar.coverage.jacoco.xmlReportPaths>${project.build.directory}/site/jacoco-ut/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <sonar.language>java</sonar.language>
        <sonar.coverage.exclusions>**/transform/util/*.java,
            **/org/eclipse/ecsp/serializer/IngestionSerializerFactory.java,
            **/serializer/util/*.java
        </sonar.coverage.exclusions>
        <jacoco.ut.execution.data.file>${project.build.directory}/coverage-reports/jacoco-ut.exec
        </jacoco.ut.execution.data.file>
        <license-tool-plugin.version>1.1.0</license-tool-plugin.version>
        <install-plugin.version>3.1.1</install-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <java.17.options>
            --add-opens=java.base/java.io=ALL-UNNAMED
            --add-opens=java.base/java.lang=ALL-UNNAMED
            --add-opens=java.base/java.math=ALL-UNNAMED
            --add-opens=java.base/java.util=ALL-UNNAMED
            --add-opens=java.base/java.util.concurrent=ALL-UNNAMED
            --add-opens=java.base/java.net=ALL-UNNAMED
            --add-opens=java.base/java.text=ALL-UNNAMED
            --add-opens=java.sql/java.sql=ALL-UNNAMED
        </java.17.options>
    </properties>

    <distributionManagement>
        <snapshotRepository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
    </distributionManagement>

    <pluginRepositories>
        <pluginRepository>
            <id>dash-licenses-releases</id>
            <url>https://repo.eclipse.org/content/repositories/dash-licenses-releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>org.eclipse.ecsp</groupId>
            <artifactId>utils</artifactId>
            <version>${utils.version}</version>
            <exclusions>
				<exclusion>
					<groupId>org.eclipse.ecsp</groupId>
					<artifactId>entities</artifactId>
				</exclusion>
			</exclusions>
        </dependency>
        <dependency>
			<groupId>org.eclipse.ecsp</groupId>
			<artifactId>entities</artifactId>
			<version>${entities.version}</version>
		</dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.13.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <version>1.7.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <version>1.7.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>de.ruedigermoeller</groupId>
            <artifactId>fst</artifactId>
            <version>2.57</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.test.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.skyscreamer</groupId>
            <artifactId>jsonassert</artifactId>
            <version>1.5.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <compilerArgs>
                            <arg>--add-opens=java.base/java.io=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.math=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.util=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.util.concurrent=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.net=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.base/java.text=ALL-UNNAMED</arg>
                            <arg>--add-opens=java.sql/java.sql=ALL-UNNAMED</arg>
                        </compilerArgs>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>
				
				<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>${install-plugin.version}</version>
                </plugin>
					
                <plugin>
                    <groupId>org.cyclonedx</groupId>
                    <artifactId>cyclonedx-maven-plugin</artifactId>
                    <version>2.7.10</version>
                    <configuration>
                        <projectType>application</projectType>
                        <schemaVersion>1.5</schemaVersion>
                        <includeBomSerialNumber>true</includeBomSerialNumber>
                        <includeCompileScope>true</includeCompileScope>
                        <includeProvidedScope>true</includeProvidedScope>
                        <includeRuntimeScope>true</includeRuntimeScope>
                        <includeSystemScope>true</includeSystemScope>
                        <includeTestScope>true</includeTestScope>
                        <includeLicenseText>true</includeLicenseText>
                        <outputFormat>all</outputFormat>
                        <outputDirectory>${project.basedir}/sbom</outputDirectory>
                        <verbose>false</verbose>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>makeAggregateBom</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <configuration>
                        <gpgArguments>
                            <arg>--pinentry-mode</arg>
                            <arg>loopback</arg>
                            <arg>--batch</arg>
                            <arg>--yes</arg>
                        </gpgArguments>
                    </configuration>
                </plugin>
                
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.version}</version>
                <configuration>
                    <!-- Sets the VM argument line used when unit tests are 
                        run. -->
                    <argLine>${surefireArgLine} ${java.17.options}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.cyclonedx</groupId>
                <artifactId>cyclonedx-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.8</version>
                <configuration>
                    <!-- Exclusions -->
                    <excludes>
                        <exclude>**/transform/util/*.class</exclude>
                        <exclude>org/eclipse/ecsp/serializer/IngestionSerializerFactory.class</exclude>
                        <exclude>**/serializer/util/*.class</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <!-- Prepares the property pointing to the JaCoCo runtime 
                        agent which is passed as VM argument when Maven the Surefire plugin is executed. -->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains 
                                the execution data. -->
                            <destFile>${jacoco.ut.execution.data.file}</destFile>
                            <!-- Sets the name of the property containing 
                                the settings for JaCoCo runtime agent. -->
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <!-- Ensures that the code coverage report for unit tests 
                        is created after unit tests have been run. -->
                    <execution>
                        <id>post-unit-test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <!-- Sets the path to the file which contains 
                                the execution data. -->
                            <dataFile>${jacoco.ut.execution.data.file}</dataFile>
                            <!-- Sets the output directory for the code coverage 
                                report. -->
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- maven sonar plugin..To send data to SonarQube you need to 
                run mvn sonar:sonar after the build -->
            <plugin>
                <groupId>org.sonarsource.scanner.maven</groupId>
                <artifactId>sonar-maven-plugin</artifactId>
                <version>3.10.0.2594</version>
            </plugin>

            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>**/jar/</include>
                            </includes>
                            <followSymlinks>false</followSymlinks>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <minimizeJar>false</minimizeJar>
                            <artifactSet/>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
					<autoVersionSubmodules>true</autoVersionSubmodules>
					<useReleaseProfile>false</useReleaseProfile>
					<releaseProfiles>release</releaseProfiles>
					<goals>deploy</goals>
				</configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${maven.checkstyle.version}</version>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <configuration>
                            <consoleOutput>true</consoleOutput>
                            <failsOnError>true</failsOnError>
                            <outputFileFormat>xml</outputFileFormat>
                            <failsOnError>true</failsOnError>
                            <failOnViolation>true</failOnViolation>
                            <violationSeverity>warning</violationSeverity>
                            <includeTestSourceDirectory>true</includeTestSourceDirectory>
                            <includeResources>true</includeResources>
                            <includeTestResources>true</includeTestResources>
                        </configuration>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${checkstyle.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            
            <plugin>
                <groupId>org.eclipse.dash</groupId>
                <artifactId>license-tool-plugin</artifactId>
                <version>${license-tool-plugin.version}</version>
                <configuration>
                    <includeScope>test</includeScope>
                </configuration>
                <executions>
                    <execution>
                        <id>license-check</id>
                        <goals>
                            <goal>license-check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            
        </plugins>
    </build>
    
    <profiles>
        <profile>
            <id>dash</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.dash</groupId>
                        <artifactId>license-tool-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                            <failWhenReviewNeeded>true</failWhenReviewNeeded>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skipTests>true</skipTests>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
			<properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
			<distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>3.3.0</version>
						<executions>
							<execution>
								<id>attach-sources</id>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.2.0</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
                </plugins>
            </build>
        </profile>
		<profile>
            <id>javadoc</id>
			<properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
			<distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>3.2.0</version>
						<executions>
							<execution>
								<id>attach-javadocs</id>
								<goals>
									<goal>jar</goal>
								</goals>
								<configuration>
									<release>${java.version}</release>
								</configuration>
							</execution>
						</executions>
					</plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    
</project>
