<?xml version="1.0" encoding="UTF-8"?>
<!--
  #%L
  EUGene
  %%
  Copyright (C) 2004 - 2026 Code Lutin
  %%
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Lesser General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Lesser Public License for more details.
  You should have received a copy of the GNU General Lesser Public
  License along with this program.  If not, see
  <http://www.gnu.org/licenses/lgpl-3.0.html>.
  #L%
  -->
<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>

  <parent>
    <groupId>org.nuiton</groupId>
    <artifactId>nuitonpom</artifactId>
    <version>12.1</version>
  </parent>

  <artifactId>eugene</artifactId>
  <version>3.2-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>EUGene</name>
  <description>Efficient Universal Generator</description>
  <url>https://nuiton.page.nuiton.org/eugene/</url>
  <inceptionYear>2004</inceptionYear>

  <modules>
    <module>eugene</module>
    <module>eugene-java-templates</module>
    <module>eugene-plantuml-templates</module>
    <module>eugene-yaml-templates</module>
    <module>eugene-maven-plugin</module>
  </modules>

  <scm>
    <connection>scm:git:git@gitlab.nuiton.org:nuiton/eugene.git</connection>
    <developerConnection>scm:git:git@gitlab.nuiton.org:nuiton/eugene.git</developerConnection>
    <url>https://gitlab.nuiton.org/nuiton/eugene</url>
  </scm>

  <properties>

    <gitlabProjectName>eugene</gitlabProjectName>

    <processorPluginVersion>1.4</processorPluginVersion>
    <nuitonUtilsVersion>3.2</nuitonUtilsVersion>
    <nuitonI18nVersion>4.3</nuitonI18nVersion>
    <plantumlVersion>8059</plantumlVersion>
    <snakeyamlVersion>2.6</snakeyamlVersion>
    <antlr4Version>4.9.0</antlr4Version>

    <doxiaVersion>2.1.0</doxiaVersion>
    <mavenVersion>3.9.15</mavenVersion>

    <!-- Java level configuration -->
    <javaVersion>1.8</javaVersion>
    <signatureArtifactId>java18</signatureArtifactId>
    <signatureVersion>1.0</signatureVersion>

    <!-- I18n configuration -->
    <i18n.failsIfAnyKeyMissingValue>true</i18n.failsIfAnyKeyMissingValue>
    <i18n.checkBundle>true</i18n.checkBundle>
    <i18n.showEmpty>true</i18n.showEmpty>

    <!-- Pour garder la continuité des TAGs Git, on déclare explicitement le préfixe -->
    <gitflow.versionTagPrefix>v</gitflow.versionTagPrefix>

    <!-- Coverage Properties -->
    <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
    <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
    <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/../target/site/jacoco-aggregate-all/jacoco.xml
    </sonar.coverage.jacoco.xmlReportPaths>
  </properties>

  <dependencyManagement>
    <dependencies>

      <!-- Commons -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.5.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.20.0</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.22.0</version>
      </dependency>
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.3.6</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-configuration2</artifactId>
        <version>2.15.0</version>
      </dependency>

      <!-- Guava -->
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>33.6.0-jre</version>
      </dependency>

      <!-- Nuiton -->
      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>nuiton-utils</artifactId>
        <version>${nuitonUtilsVersion}</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <groupId>org.nuiton.i18n</groupId>
        <artifactId>nuiton-i18n</artifactId>
        <version>${nuitonI18nVersion}</version>
        <scope>compile</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-digester3</artifactId>
        <version>3.2</version>
        <scope>compile</scope>
      </dependency>

      <!-- JAXP parser impl for digester -->
      <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.12.2</version>
        <scope>runtime</scope>
        <exclusions>
          <exclusion>
            <groupId>xml-apis</groupId>
            <artifactId>xml-apis</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>net.sourceforge.saxon</groupId>
        <artifactId>saxon</artifactId>
        <version>9.1.0.8</version>
      </dependency>

      <!-- dom4j dep -->
      <dependency>
        <groupId>jaxen</groupId>
        <artifactId>jaxen</artifactId>
        <version>2.0.3</version>
        <scope>runtime</scope>
        <exclusions>
          <exclusion>
            <groupId>com.ibm.icu</groupId>
            <artifactId>icu4j</artifactId>
          </exclusion>
          <exclusion>
            <groupId>xerces</groupId>
            <artifactId>xmlParserAPIs</artifactId>
          </exclusion>
          <exclusion>
            <groupId>xalan</groupId>
            <artifactId>xalan</artifactId>
          </exclusion>
          <exclusion>
            <groupId>maven-plugins</groupId>
            <artifactId>maven-cobertura-plugin</artifactId>
          </exclusion>
          <exclusion>
            <groupId>maven-plugins</groupId>
            <artifactId>maven-findbugs-plugin</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Meta model UML d'Eclipse -->
      <dependency>
        <groupId>org.eclipse.uml2.uml</groupId>
        <artifactId>resources</artifactId>
        <version>2.1.0-v200706251652</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.eclipse.uml2</groupId>
            <artifactId>uml</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.nuiton</groupId>
        <artifactId>helper-maven-plugin-api</artifactId>
        <version>${helperPluginVersion}</version>
        <exclusions>

          <exclusion>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-dependency-tree</artifactId>
          </exclusion>

          <exclusion>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
          </exclusion>

        </exclusions>
      </dependency>

      <!-- see http://stackoverflow.com/a/32918434/2038100 -->
      <dependency>
        <groupId>com.tunnelvisionlabs</groupId>
        <artifactId>antlr4-runtime</artifactId>
        <version>${antlr4Version}</version>
      </dependency>
      <dependency>
        <groupId>com.tunnelvisionlabs</groupId>
        <artifactId>antlr4-annotations</artifactId>
        <version>${antlr4Version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>${mavenVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-core</artifactId>
        <version>${mavenVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-model</artifactId>
        <version>${mavenVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-artifact</artifactId>
        <version>${mavenVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-settings</artifactId>
        <version>${mavenVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>${pluginPluginVersion}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.reporting</groupId>
        <artifactId>maven-reporting-api</artifactId>
        <version>4.0.0</version>
      </dependency>
      <dependency>
        <groupId>org.apache.maven.reporting</groupId>
        <artifactId>maven-reporting-impl</artifactId>
        <version>4.0.0</version>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-i18n</artifactId>
        <version>1.1.0</version>
        <exclusions>
          <exclusion>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-component-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-component-annotations</artifactId>
        <version>2.2.0</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.doxia</groupId>
        <artifactId>doxia-sink-api</artifactId>
        <version>${doxiaVersion}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.maven.doxia</groupId>
        <artifactId>doxia-site-renderer</artifactId>
        <version>${doxiaVersion}</version>
        <exclusions>
          <exclusion>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-container-default</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.codehaus.plexus</groupId>
        <artifactId>plexus-utils</artifactId>
        <version>4.0.3</version>
      </dependency>

      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>${snakeyamlVersion}</version>
      </dependency>

      <dependency>
        <groupId>net.sourceforge.plantuml</groupId>
        <artifactId>plantuml</artifactId>
        <version>${plantumlVersion}</version>
      </dependency>

      <dependency>
        <groupId>xml-apis</groupId>
        <artifactId>xml-apis</artifactId>
        <!-- Do not use version 2.0.0 nor 2.0.2, they miss ElementTraversal class needed by eugene:help -->
        <version>1.4.01</version>
        <scope>runtime</scope>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.2</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>

        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <dependencies>
            <dependency>
              <groupId>org.nuiton.jrst</groupId>
              <artifactId>doxia-module-jrst</artifactId>
              <version>2.4</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.nuiton.processor</groupId>
          <artifactId>processor-maven-plugin</artifactId>
          <version>${processorPluginVersion}</version>
        </plugin>

        <plugin>
          <groupId>org.nuiton.i18n</groupId>
          <artifactId>i18n-maven-plugin</artifactId>
          <version>${nuitonI18nVersion}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <configuration>
            <extraExtensions>
              <objectmodel>xml</objectmodel>
              <xsd>xml</xsd>
            </extraExtensions>
          </configuration>
        </plugin>

      </plugins>
    </pluginManagement>

    <plugins>
      <!--For sonar code coverage-->
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>jacoco-site-aggregate</id>
            <phase>verify</phase>
            <goals>
              <goal>report-aggregate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <inherited>true</inherited>
        <executions>
          <execution>
            <id>analyze</id>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <verbose>true</verbose>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

  <profiles>
    <profile>
      <id>reporting</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>

      <build>
        <plugins>
          <plugin><!-- copy object model xsd to site -->
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>

              <execution>
                <id>xsd-to-site</id>
                <phase>pre-site</phase>
                <configuration>
                  <target>
                    <copy todir="target/site/xsd/v1" verbose="${maven.verbose}" failonerror="false" overwrite="true">
                      <fileset dir="${basedir}/eugene/src/main/resources/xsd">
                        <include name="**/*.xsd" />
                      </fileset>
                    </copy>
                    <copy todir="target/site/dtd/v1" verbose="${maven.verbose}" failonerror="false" overwrite="true">
                      <fileset dir="${basedir}/eugene/src/main/resources/dtd">
                        <include name="**/*.dtd" />
                      </fileset>
                    </copy>
                  </target>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
