<?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/maven-v4_0_0.xsd">

  <!-- coordinates for model and artifact -->
  <modelVersion>4.0.0</modelVersion>

  <groupId>eu.simuline</groupId>
  <artifactId>qMngmnt</artifactId>
  <version>0.0.7-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>Quality Management @ Simuline</name>
  <description>
    This is a collection of resources and documents
    describing the general quality management for simuline. 
  </description>

  <url>https://github.com/Reissner/QMngMnt</url>  <!-- should be mojohouse -->
  <inceptionYear>2021</inceptionYear>
  <licenses>
    <license>
      <name>The Creative Commons License</name>
      <url>http://creativecommons.org/licenses/by/4.0/</url>
      <distribution>repo</distribution>
      <comments>
	This work is licensed under a
	Creative Commons Attribution 4.0 International License.
      </comments>
    </license>
  </licenses>

  <organization>
    <name>Simuline Organization (l2r)</name>
    <url>http://www.simuline.eu</url>
  </organization>

  <developers>
    <developer>
      <id>ereissner</id>
      <name>Ernst Reissner</name>
      <email>Ernst.Reissner at simuline dot eu</email>
      <organization>simuline</organization>
      <organizationUrl>https://www.simuline.eu</organizationUrl>
      <timezone>Europe/Berlin</timezone>
    </developer>
  </developers>

  <!-- source repositories: tests and documentation 
       maybe not yet needed. -->
  <repositories>
    <repository>
      <id>publicRepoAtSimuline</id>
      <name>repo at simuline</name>
      <url>https://www.simuline.eu/RepositoryMaven</url>
    </repository>
  </repositories>

  <scm>
    <connection>
      scm:git:https://github.com/Reissner/QMngMnt.git
    </connection>
    <developerConnection>
      scm:git:https://github.com/Reissner/QMngMnt.git
    </developerConnection>
    <url>https://github.com/Reissner/QMngMnt</url>
    <tag>HEAD</tag>
  </scm>


  <!-- For authentication see ~/.m2/settings.xml -->
  <distributionManagement>
    <site>
      <id>publicSiteAtSimuline</id>
      <url>ftp://www.simuline.eu/public_html/QualityManagement</url>
    </site>

    <repository>
      <id>publicRepoAtSimuline</id>
      <url>ftp://www.simuline.eu/public_html/RepositoryMaven</url>
    </repository>
  </distributionManagement>


  <mailingLists>
    <!--mailingList>
      <name>QMngMnt Users</name>
      <archive>http://groups.google.com/group/QMngMnt-users</archive>
      <post>QMngMnt-users@googlegroups.com</post>
      <subscribe>QMngMnt-users+subscribe@googlegroups.com</subscribe>
      <unsubscribe>QMngMnt-users+unsubscribe@googlegroups.com</unsubscribe>
    </mailingList-->
  </mailingLists>

  <issueManagement>
    <system>Github Issues</system>
    <url>https://github.com/Reissner/QMngMnt/issues</url>
    <!--url>https://github.com/akquinet/latex-maven-plugin/issues</url-->
  </issueManagement>

  <!-- properties: ensures reproducibility -->
  <properties>
    <!-- to keep dependencies up to date: 
    mvn versions:display-plugin-updates
    mvn versions:display-dependency-updates -->

    <!-- checked during validation -->
    <versionMvn>3.9.2</versionMvn>
    <versionJava>17</versionJava>
    <!--maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target-->
    <versionTestPlugins>3.5.4</versionTestPlugins><!-- 3.2.5 -->
    <!-- Using platform encoding to copy filtered resources; 
    without project.build.sourceEncoding the build is platform dependent! -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <versionTikzuml>tikzuml-v1.0-2016-03-29</versionTikzuml>
    <versionJabref>5.9-1.x86_64</versionJabref>
    <versionLatexPlugin>2.1-SNAPSHOT</versionLatexPlugin>
    <instDir>src/main/resources/eu/simuline/qMngmnt/installation/</instDir>
    <latexDir>src/main/resources/eu/simuline/qMngmnt/latex/</latexDir>
  </properties>


  <build>

    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ftp</artifactId>
        <version>3.5.3</version><!-- 3.3.2 -->
      </extension>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-file</artifactId>
        <version>3.5.3</version><!-- 3.3.2 -->
      </extension>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-http</artifactId>
        <version>3.5.3</version><!-- 3.3.2 -->
      </extension>
    </extensions>

    <!-- copy into target/classes -->
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>


    <plugins>
      <!-- at the moment just to enforce maven version
	   use as mvn validate not as mvn enforcer:enforce
	   TBD: add a lot of tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.6.2</version><!-- 3.4.1 -->
        <executions>
          <execution>
            <id>enforce-maven</id>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${versionMvn}</version>
                  <message>
		    Invalid Maven version. It should, at least, be ${versionMvn}
                  </message>
                </requireMavenVersion>
                <requireJavaVersion>
                  <version>${versionJava}</version>
                </requireJavaVersion>
                <dependencyConvergence />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- information about a project or the system -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-help-plugin</artifactId>
        <version>3.5.1</version><!-- 3.4.0 -->
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>3.4.0</version><!-- 3.3.1 -->
        <configuration>
          <propertiesEncoding>UTF-8</propertiesEncoding>
          <nonFilteredFileExtensions>
            <nonFilteredFileExtension>pdf</nonFilteredFileExtension>
            <nonFilteredFileExtension>ppt</nonFilteredFileExtension>
            <nonFilteredFileExtension>epub</nonFilteredFileExtension>
            <nonFilteredFileExtension>rpm</nonFilteredFileExtension>
            <nonFilteredFileExtension>zip</nonFilteredFileExtension>
            <nonFilteredFileExtension>jar</nonFilteredFileExtension>
            <nonFilteredFileExtension>gz</nonFilteredFileExtension>
            <!-- maybe this is too much. maybe sync with cleanup -->
        </nonFilteredFileExtensions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>3.3.1</version><!-- 3.0.1 -->
      </plugin>

      <!-- configuration for clean plugin -->
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.5.0</version><!-- 3.3.2 -->
        <configuration>
          <filesets>
            <fileset>
              <directory>${instDir}</directory>
              <includes>
                <include>${versionTikzuml}.tbz</include>
                <include>find_uno.py</include>
                <include>*.xpi</include>
                <include>jabref-${versionJabref}.rpm</include>
              </includes>
            </fileset>
            <fileset>
              <directory>${instDir}</directory>
              <includes>
                <include>instVScode4tex.sh</include>
                <include>instTexlive.sh</include>
                <include>instTexliverc</include>
                <include>packagesTexlive4*.txt</include>
                <include>switchTexlive.sh</include>
                <!-- <include>install-tl*</include> -->
              </includes>
            </fileset>
            <fileset>
              <directory>src/site/tex</directory>
              <includes>
                <include>litLMPpub.bib</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

      <!-- This plugin will write properties values 
	   using dependency information into classpath.txt-->
      <!--plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.2</version>
        <executions>
          <execution>
            <?m2e execute onConfiguration,onIncremental?>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>
              <outputFile>${project.build.directory}/classpath.txt</outputFile>
            </configuration>
          </execution>
        </executions>
      </plugin-->


      <!-- The dependency plugin makes dependencies available: 
	     - lots of goals are useful standalone: analyze, 
	       analyze-dep-mgt, analyze-duplicate
	     - goal properties 
	     - goal build-classpath writes the classpath 
	     defined by the dependencies to file clspath.txt. 
      This goal properties will set properties values 
	     using dependency information 
    also dependencies are avaiable as variables, e.g. ${junit:junit:jar}-->
      <!-- the properties-maven-plugin then writes those properties 
	   in a file to ${project.build.outputDirectory}/mvn.properties  -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.9.0</version><!-- 3.6.1 -->
        <executions>
          <!-- TBD: clarify where needed -->
          <!--execution>
						<?m2e execute onConfiguration,onIncremental?>
						<id>determine-properties</id>
						<phase>initialize</phase>
						<goals>
							<goal>properties</goal>
						</goals>
					</execution-->

          <execution>
            <?m2e execute onConfiguration,onIncremental?>
            <id>unpack-latex-bibs-interfaces-src-build</id>
            <phase>initialize</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
          </execution>

          <!-- not necessary because maven-jxr-plugin used -->
          <!--execution>
						<id>unpack-latex-bibs-interfaces-src-site</id>
						<phase>pre-site</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
					</execution-->

          <execution>
            <?m2e execute onConfiguration,onIncremental?>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>
              <outputFile>${project.build.directory}/classpath.txt</outputFile>
            </configuration>
          </execution>

        </executions>

        <configuration>
          <artifactItems>
            <artifactItem>
              <groupId>eu.simuline.m2latex</groupId>
              <artifactId>latex-maven-plugin</artifactId>
              <version>${versionLatexPlugin}</version>
              <type>jar</type>
              <overWrite>true</overWrite>
              <outputDirectory>${instDir}</outputDirectory>
              <includes>
                injections/instVScode4tex.sh,
                injections/instTexlive.sh,
                injections/instTexliverc,
                injections/switchTexlive.sh,
                injections/packagesTexlive4*.txt
              </includes>
              <fileMappers>
                <org.codehaus.plexus.components.io.filemappers.FlattenFileMapper />
              </fileMappers>
            </artifactItem>

            <artifactItem>
              <groupId>eu.simuline.m2latex</groupId>
              <artifactId>latex-maven-plugin</artifactId>
              <version>${versionLatexPlugin}</version>
              <type>jar</type>
              <overWrite>true</overWrite>
              <outputDirectory>src/site/tex</outputDirectory>
              <includes>litLMPpub.bib</includes>
              <fileMappers>
                <org.codehaus.plexus.components.io.filemappers.IdentityMapper />
              </fileMappers>
            </artifactItem>
          </artifactItems>

        </configuration>
      </plugin>


      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.14.1</version><!-- 3.13.0 -->
        <configuration>
          <compilerArgs>
            <arg>-g</arg>
            <arg>-Xlint:unchecked</arg>
          </compilerArgs>
          <source>${versionJava}</source>
          <target>${versionJava}</target>
        </configuration>
      </plugin>


      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.5.0</version><!-- 3.4.1 -->
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <!--addDefaultSpecificationEntries>true</addDefaultSpecificationEntries-->
            </manifest>
          </archive>
        </configuration>
      </plugin>


      <!-- writes the tar.gz file for the suse tumbleweed installer -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>3.8.0</version><!-- 3.7.1 -->
        <executions>
          <execution>
            <id>assemble_tgz</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <appendAssemblyId>true</appendAssemblyId>
              <descriptors>
                <descriptor>src${file.separator}assembly${file.separator}installer.xml</descriptor>
              </descriptors>
              <!--formats>tar.gz</formats-->
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>3.1.4</version><!-- 3.1.1 -->
      </plugin>


      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>3.1.4</version><!-- 3.1.1 -->
      </plugin>

      <!-- javadoc plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.12.0</version><!-- 3.6.3 -->
        <configuration>
          <breakiterator>true</breakiterator>
          <show>private</show>
          <source>${versionJava}</source>
        </configuration>
      </plugin>


      <!-- <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.2.4</version>
        <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-surefire-plugin</artifactId>
        <version>${versionTestPlugins}</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>4.0.0-M16</version><!-- 4.0.0-M13 -->
        <dependencies>
          <!-- Add doxia-module-markdown as dependency for the plugin -->
          <dependency>
            <groupId>org.apache.maven.doxia</groupId>
            <artifactId>doxia-module-markdown</artifactId>
            <version>2.0.0-M8</version><!-- 2.0.0-M10 does not work -->
          </dependency>
        </dependencies>
        <!--configuration>
          <locales>en</locales>
        </configuration-->
      </plugin>

      <!-- create html and pdf and other formats from latex -->
      <!-- this is activated for developer tests only -->
      <plugin>
        <groupId>eu.simuline.m2latex</groupId>
        <artifactId>latex-maven-plugin</artifactId>
        <version>${versionLatexPlugin}</version>

        <configuration>
          <settings>
            <!-- not synchronized with .latexmkrc -->
            <latex2pdfCommand>lualatex</latex2pdfCommand>
            <cleanUp>false</cleanUp>
            <targets>chk,pdf</targets>
            <!--texSrcDirectory>src/main/resources/eu/simuline/qMngmnt/latex</texSrcDirectory-->
            <!-- synchronized with .latexmkrc -->
            <!--chkTexOptions>-q -b0</chkTexOptions-->
          </settings>
        </configuration>
        <executions>

          <execution>
            <id>process-latex-sources</id>
            <goals>
              <goal>cfg</goal>
            </goals>
          </execution>

          <execution>
            <id>clear-latex-sources</id>
            <goals>
              <goal>clr</goal>
            </goals>
          </execution>

          <execution>
            <?m2e execute onConfiguration?>
            <id>inject-files</id>
            <goals>
              <goal>inj</goal>
            </goals>
            <configuration>              <!-- latexmkrc,chktexrc,vscodeExt,header -->
              <injections>latexmkrc,chktexrc,header</injections>
            </configuration>
          </execution>

          <execution>
            <id>validate-converters</id>
            <goals>
              <goal>vrs</goal>
            </goals>
            <configuration>
              <versionsWarnOnly>true</versionsWarnOnly>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.9.0</version><!-- 3.5.0 -->
        <configuration>
          <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
        </configuration>
      </plugin>

      <!-- as a side effect, triggers 'generate-sources' forked phase execution  -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>3.6.0</version><!-- 3.3.2 -->
      </plugin>


      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>${versionTestPlugins}</version>
        <reportSets />
      </plugin>

      <!-- offers also command line analysis:
      mvn versions:display-plugin-updates
      mvn versions:display-dependency-updates
      mvn versions:display-property-updates
      -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <!-- TBD: uniform version -->
        <version>2.20.1</version><!-- 2.16.2 -->
        <reportSets>
          <reportSet>
            <reports>
              <report>dependency-updates-report</report>
              <report>plugin-updates-report</report>
              <report>property-updates-report</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-changes-plugin</artifactId>
        <version>3.0.0-M3</version><!-- 2.12.1 -->
        <reportSets>
          <reportSet>
            <reports>
              <report>changes</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>

    </plugins>
  </reporting>


</project>
