<?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>

  <groupId>com.flowingcode.vaadin.addons.demo</groupId>
  <artifactId>commons-demo</artifactId>
  <version>5.3.2-SNAPSHOT</version>
  
  <name>Commons Demo</name>
  <description>Common classes for add-ons demo</description>
  <url>https://www.flowingcode.com/en/open-source/</url>

  <developers>
    <developer>
      <id>flowingcode</id>
      <organization>Flowing Code</organization>
      <organizationUrl>https://www.flowingcode.com</organizationUrl>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <vaadin.version>24.3.13</vaadin.version>
    <jetty.version>11.0.26</jetty.version>
  </properties>

  <organization>
<name>Flowing Code</name>
<url>https://www.flowingcode.com</url>
  </organization>
  <inceptionYear>2020</inceptionYear>
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/FlowingCode/CommonsDemo</url>
    <connection>scm:git:git://github.com/FlowingCode/CommonsDemo.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:/FlowingCode/CommonsDemo.git</developerConnection>
    <tag>master</tag>
  </scm>

  <repositories>
    <repository>
      <id>central</id>
      <url>https://repo.maven.apache.org/maven2</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>
  	
  <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
  </dependencyManagement>
    
  <dependencies>
    <dependency>
      <groupId>com.vaadin</groupId>
      <artifactId>vaadin-core</artifactId>
      <optional>true</optional>
    </dependency>
        
    <dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>1.18.34</version>
		<scope>provided</scope>
	</dependency>
	
	<dependency>
		<groupId>jakarta.servlet</groupId>
		<artifactId>jakarta.servlet-api</artifactId>
		<version>6.0.0</version>
		<scope>provided</scope>
	</dependency>
		
    <dependency>
        <groupId>com.flowingcode.vaadin.addons</groupId>
        <artifactId>enhanced-tabs-addon</artifactId>
        <version>1.2.0</version>
    </dependency>
    
    <dependency>
        <groupId>com.flowingcode.vaadin</groupId>
        <artifactId>json-migration-helper</artifactId>
        <version>0.9.2</version>
    </dependency>
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <scope>test</scope>
    </dependency>
    
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-testbench</artifactId>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.webjars.bowergithub.polymer</groupId>
                <artifactId>polymer</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    
    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>6.3.2</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>net.java.dev.jna</groupId>
                <artifactId>jna</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>1.14</version>
          <configuration>
            <licenseName>apache_v2</licenseName>
            <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
              <excludes>
                <exclude>**/AppShellConfiguratorImpl.class</exclude>
                <exclude>**/main/resources/META-INF/resources/frontend/prism.js</exclude>
                <exclude>**/main/resources/META-INF/resources/frontend/prism.css</exclude>
                <exclude>**/test/resources/**</exclude>
                <exclude>**/main/dev-bundle/**</exclude>
              </excludes>
          </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>${jetty.version}</version>
            <configuration>
                <scanIntervalSeconds>3</scanIntervalSeconds>
                <!-- Use test scope because the UI/demo classes are in
                        the test package. -->
                <useTestScope>true</useTestScope>
                <supportedPackagings>
                    <supportedPackaging>jar</supportedPackaging>
                </supportedPackagings>
                <webApp>
                    <resourceBases>
                        <resourceBase>src/main/resources/META-INF/resources</resourceBase>
                        <resourceBase>src/test/resources/META-INF/resources</resourceBase>
                    </resourceBases>
                </webApp>
            </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <!-- Generated file that shouldn't be included in add-ons -->
                <excludes>
                    <exclude>META-INF/VAADIN/config/flow-build-info.json</exclude>
                </excludes>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-frontend</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.11.1</version>
             <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <quiet>true</quiet>
                <doclint>none</doclint>
                <failOnWarnings>true</failOnWarnings>
                <links>
                    <link>https://javadoc.io/doc/com.vaadin/vaadin-platform-javadoc/${vaadin.version}</link>
                </links>
            </configuration>
        </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
        <id>gpg</id>
        <activation>
            <property>
                <name>env.MAVEN_GPG_PASSPHRASE</name>
            </property>
        </activation>
        <build>
            <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>3.2.7</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
  </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.8.0</version>
                        <extensions>true</extensions>
                    </plugin>
                </plugins>
            </build>
       </profile>

       <profile>
           <id>v25</id>
           <properties>
               <maven.compiler.source>21</maven.compiler.source>
               <maven.compiler.target>21</maven.compiler.target>
               <vaadin.version>25.0.0</vaadin.version>
           </properties>
           <dependencies>
               <dependency>
                   <groupId>com.vaadin</groupId>
                   <artifactId>vaadin-dev</artifactId>
                   <optional>true</optional>
               </dependency>
           </dependencies>
       </profile>

  </profiles>

</project>
