<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <packaging>pom</packaging>
  <groupId>io.github.barrieshieh.base</groupId>
  <artifactId>base-parent-npm</artifactId>
  <version>0.7.1</version>

  <name>Base :: Parent NPM</name>
  <description>Base parent for NPM project</description>
  <url>https://github.com/BarrieShieh/base</url>

  <properties>
    <git.branch></git.branch>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <!--  CLM properties   -->
    <clm.projectKey>IOX_RBR-CN_Project-base-npm${git.branch}</clm.projectKey>
    <clm.configFile>${project.basedir}/tina.xml</clm.configFile>
    <clm.username></clm.username>
    <clm.password></clm.password>
    <!--  FOSSID properties   -->
    <fossid.projectKey>IOX_RBR-CN_Project-base-npm${git.branch}</fossid.projectKey>
    <!-- Sonar properties -->
    <sonar.scm.provider>git</sonar.scm.provider>
    <sonar.projectName>com.bosch.iox.${project.artifactId}</sonar.projectName>
    <sonar.projectKey>com.bosch.iox.${project.artifactId}</sonar.projectKey>
    <sonar.sources>src, package-lock.json</sonar.sources>
    <sonar.exclusions>**/node_modules/**, src/assets/**, target/**</sonar.exclusions>
    <sonar.tests>src</sonar.tests>
    <sonar.test.inclusions>**/*.spec.ts</sonar.test.inclusions>
    <!--  SonarQube CodeCoverage properties -->
    <sonar.javascript.lcov.reportPaths>coverage/ultima/lcov.info</sonar.javascript.lcov.reportPaths>
  </properties>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <tag>master</tag>
    <url>scm:svn:https://github.com/BarrieShieh/base</url>
    <connection>scm:svn:https://github.com/BarrieShieh/base</connection>
    <developerConnection>https://github.com/BarrieShieh/base</developerConnection>
  </scm>
  <developers>
    <developer>
      <name>Barrie</name>
      <email>barrieshieh@gmail.com</email>
    </developer>
  </developers>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <!--        <configuration>-->
        <!--          <source>${source.version}</source>-->
        <!--          <target>${target.version}</target>-->
        <!--        </configuration>-->
      </plugin>
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <configuration>
          <generateBackupPoms>false</generateBackupPoms>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.sonarsource.scanner.maven</groupId>
          <artifactId>sonar-maven-plugin</artifactId>
          <version>3.7.0.1746</version>
        </plugin>
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-deploy-plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <!-- https://mvnrepository.com/artifact/org.codehaus.mojo/versions-maven-plugin -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.8.1</version>
        </plugin>
        <plugin>
          <groupId>org.twdata.maven</groupId>
          <artifactId>sonar-oss-scanner-maven-plugin</artifactId>
          <version>1.0.5</version>
        </plugin>
        <!--    https://github.boschdevcloud.com/bios-bci-open-tools/fossid-tools/releases    -->
        <plugin>
          <groupId>com.bosch.bios.bot.fossid</groupId>
          <artifactId>fossid-tools-maven-plugin</artifactId>
          <version>0.17.0</version>
          <configuration>
            <projectCode>${fossid.projectKey}</projectCode>
            <breakBuild>false</breakBuild>
            <globPatterns>
              <globPattern>src</globPattern> <!--include project root -->
              <globPattern>**/src
              </globPattern> <!--include subprojects (will NOT match [projectRootDir]/src/main) -->
              <globPattern>!src/assets</globPattern> <!--exclude-->
              <globPattern>!node_modules</globPattern> <!--exclude node dependencies (for root) -->
              <globPattern>!target</globPattern> <!--exclude node dependencies (for root) -->
              <globPattern>!dist</globPattern> <!--exclude node dependencies (for root) -->
              <globPattern>!**/node_modules
              </globPattern> <!--exclude node dependencies (for subprojects) (will NOT match [projectRootDir]/src/main )-->
            </globPatterns>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.bosch.tina</groupId>
          <artifactId>tina-bosch-mojo</artifactId>
          <version>2.5.3</version> <!-- enter desired version here -->
          <configuration>
            <productName>${project.version}</productName>
            <productFullname>${project.version}</productFullname>
            <version>${project.version}</version>
            <!--external workflow definiation <workflowDefinitionFile>${basedir}/workflow.xml</workflowDefinitionFile> -->
            <!-- path(s) to your config.xml(s)-->
            <configFiles>
              <param>${clm.configFile}</param>
            </configFiles>
            <!-- inline workflow -->
            <workflow>
              <analyzers>
                <step>
                  <name>IQ Analyzer</name>
                  <classHint>com.bosch.tina.clm.SonatypeCLMCliAnalyzer</classHint>
                  <deactivated>${tina.analyze.nexus.iq.deactivated}</deactivated>
                  <configuration>
                    <entry>
                      <entryKey>server</entryKey>
                      <entryValue>https://clmserver.bosch-si.com</entryValue>
                    </entry>
                    <entry>
                      <entryKey>scan.result.path</entryKey>
                      <entryValue>${project.build.directory}/antenna/clm-scan-result.json
                      </entryValue>
                    </entry>
                    <entry>
                      <entryKey>app.id</entryKey>
                      <entryValue>${clm.projectKey}</entryValue>
                    </entry>
                    <entry>
                      <entryKey>username</entryKey>
                      <entryValue>${clm.username}</entryValue>
                    </entry>
                    <entry>
                      <entryKey>password</entryKey>
                      <entryValue>${clm.password}</entryValue>
                    </entry>
                    <entry>
                      <entryKey>clm.pdf.path</entryKey>
                      <entryValue>${project.build.directory}/antenna/clm-report.pdf
                      </entryValue>
                    </entry>
                    <entry>
                      <entryKey>scan.patterns</entryKey>
                      <entryValue>${project.build.directory}/node_modules.tar
                      </entryValue>
                    </entry>
                  </configuration>
                </step>
                <step>
                  <name>JavaScript Analyzer</name>
                  <classHint>com.bosch.tina.javascript.analyzer.JavaScriptAnalyzer</classHint>
                  <configuration>
                    <entry>
                      <entryKey>js.dir.path</entryKey>
                      <entryValue>${project.basedir}/node_modules</entryValue>
                    </entry>
                    <entry>
                      <entryKey>js.exclude.pattern</entryKey>
                      <entryValue>bosch-*</entryValue>
                    </entry>
                    <entry>
                      <entryKey>js.strategy</entryKey>
                      <entryValue>NPM</entryValue>
                    </entry>
                  </configuration>
                </step>
              </analyzers>
              <processors>
                <step>
                  <name>Security Issue Validator</name>
                  <classHint>
                    org.eclipse.sw360.antenna.validators.workflow.processors.SecurityIssueValidator
                  </classHint>
                  <configuration>
                    <entry>
                      <entryKey>forbiddenSecurityIssueStatusSeverity</entryKey>
                      <entryValue>WARN</entryValue>
                    </entry>
                    <entry>
                      <entryKey>securityIssueSeverityLimitSeverity</entryKey>
                      <entryValue>WARN</entryValue>
                    </entry>
                    <entry>
                      <entryKey>forbiddenSecurityIssueStatuses</entryKey>
                      <entryValue>Open</entryValue>
                    </entry>
                    <entry>
                      <entryKey>securityIssueSeverityLimit</entryKey>
                      <entryValue>1.0</entryValue>
                    </entry>
                  </configuration>
                </step>
                <step>
                  <name>License Validator</name>
                  <classHint>
                    org.eclipse.sw360.antenna.validators.workflow.processors.LicenseValidator
                  </classHint>
                  <configuration>
                    <entry>
                      <entryKey>forbiddenLicenseSeverity</entryKey>
                      <entryValue>WARN</entryValue>
                    </entry>
                    <entry>
                      <entryKey>missingLicenseInformationSeverity</entryKey>
                      <entryValue>WARN</entryValue>
                    </entry>
                    <entry>
                      <entryKey>missingLicenseTextSeverity</entryKey>
                      <entryValue>INFO</entryValue>
                    </entry>
                    <entry>
                      <entryKey>forbiddenLicenses</entryKey>
                      <entryValue>AGPL, GPL, RPL, OSL</entryValue>
                    </entry>
                    <entry>
                      <entryKey>ignoredLicenses</entryKey>
                      <entryValue></entryValue>
                    </entry>
                  </configuration>
                </step>
              </processors>
            </workflow>
          </configuration>
          <dependencies><!-- To support above java 9 -->
            <dependency>
              <groupId>javax.xml.bind</groupId>
              <artifactId>jaxb-api</artifactId>
              <version>2.3.1</version>
            </dependency>
            <dependency>
              <groupId>org.glassfish.jaxb</groupId>
              <artifactId>jaxb-runtime</artifactId>
              <version>2.3.1</version>
            </dependency>
            <dependency>
              <groupId>javax.activation</groupId>
              <artifactId>activation</artifactId>
              <version>1.1.1</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>deploy-ossrh</id>
      <distributionManagement>
        <snapshotRepository>
          <id>ossrh-snapshots</id>
          <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
          <id>ossrh-releases</id>
          <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <!-- https://mvnrepository.com/artifact/org.sonatype.plugins/nexus-staging-maven-plugin -->
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
