<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>
	<prerequisites>
		<maven>3.2.1</maven>
	</prerequisites>
	
	<parent> 
		<groupId>com.expanset.samples</groupId>
		<artifactId>samples</artifactId>
		<version>1.0.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	
	<artifactId>samples-complex</artifactId>
		
	<packaging>jar</packaging>

	<name>Complex sample</name>

	<properties>
		<packaging.type>jar</packaging.type>
	</properties>

	<dependencies>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-contrib</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-jetty</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-mvc-freemarker</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-persistence-jpa</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-validation</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.jersey</groupId>
			<artifactId>jersey-jackson</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>com.expanset.utils</groupId>
			<artifactId>utils-logback</artifactId>
			<version>${project.version}</version>
		</dependency>		
		<dependency>
			<groupId>com.expanset.utils</groupId>
			<artifactId>utils-dbmigration</artifactId>
			<version>${project.version}</version>
		</dependency>
		
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.persistence</groupId>
			<artifactId>eclipselink</artifactId>
		</dependency>
		<dependency>
			<groupId>net.sf.dozer</groupId>
			<artifactId>dozer</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
           	<groupId>org.glassfish.jersey.core</groupId>
           	<artifactId>jersey-client</artifactId>
       	</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-csv</artifactId>
		</dependency>       	
		<dependency>
			<groupId>commons-daemon</groupId>
			<artifactId>commons-daemon</artifactId>
		</dependency>		
	</dependencies>
	
	<profiles>
		<profile>
			<id>release</id>			
			<properties>
				<releaseProfile>release</releaseProfile>
			</properties>
			<build>
				<plugins>
					 <plugin>
			            <artifactId>maven-assembly-plugin</artifactId>
			            <configuration>
			                <descriptor>${basedir}/src/main/assembly/site-folder.xml</descriptor>
			            </configuration>
			            <executions>
			                <execution>
			                    <id>create-site</id>
			                    <phase>package</phase>
			                    <goals>
			                        <goal>single</goal>
			                    </goals>
			                </execution>
			            </executions>
			        </plugin>
				</plugins>
			</build>
		</profile>
	</profiles>
	
	<build>
		<plugins>
			<plugin>
     			<artifactId>maven-antrun-plugin</artifactId>
     			<executions>
       				<execution>
	       				<id>static-weave</id>
	         			<phase>process-classes</phase>
	         			<configuration>
	           				<tasks>
	             				<java classname="org.eclipse.persistence.tools.weaving.jpa.StaticWeave" classpathref="maven.compile.classpath" fork="true" failonerror="true">
									<arg line="-loglevel INFO -persistenceinfo src/main/resources target/classes target/classes" />
	             				</java>
	           				</tasks>
						</configuration>
						<goals>
	           				<goal>run</goal>
	         			</goals>
	       			</execution>
     			</executions>
   			</plugin>		
      		<plugin>
        		<groupId>org.codehaus.mojo</groupId>
        		<artifactId>buildnumber-maven-plugin</artifactId>
        		<executions>
          			<execution>
          				<id>buildnumber</id>
            			<phase>validate</phase>
            			<goals>
              				<goal>create-timestamp</goal>
            			</goals>
          			</execution>
        		</executions>
        		<configuration>
					<timestampFormat>yyyyMMddHHmm</timestampFormat>
					<timestampPropertyName>buildNumber</timestampPropertyName>
        		</configuration>
      		</plugin>
 			<plugin>
	            <groupId>org.apache.maven.plugins</groupId>
	            <artifactId>maven-jar-plugin</artifactId>
	            <configuration>
					<finalName>site</finalName>
	                <archive>
	                    <manifest>
	                        <mainClass>com.expanset.samples.complex.WebApplication</mainClass>
	                        <addClasspath>true</addClasspath>
	                        <classpathPrefix>lib/</classpathPrefix>
	                        <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
	                    </manifest>
						<manifestEntries>
							<Built-By>Expanset</Built-By>
							<Build-Number>${buildNumber}</Build-Number>
							<Implementation-Build>${buildNumber}</Implementation-Build>
            			</manifestEntries>	                    
	                </archive>
	            </configuration>
        	</plugin>		
		</plugins>
		<pluginManagement>
        	<plugins>
    			<plugin>
    				<groupId>org.eclipse.m2e</groupId>
    				<artifactId>lifecycle-mapping</artifactId>
    				<version>1.0.0</version>
    				<configuration>
    					<lifecycleMappingMetadata>
    						<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.apache.maven.plugins</groupId>
										<artifactId>maven-antrun-plugin</artifactId>
										<versionRange>[1.3,)</versionRange>
										<goals>
											<goal>run</goal>										
										</goals>
									</pluginExecutionFilter>
									<action>
										<execute>
											<runOnIncremental>false</runOnIncremental>
										</execute>
									</action>
								</pluginExecution>
    							<pluginExecution>    							
    								<pluginExecutionFilter>
    									<groupId>org.codehaus.mojo</groupId>
    									<artifactId>buildnumber-maven-plugin</artifactId>
    									<versionRange>[1.3,)</versionRange>
    									<goals>
    										<goal>create-timestamp</goal>
    									</goals>
    								</pluginExecutionFilter>
    								<action>
    									<execute />
    								</action>
    							</pluginExecution>
    						</pluginExecutions>
    					</lifecycleMappingMetadata>
    				</configuration>
    			</plugin>
        	</plugins>
    	</pluginManagement>
	</build>
			
</project>
