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

	<parent>
		<groupId>es.uvigo.ei.sing</groupId>
		<artifactId>aibench-project</artifactId>
		<version>2.10.2</version>
		<!--
			WARNING: change version using (in the parent project):
				mvn versions:set -DnewVersion=[new_version]
				mvn versions:commit

			This will change the version in all modules at-once
		-->

		<relativePath>../pom.xml</relativePath>
	</parent>

	<artifactId>aibench-pluginmanager</artifactId>
	<packaging>jar</packaging>
	<name>The AIBench Plugin Manager Plugin</name>
	<url>http://www.aibench.org</url>

	<properties>
		<aibench.lib.artifactIds>javatar,aibench-aibench,jhall,log4j</aibench.lib.artifactIds>
		<aibench.plugins.artifactIds>aibench-core,aibench-workbench</aibench.plugins.artifactIds>
		<globalResourcesDirectory>src/main/global-resources</globalResourcesDirectory>
	</properties>

	<dependencies>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>aibench-aibench</artifactId>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>aibench-core</artifactId>
			<scope>compile</scope>
			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>aibench-workbench</artifactId>
			<scope>compile</scope>
			<exclusions>
				<exclusion>
					<groupId>*</groupId>
					<artifactId>*</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<dependency>
			<groupId>batik</groupId>
			<artifactId>batik-swing</artifactId>
			<version>1.6</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.xmlgraphics</groupId>
			<artifactId>batik-ext</artifactId>
			<version>1.7</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>batik</groupId>
			<artifactId>batik-awt-util</artifactId>
			<version>1.6</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>org.swinglabs</groupId>
			<artifactId>swing-worker</artifactId>
			<version>1.1</version>
			<scope>compile</scope>
		</dependency>

		<dependency>
			<groupId>javax.activation</groupId>
			<artifactId>activation</artifactId>
			<version>1.1</version>
			<scope>runtime</scope>
		</dependency>
	</dependencies>

	<build>
		<directory>${project.basedir}/target</directory>
		<outputDirectory>${project.build.directory}/dist/plugins_bin/${project.artifactId}</outputDirectory>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration>
					<excludePackageNames>org.jdesktop.*</excludePackageNames>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<!-- copy resources -->
					<execution>
						<id>copy-global-resources</id>
						<!-- here the phase you need -->
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/dist</outputDirectory>
							<resources>
								<resource>
									<directory>${globalResourcesDirectory}</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<!-- aibench core libraries -->
					<execution>
						<id>copy-dependencies-aibench-lib</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/dist/lib</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
							<includeArtifactIds>${aibench.lib.artifactIds}</includeArtifactIds>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>

					<!-- aibench plugins -->
					<execution>
						<id>copy-dependencies-aibench-plugins</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/dist/plugins_bin</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
							<includeArtifactIds>${aibench.plugins.artifactIds}</includeArtifactIds>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>

					<!-- rest of dependencies inside current aibench plugin -->
					<execution>
						<id>copy-dependencies-plugin-dependencies</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.outputDirectory}</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>false</overWriteSnapshots>
							<overWriteIfNewer>true</overWriteIfNewer>
							<excludeArtifactIds>${aibench.plugins.artifactIds},${aibench.lib.artifactIds}</excludeArtifactIds>
							<includeScope>runtime</includeScope>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>

		<!-- filtering on plugin.xml -->
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
				<includes>
					<include>plugin.xml</include>
				</includes>
			</resource>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>false</filtering>
				<excludes>
					<exclude>plugin.xml</exclude>
				</excludes>
			</resource>
		</resources>
	</build>
</project>
