<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>
	<parent>
		<groupId>de.jiac.micro</groupId>
		<artifactId>microjiac-tools</artifactId>
		<version>3.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<groupId>de.jiac.micro.tools</groupId>
	<artifactId>microjiac-config</artifactId>
	<packaging>jar</packaging>

	<name>MicroJIAC Config</name>
	<description>Configuration checker and class generator for MicroJIAC.</description>
	
	<properties>
		<asm-version>3.1</asm-version>
		<jaxb2-basics-version>0.6.0</jaxb2-basics-version>
		<jaxb2-version>2.1.13</jaxb2-version>
		<aamm-version>1.1-SNAPSHOT</aamm-version>
	</properties>
	
	<dependencies>
		<dependency>
			<groupId>com.github.mcpat.slf4j</groupId>
			<artifactId>slf4cldc-api</artifactId>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm</artifactId>
			<version>${asm-version}</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-analysis</artifactId>
			<version>${asm-version}</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-commons</artifactId>
			<version>${asm-version}</version>
		</dependency>
		<dependency>
			<groupId>asm</groupId>
			<artifactId>asm-tree</artifactId>
			<version>${asm-version}</version>
		</dependency>
		
		<dependency>
			<groupId>org.jvnet.jaxb2_commons</groupId>
			<artifactId>jaxb2-basics-runtime</artifactId>
			<version>${jaxb2-basics-version}</version>
		</dependency>
		<dependency>
			<groupId>com.sun.xml.bind</groupId>
			<artifactId>jaxb-impl</artifactId>
			<version>${jaxb2-version}</version>
		</dependency>
	</dependencies>
	
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.5</source>
						<target>1.5</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
	
	<!-- temporary profiles as long as AAMM is not released -->
	<profiles>
		<profile>
			<id>__aamm_from_repository__</id>
			<activation>
				<file>
					<missing>aamm</missing>
				</file>
			</activation>
			
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-dependency-plugin</artifactId>
						<version>2.1</version>
						<executions>
							<execution>
								<id>unpack-aamm</id>
								<phase>process-sources</phase>
								<goals>
									<goal>unpack</goal>
								</goals>
								<configuration>
									<outputDirectory>${project.build.directory}/classes</outputDirectory>
									<artifactItems>
										<artifactItem>
											<groupId>de.dailab.jiac.common</groupId>
											<artifactId>aamm-checker</artifactId>
											<version>${aamm-version}</version>
										</artifactItem>
										<artifactItem>
											<groupId>de.dailab.jiac.common</groupId>
											<artifactId>AAMM</artifactId>
											<version>${aamm-version}</version>
										</artifactItem>
									</artifactItems>
									<excludes>META-INF/**</excludes>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
		
		<profile>
			<id>__aamm_from_folder__</id>
			<activation>
				<file>
					<exists>aamm</exists>
				</file>
			</activation>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-antrun-plugin</artifactId>
						<version>1.6</version>
						<executions>
							<execution>
								<id>unpack-aamm</id>
								<phase>process-sources</phase>
								<goals>
									<goal>run</goal>
								</goals>
								<configuration>
									<target>
										<unjar dest="${project.build.directory}/classes">
											<patternset>
												<exclude name="META-INF/**" />
											</patternset>
											<fileset dir="${project.basedir}/aamm">
												<include name="*.jar" />
											</fileset>
										</unjar>
									</target>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
</project>