<?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">
	<modelVersion>4.0.0</modelVersion>
	<groupId>com.flowingcode.vaadin.addons</groupId>
	<artifactId>error-window-vaadin</artifactId>
	<version>4.2.1-SNAPSHOT</version>
	<name>Error Window Add-on</name>
	<description>Error handler that displays a dialog with exception information</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>

	<prerequisites>
		<maven>3</maven>
	</prerequisites>
	
	<inceptionYear>2017</inceptionYear>
	<organization>
		<name>Flowing Code</name>
		<url>https://www.flowingcode.com</url>
	</organization>

	<scm>
		<url>https://github.com/FlowingCode/ErrorWindowAddon</url>
		<connection>scm:git:git://github.com/FlowingCode/ErrorWindowAddon.git</connection>
		<developerConnection>scm:git:ssh://git@github.com:/FlowingCode/ErrorWindowAddon.git</developerConnection>
		<tag>HEAD</tag>
	</scm>
	
	<issueManagement>
		<system>GitHub</system>
		<url>https://github.com/FlowingCode/ErrorWindowAddon</url>
	</issueManagement>

	<licenses>
		<license>
			<name>Apache 2</name>
			<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	
	<properties>
        <vaadin.version>14.11.11</vaadin.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jetty.version>9.4.36.v20210114</jetty.version>
        <flowingcode.commons.demo.version>3.10.0</flowingcode.commons.demo.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>${vaadin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>Vaadin Directory</id>
            <url>https://maven.vaadin.com/vaadin-addons</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
            <optional>true</optional>
            <exclusions>
                <!-- Webjars are only needed when running in Vaadin 13 compatibility mode in V14.
                     Your add-on can support npm in the same version mode and V13 compatiblity mode at the same time,
                     or with separate versions. Any V13 version should work with the compatibility mode in V14. -->
                <exclusion>
                    <groupId>com.vaadin.webjar</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.webjars.bowergithub.insites</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.webjars.bowergithub.polymer</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.webjars.bowergithub.polymerelements</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.webjars.bowergithub.vaadin</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.webjars.bowergithub.webcomponents</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>3.0.1</version>
			<scope>provided</scope>
		</dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>
		<dependency>
		    <groupId>junit</groupId>
		    <artifactId>junit</artifactId>
		    <version>4.13.1</version>
		    <scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.flowingcode.vaadin.addons.demo</groupId>
			<artifactId>commons-demo</artifactId>
			<version>${flowingcode.commons.demo.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>javax.annotation</groupId>
			<artifactId>javax.annotation-api</artifactId>
			<version>1.3.2</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>jakarta.annotation</groupId>
			<artifactId>jakarta.annotation-api</artifactId>
			<version>2.1.1</version>
			<optional>true</optional>
		</dependency>
    </dependencies>

    <build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-release-plugin</artifactId>
					<version>3.0.1</version>
					<configuration>
						<releaseProfiles>release</releaseProfiles>
					</configuration>
				</plugin>
				<plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>
			</plugins>
		</pluginManagement>
		
        <plugins>
			
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>license-maven-plugin</artifactId>
				<version>1.14</version>    
				<configuration>
					<licenseName>apache_v2</licenseName>
					<addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>
				</configuration>
			</plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addClasspath>false</addClasspath>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Vaadin-Package-Version>1</Vaadin-Package-Version>
                        </manifestEntries>
                    </archive>
                </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>io.smallrye</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>			
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.version}</version>
                <configuration>
                	<systemProperties>
                		<systemProperty>
                			<key>vaadin.i18n.provider</key>
                			<value>com.flowingcode.vaadin.addons.errorwindow.TranslationProvider</value>
                		</systemProperty>
                	</systemProperties>
                    <scanIntervalSeconds>3</scanIntervalSeconds>
                    <!-- Use test scope because the UI/demo classes are in
                            the test package. -->
                    <useTestScope>true</useTestScope>
                    <supportedPackagings>
                        <supportedPackaging>jar</supportedPackaging>
                    </supportedPackagings>
                </configuration>
            </plugin>
            <plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>2.22.1</version>
				<configuration>
					<useSystemClassLoader>false</useSystemClassLoader>
				</configuration>
			</plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>directory</id>
            <build>
                <plugins>
                    <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>
					<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>
				</plugins>
			</build>
		</profile>

		<!-- Run (demo) in production mode -->
		<profile>
			<id>production</id>
			<properties>
				<vaadin.productionMode>true</vaadin.productionMode>
			</properties>
			<dependencies>
				<dependency>
					<groupId>com.vaadin</groupId>
					<artifactId>flow-server-production-mode</artifactId>
				</dependency>
			</dependencies>

			<build>
				<plugins>
					<plugin>
						<groupId>com.vaadin</groupId>
						<artifactId>vaadin-maven-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>build-frontend</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		<profile>
			<id>demo-jar</id>
            <build>		
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-jar-plugin</artifactId>
						<executions>
							<execution>
								<goals>
									<goal>test-jar</goal>
								</goals>
								<configuration>
									<classifier>demo</classifier>
									<excludes>
										<exclude>META-INF/resources/frontend/styles/shared-styles.css</exclude>
										<exclude>**/test/*</exclude>
										<exclude>**/integration/*</exclude>
										<exclude>**/DemoView.class</exclude>
										<exclude>**/DemoLayout.class</exclude>
									</excludes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>

		<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>v23</id>
			<properties>
				<vaadin.version>23.3.5</vaadin.version>
				<maven.compiler.source>11</maven.compiler.source>
				<maven.compiler.target>11</maven.compiler.target>				
			</properties>
		</profile>
	    
		<profile>
			<id>v24</id>
			<properties>
				<maven.compiler.source>17</maven.compiler.source>
				<maven.compiler.target>17</maven.compiler.target>
				<vaadin.version>24.2.6</vaadin.version>
				<jetty.version>11.0.12</jetty.version>
			</properties>
			<repositories>
				<repository>
					<id>vaadin-prerelease</id>
					<url>https://maven.vaadin.com/vaadin-prereleases</url>
				</repository>
			</repositories>
			<pluginRepositories>
				<pluginRepository>
					<id>vaadin-prerelease</id>
					<url>https://maven.vaadin.com/vaadin-prereleases</url>
				</pluginRepository>
			</pluginRepositories>
			<dependencies>
				<dependency>
					<groupId>jakarta.servlet</groupId>
					<artifactId>jakarta.servlet-api</artifactId>
					<version>6.0.0</version>
					<scope>provided</scope>
				</dependency>
			</dependencies>
		</profile>		

		<profile>
			<id>v25</id>
			<properties>
				<maven.compiler.source>21</maven.compiler.source>
				<maven.compiler.target>21</maven.compiler.target>
				<vaadin.version>25.1-SNAPSHOT</vaadin.version>
				<jetty.version>11.0.26</jetty.version>
				<flowingcode.commons.demo.version>5.2.0</flowingcode.commons.demo.version>
			</properties>
			<dependencies>
				<dependency>
					<groupId>jakarta.servlet</groupId>
					<artifactId>jakarta.servlet-api</artifactId>
					<version>6.0.0</version>
					<scope>provided</scope>
				</dependency>			
				<dependency>
					<groupId>com.vaadin</groupId>
					<artifactId>vaadin-dev</artifactId>
					<optional>true</optional>
				</dependency>
			</dependencies>
		</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>
		
	</profiles>

</project>
