<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">
	
	<parent>
		<artifactId>hapi</artifactId>
		<groupId>ca.uhn.hapi</groupId>
		<version>2.2</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	
	<modelVersion>4.0.0</modelVersion>
	
	<groupId>ca.uhn.hapi</groupId>
	<artifactId>hapi-structures-v25</artifactId>
	<name>HAPI - Java HL7 API - Generated Structures v2.5</name>
	
	<packaging>jar</packaging>

	<dependencies>
		<dependency>
			<groupId>ca.uhn.hapi</groupId>
			<artifactId>hapi-base</artifactId>
			<version>${hapi.version}</version>
		</dependency>
	</dependencies>

	<properties>
		<gen.skip>false</gen.skip>
		<gen.version>2.5</gen.version>
		<gen.version.short>v25</gen.version.short>
		<sourcegen.jdbcUrl>${sourcegen.jdbcUrl.old}</sourcegen.jdbcUrl>
	</properties>

	<build>
		<plugins>
			<plugin>
				<groupId>ca.uhn.hapi</groupId>
				<artifactId>hapi-sourcegen</artifactId>
				<executions>
					<execution>
						<id>${gen.version}</id>
						<phase>generate-sources</phase>
						<goals>
							<goal>sourcegen</goal>
						</goals>
						<inherited>true</inherited>
						<configuration>
							<version>${gen.version}</version>
							<jdbcUrl>${sourcegen.jdbcUrl}</jdbcUrl>
							<jdbcUser>${sourcegen.jdbcUser.old}</jdbcUser>
							<jdbcPassword>${sourcegen.jdbcPassword.old}</jdbcPassword>
							<targetDirectory>${basedir}/target/generated-sources/sourcegen</targetDirectory>
							<targetResourceDirectory>${basedir}/target/generated-sources/resourcegen</targetResourceDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>ca.uhn.hapi</groupId>
				<artifactId>hapi-sourcegen</artifactId>
				<version>${hapi.version}</version>
				<executions>
					<execution>
						<id>superstructure_adt</id>
						<goals>
							<goal>superstructuregen</goal>
						</goals>
						<configuration>
							<targetDirectory>${basedir}/target/generated-sources/superstructuregen</targetDirectory>
							<targetStructureName>ADT_AXX</targetStructureName>
							<version>${gen.version}</version>
							<structures>
								<structure>ADT_A[0-9]{2}</structure>
							</structures>
						</configuration>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>ca.uhn.hapi</groupId>
						<artifactId>hapi-base</artifactId>
						<version>${hapi.version}</version>
					</dependency>
					<dependency>
						<groupId>ca.uhn.hapi</groupId>
						<artifactId>hapi-structures-${gen.version.short}</artifactId>
						<version>${hapi.version.stable}</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<artifactId>maven-antrun-plugin</artifactId>
				<executions>
					<execution>
						<phase>post-site</phase>
						<inherited>true</inherited>
						<configuration>
							<tasks>
								<echo message="Copying resources" />
								<copy todir="../target/site/${gen.version.short}/apidocs">
									<fileset dir="target/site/apidocs">
										<include name="**/*" />
									</fileset>
								</copy>
							</tasks>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
		<resources>
            <resource>
                <directory>${basedir}/target/generated-sources/resourcegen</directory>
                <filtering>false</filtering>
            </resource>
		</resources>
	</build>

	<reporting>
		<plugins>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>${maven.javadoc.plugin.version}</version>
				<inherited>true</inherited>
				<configuration>
					<minmemory>128m</minmemory>
					<maxmemory>${plugin.javadoc.maxmemory}</maxmemory>
					<linksource>true</linksource>
					<verbose>true</verbose>
					<links>
					   <link>http://hl7api.sourceforge.net/base/apidocs/</link>
					</links>
				</configuration>
			</plugin>
		</plugins>
	</reporting>

	<profiles>
		<profile>
			<id>DIST</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
						<version>${maven.javadoc.plugin.version}</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
						<version>2.1.2</version>
						<executions>
							<execution>
								<phase>package</phase>
								<goals>
									<goal>jar-no-fork</goal>
								</goals>
							</execution>
						</executions>
					</plugin>				
					<plugin>
						<groupId>org.codehaus.mojo</groupId>
						<artifactId>retrotranslator-maven-plugin</artifactId>
						<version>1.0-alpha-4</version>
						<executions>
							<execution>
								<goals>
									<goal>translate-project</goal>
								</goals>
								<configuration>
									<attach>true</attach>
								</configuration>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	
</project>
