<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0"
         xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.vaadin</groupId>   
    <artifactId>vaadin-spreadsheet</artifactId>
    <version>3.1.1</version>
    
    <packaging>jar</packaging>
    <name>Vaadin Spreadsheet</name>
    <inceptionYear>2013</inceptionYear>

    <organization>
        <name>Vaadin Ltd</name>
        <url>https://vaadin.com</url>
    </organization>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <currentYear>2026</currentYear>
        
        <vaadin.version>8.30.1</vaadin.version>
        <charts.version>4.3.5</charts.version>
        <testbench.version>5.1.2</testbench.version>
        <jetty.version>9.4.54.v20240208</jetty.version>
        <javax.servlet.version>3.0.1</javax.servlet.version>
        <junit.version>4.13.2</junit.version>
        <poi.version>5.2.2</poi.version>

        <testbench.api.version>${vaadin.version}</testbench.api.version>
        <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
    </properties>

    <licenses>
        <license>
            <name>Vaadin Commercial License and Service Terms</name>
            <url>https://vaadin.com/commercial-license-and-service-terms</url>
        </license>
    </licenses>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <archive>
                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                <index>true</index>
                                <manifest>
                                    <addClasspath>true</addClasspath>
                                    <!-- Implementation-Title and Implementation-Version
                                        come from the POM by default -->
                                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                </manifest>
                                <manifestEntries>
                                    <!-- Package format version - do not change -->
                                    <Vaadin-Package-Version>1</Vaadin-Package-Version>
        
                                    <!-- Add-on specific fields to update -->
                                    <AdVaaLicen>VCL</AdVaaLicen>
                                    <AdVaaName>vaadin-spreadsheet</AdVaaName>
                                    <AdVaaPkg>com.vaadin.addon.spreadsheet.client</AdVaaPkg>
        
                                    <!-- Implementation-Title and Implementation-Version
                                        come from the POM by default -->
                                    <Implementation-Title>${project.name}</Implementation-Title>
        
                                    <!-- Comma-separated list of widgetsets in the
                                        package -->
                                    <Vaadin-Widgetsets>com.vaadin.addon.spreadsheet.Widgetset</Vaadin-Widgetsets>
        
                                    <!-- Stylesheet -->
                                    <Vaadin-Stylesheets>VAADIN/addons/spreadsheet/spreadsheet.scss</Vaadin-Stylesheets>
                                </manifestEntries>
                            </archive>
                        </configuration>
                    </execution>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.4</version>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <manifestLocation>${project.build.outputDirectory}/META-INF</manifestLocation>
                    <excludeDependencies>*;scope=provided|runtime</excludeDependencies>
                    <!-- <excludeDependencies>vaadin-client,vaadin-server</excludeDependencies> -->
                    <instructions>
                        <Export-Package>com.vaadin.addon.spreadsheet,com.vaadin.addon.spreadsheet.action,com.vaadin.addon.spreadsheet.command</Export-Package>
                        <!-- Ignore GWT stuff, not needed in osgi bundles,
                            GWT compilation seldom happens in such -->
                        <Import-Package>!com.google.gwt.*,org.apache.poi.ss.formula,
                            !com.vaadin.client.*, *</Import-Package>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.6.3</version>
                <configuration>
					<doclint>none</doclint>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeScope>runtime</includeScope>
                            <outputDirectory>target/libs</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <finalName>directorystuff</finalName>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptors>
                        <descriptor>assembly/assembly.xml</descriptor>
                    </descriptors>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <webappDirectory>${project.build.directory}/testwebapp/VAADIN/widgetsets</webappDirectory>
                            <extraJvmArgs>-Xmx1g -Xms1g</extraJvmArgs>
                            <hostedWebapp>${project.build.directory}/testwebapp</hostedWebapp>
                            <noServer>true</noServer>
                            <runTarget>http://localhost:9998/</runTarget>
                            <draftCompile>true</draftCompile>
                            <style>PRETTY</style>
                            <module>com.vaadin.addon.spreadsheet.Widgetset</module>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- Testing -->
            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <includes>
                        <include>**/junit/*</include>
                    </includes>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.17</version>
                <configuration>
                    <excludes>
                        <!-- Files here might match to naming convetions,
                            but the are just vaadin apps containing you add-on components in varios setups.
                            We can ignore them from test. -->
                        <exclude>**/demoapps/**/*</exclude>
                        <exclude>**/Abstract*</exclude>
                        <exclude>**/junit/*</exclude>
                    </excludes>
                    <includes>
                        <include>**/*Test*.java</include>
                    </includes>
                    <systemPropertyVariables>
                        <property>
                            <name>tb.hub</name>
                            <value>${tb.hub}</value>
                        </property>
                    </systemPropertyVariables>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <webResources>
                        <webResource>
                            <targetpath>testwebapp</targetpath>
                        </webResource>

                    </webResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <configuration>
                    <httpConnector>
                        <port>9998</port>
                    </httpConnector>
                    <useTestClasspath>true</useTestClasspath>
                    <useTestScope>true</useTestScope>
                    <supportedPackagings>jar</supportedPackagings>
                    <stopKey>STOP</stopKey>
                    <stopPort>8005</stopPort>
                    <webAppConfig>
                        <webInfIncludeJarPattern>
                            .*vaadin.*
                        </webInfIncludeJarPattern>
                        <contextPath>/</contextPath>
                        <resourceBases>
                            <resourceBase>${project.build.directory}/testwebapp</resourceBase>
                            <!--Vaadin classloader can't find the theme without this-->
                            <resourceBase>${project.build.outputDirectory}</resourceBase>
                        </resourceBases>
                    </webAppConfig>
                </configuration>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <!-- Compile widget set for integration testing -->
                <plugin>
                    <groupId>com.vaadin</groupId>
                    <artifactId>vaadin-maven-plugin</artifactId>
                    <version>${vaadin.version}</version>
                    <configuration>
                        <webappDirectory>${project.build.directory}/testwebapp/VAADIN/widgetsets</webappDirectory>
                        <extraJvmArgs>-Xmx1g -Xms1g</extraJvmArgs>
                        <hostedWebapp>${project.build.directory}/testwebapp</hostedWebapp>
                        <noServer>true</noServer>
                        <runTarget>http://localhost:9998/</runTarget>
                        <draftCompile>true</draftCompile>
                        <style>PRETTY</style>
                        <module>com.vaadin.addon.spreadsheet.Widgetset</module>

                        <strict>true</strict>
                    </configuration>
                </plugin>

                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.0.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                copy-dependencies
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.vaadin</groupId>
                                        <artifactId>
                                            vaadin-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [7.0-SNAPSHOT,)
                                        </versionRange>
                                        <goals>
                                            <goal>compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <!-- This is needed for the sources required by the client-side compiler
            to be included in the produced JARs -->
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <excludes>
                    <exclude>rebel.xml</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/webapp</directory>
            </resource>
        </resources>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>vaadin-prereleases</id>
            <name>Vaadin Pre-releases</name>
            <url>https://maven.vaadin.com/vaadin-prereleases/</url>
        </snapshotRepository>
        <repository>
            <id>vaadin-addons</id>
            <name>Vaadin add-ons repository</name>
            <url>https://tools.vaadin.com/nexus/content/repositories/vaadin-addons</url>
        </repository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>https://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <name>Vaadin Pre-releases</name>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-push</artifactId>
            <version>${vaadin.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiler</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-compatibility-themes</artifactId>
            <version>${vaadin.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${javax.servlet.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-testbench</artifactId>
            <version>${testbench.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-testbench-api</artifactId>
            <version>${testbench.api.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spreadsheet-testbench-api</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${poi.version}</version>
            <exclusions>
            	<exclusion>
            		<groupId>org.apache.poi</groupId>
            		<artifactId>poi-ooxml-lite</artifactId>
            	</exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml-full</artifactId>
            <version>${poi.version}</version>
        </dependency>

        <!-- Required for some reflection issues -->
        <dependency>
            <groupId>org.javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.30.2-GA</version>
        </dependency>
        
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.6.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>


    <profiles>
        <profile>
            <id>verify-only-phantom</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <browsers.include>phantomjs2</browsers.include>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>verify-local-phantom</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <systemPropertyVariables>
                                <localPhantom>true</localPhantom>
                            </systemPropertyVariables>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>start-jetty-for-it</id>
            <activation>
                <property>
                    <name>skipTests</name>
                    <value>!true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <executions>
                            <!-- start and stop jetty (running our app) when running integration
                                 tests -->
                            <execution>
                                <id>start-jetty</id>
                                <phase>pre-integration-test</phase>

                                <goals>
                                    <goal>start</goal>
                                </goals>
                                <configuration>
                                    <scanIntervalSeconds>0</scanIntervalSeconds>
                                </configuration>
                            </execution>
                            <execution>
                                <id>stop-jetty</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                        <dependencies>
	                        <dependency>
					            <groupId>com.vaadin</groupId>
					            <artifactId>vaadin-server</artifactId>
					            <version>${vaadin.version}</version>
					        </dependency>
					        <dependency>
					            <groupId>com.vaadin</groupId>
					            <artifactId>vaadin-client</artifactId>
					            <version>${vaadin.version}</version>
					        </dependency>
					        <dependency>
					            <groupId>com.vaadin</groupId>
					            <artifactId>vaadin-themes</artifactId>
					            <version>${vaadin.version}</version>
					        </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Profile for updating license headers. -->
            <id>license</id>
            
            <build>
                <plugins>
                    <plugin> 
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>4.3</version>
                        <configuration>
                            <header>src/license/header.txt</header>
                            <quiet>false</quiet>
                            <failIfMissing>true</failIfMissing>
                            <aggregate>false</aggregate>
                            <useDefaultExcludes>true</useDefaultExcludes>
                            <useDefaultMapping>true</useDefaultMapping>
                            <encoding>UTF-8</encoding>
                            <properties>
                                <year>${currentYear}</year>
                            </properties>
                            <includes>
                                <include>/**/*.java</include>
                                <include>*.java</include>
                            </includes>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
