<?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>org.zkoss.chart</groupId>
	<artifactId>zkcharts</artifactId>
	<version>12.5.0.0-Eval</version>
	<properties>
		<zk.version>9.6.5-Eval</zk.version>
		<servlet.version>3.1.0</servlet.version>
		<commons-io>2.5</commons-io>
		<commons-codec>1.8</commons-codec>
		<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
		<packname>-${project.version}</packname>
		<zk-webdriver.version>1.4.39.0.3</zk-webdriver.version>
		<junit.version>5.11.0</junit.version>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.resources.overwrite>true</maven.resources.overwrite>
		<maven.test.skip>false</maven.test.skip>
		<junit.tags>any() | none()</junit.tags>
	</properties>
	<packaging>jar</packaging>
	<name>The ZK Charts library</name>
	<description>The ZK Charts library</description>
	<licenses>
		<license>
			<name>ZK Commercial License</name>
			<url>https://www.zkoss.org/license#commercial</url>
			<distribution>repo</distribution>
		</license>
	</licenses>
	<repositories>
		<repository>
			<id>ZK CE</id>
			<name>ZK CE Repository</name>
			<url>https://mavensync.zkoss.org/eval</url>
		</repository>
		<repository>
			<id>ZK EVAL</id>
			<name>ZK Evaluation Repository</name>
			<url>https://mavensync.zkoss.org/eval</url>
		</repository>
	</repositories>
	<pluginRepositories>
		<pluginRepository>
			<id>zkmaven</id>
			<name>ZK Maven Plugin Repository</name>
			<url>https://mavensync.zkoss.org/eval/</url>
		</pluginRepository>
	</pluginRepositories>
	<dependencies>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<version>${servlet.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zkbind</artifactId>
			<version>${zk.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zul</artifactId>
			<version>${zk.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zkplus</artifactId>
			<version>${zk.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zhtml</artifactId>
			<version>${zk.version}</version>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zkmax</artifactId>
			<version>${zk.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.zk</groupId>
			<artifactId>zuti</artifactId>
			<version>${zk.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.common</groupId>
			<artifactId>zweb-dsp</artifactId>
			<version>${zk.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>${commons-io}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<version>${commons-codec}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.hamcrest</groupId>
			<artifactId>hamcrest-core</artifactId>
			<version>2.2</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-api</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>net.javacrumbs.json-unit</groupId>
			<artifactId>json-unit</artifactId>
			<version>1.31.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.zkoss.test</groupId>
			<artifactId>zk-webdriver</artifactId>
			<version>${zk-webdriver.version}</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-compress</artifactId>
			<version>1.19</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.xmlunit</groupId>
			<artifactId>xmlunit-core</artifactId>
			<version>2.8.2</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
			<id>forkJVMTestOnly</id>
			<properties>
				<junit.tags>ForkJVMTestOnly</junit.tags>
			</properties>
		</profile>
		<profile>
			<id>noneForkJVMTestOnly</id>
			<properties>
				<junit.tags>!ForkJVMTestOnly</junit.tags>
			</properties>
		</profile>
	</profiles>
	<build>
		<plugins>
			<!-- Build jar excludes test class -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>3.4.0</version>
				<configuration>
					<!-- Almost all tests are integration test. So we disabled unit test phase -->
					<skipTests>true</skipTests>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-failsafe-plugin</artifactId>
				<version>3.4.0</version>
				<configuration>
					<groups>${junit.tags}</groups>
					<additionalClasspathElements>
						<additionalClasspathElement>${project.basedir}/src/test/java</additionalClasspathElement>
					</additionalClasspathElements>
					<includes>
						<include>**/*Test.java</include>
					</includes>
					<skipITs>${maven.test.skip}</skipITs>
					<systemPropertyVariables>
						<zkWebdriverContextPath>/zkcharts</zkWebdriverContextPath>
						<zkWebdriverTestURLPackage>org.zkoss.chart</zkWebdriverTestURLPackage>
						<zkWebdriverBaseResource>./src/test/webapp/</zkWebdriverBaseResource>
					</systemPropertyVariables>
					<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
						<disable>false</disable>
						<version>3.0.2</version>
						<usePhrasedFileName>false</usePhrasedFileName>
						<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
						<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
						<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
					</statelessTestsetReporter>
					<consoleOutputReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5ConsoleOutputReporter">
						<disable>false</disable>
						<encoding>UTF-8</encoding>
						<usePhrasedFileName>false</usePhrasedFileName>
					</consoleOutputReporter>
					<statelessTestsetInfoReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoReporter">
						<disable>false</disable>
						<usePhrasedFileName>false</usePhrasedFileName>
						<usePhrasedClassNameInRunning>true</usePhrasedClassNameInRunning>
						<usePhrasedClassNameInTestCaseSummary>true</usePhrasedClassNameInTestCaseSummary>
					</statelessTestsetInfoReporter>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>integration-test</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Run with Jetty -->
			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>10.0.11</version>
				<configuration>
					<httpConnector>
						<port>8083</port>
					</httpConnector>
					<stopKey>zkcharts-jetty</stopKey>
					<stopPort>10083</stopPort>
					<webAppSourceDirectory>${basedir}/src/test/webapp</webAppSourceDirectory>
					<classesDirectory>${basedir}/target/classes</classesDirectory>
					<webApp>
						<contextPath>/${project.artifactId}</contextPath>
						<webInfIncludeJarPattern>^$</webInfIncludeJarPattern>
						<containerIncludeJarPattern>^$</containerIncludeJarPattern>
					</webApp>
					<supportedPackagings>
						<supportedPackaging>jar</supportedPackaging>
					</supportedPackagings>
					<useTestScope>true</useTestScope>
				</configuration>
			</plugin>
			<!-- Compress javascript -->
			<plugin>
				<groupId>com.google.code.maven-replacer-plugin</groupId>
				<artifactId>replacer</artifactId>
				<version>1.5.3</version>
				<executions>
					<execution>
						<id>remove-sourcemap</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>replace</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<basedir>${project.build.directory}/classes/web</basedir>
					<filesToInclude>**/*.js</filesToInclude>
					<regex>true</regex>
					<token># sourceMappingURL=.*?\.map</token>
					<value/>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.8</version>
				<executions>
					<execution>
						<phase>process-resources</phase>
						<configuration>
							<target>
								<copy todir="${project.build.outputDirectory}/web">
									<fileset dir="${project.basedir}/src/main/resources/web">
										<exclude name="**/ext/**"/>
									</fileset>
									<globmapper from="*.js" to="*.src.js"/>
								</copy>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>com.github.blutorange</groupId>
				<artifactId>closure-compiler-maven-plugin</artifactId>
				<version>2.24.0</version>
				<executions>
					<execution>
						<phase>generate-resources</phase>
						<goals>
							<goal>minify</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<baseSourceDir>${basedir}/src/main/resources/web</baseSourceDir>
					<baseTargetDir>${project.build.outputDirectory}/web</baseTargetDir>
					<includes>
						<include>**/mold/charts.js</include>
						<include>**/Charts.js</include>
					</includes>
					<skipMerge>true</skipMerge>
					<closureCompilationLevel>WHITESPACE_ONLY</closureCompilationLevel>
					<closureEmitUseStrict>false</closureEmitUseStrict>
					<outputFilename>#{path}/#{basename}.#{extension}</outputFilename>
				</configuration>
			</plugin>
			<!-- Compile java -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.8.1</version>
				<configuration>
					<source>8</source>
					<target>8</target>
					<testSource>11</testSource>
					<testTarget>11</testTarget>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<version>3.2.0</version>
				<configuration>
					<finalName>${project.artifactId}</finalName>
					<outputDirectory>${project.build.directory}/bin</outputDirectory>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
						<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
					</archive>
					<excludes>
						<exclude>test/**</exclude>
					</excludes>
				</configuration>
			</plugin>
			<!-- Build javadoc -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<source>8</source>
				</configuration>
				<executions>
					<execution>
						<phase>package</phase>
						<configuration>
							<encoding>UTF-8</encoding>
							<charset>UTF-8</charset>
							<reportOutputDirectory>${project.basedir}/target/javadoc</reportOutputDirectory>
							<destDir>charts</destDir>
							<author>true</author>
							<show>protected</show>
							<version>true</version>
							<use>true</use>
							<windowtitle>${project.name} ${project.version} API</windowtitle>
							<doctitle>${project.name} ${project.version} API</doctitle>
							<!--suppress UnresolvedMavenProperty -->
							<bottom>Copyright &amp;copy; 2005-${current.year} Potix Corporation. All
								Rights Reserved.</bottom>
							<excludePackageNames>org.zkoss.chart.init:org.zkoss.chart.lic:org.zkoss.chart.rt</excludePackageNames>
							<doclint>none</doclint>
						</configuration>
						<goals>
							<goal>javadoc</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Pack zips -->
			<plugin>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<!-- Build sources.jar -->
					<execution>
						<id>sources</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>assembly/sources.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<!-- Build javadoc.zip -->
					<execution>
						<id>javadoc</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>${project.artifactId}-javadoc${packname}</finalName>
							<outputDirectory>${project.build.directory}/bin</outputDirectory>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>assembly/javadoc.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<!-- Build bin.zip -->
					<execution>
						<id>bin</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>${project.artifactId}-bin${packname}</finalName>
							<outputDirectory>${project.build.directory}/bin</outputDirectory>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>assembly/bin.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<!-- Build bin-eval.zip -->
					<execution>
						<id>bin-eval</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>${project.artifactId}-bin-eval${packname}</finalName>
							<outputDirectory>${project.build.directory}/bin</outputDirectory>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>assembly/bin.eval.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<!-- Build src.zip -->
					<execution>
						<id>src</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>${project.artifactId}-src${packname}</finalName>
							<outputDirectory>${project.build.directory}/bin</outputDirectory>
							<appendAssemblyId>false</appendAssemblyId>
							<descriptors>
								<descriptor>assembly/src.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
					<!-- Build bundle.jar -->
					<execution>
						<id>bundle</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/maven</outputDirectory>
							<descriptors>
								<descriptor>assembly/bundle.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.0.0</version>
				<executions>
					<execution>
						<id>timestamp-property</id>
						<goals>
							<goal>timestamp-property</goal>
						</goals>
						<phase>validate</phase>
						<configuration>
							<name>current.year</name>
							<pattern>yyyy</pattern>
						</configuration>
					</execution>
					<execution>
						<id>add-source</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>add-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>${project.basedir}/srcpv/</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>3.1.0</version>
				<executions>
				  <execution>
					<id>copy-resources</id>
					<!-- here the phase you need -->
					<phase>validate</phase>
					<goals>
					  <goal>copy-resources</goal>
					</goals>
					<configuration>
					  <outputDirectory>${project.build.directory}/classes</outputDirectory>
					  <resources>
						<resource>
						  <directory>${project.basedir}/srcpv/</directory>
						  <includes>
							<include>org/zkoss/chart/lic/Resources.properties</include>
						 </includes>
						</resource>
					  </resources>
					</configuration>
				  </execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>4.2.1</version>
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<instructions>
						<Bundle-Name>${project.name}</Bundle-Name>
						<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
						<Export-Package>*</Export-Package>
						<_nodefaultversion>true</_nodefaultversion>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
