<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>nz.co.senanque</groupId>
		<artifactId>madura-vaadin-support</artifactId>
		<version>3.4.0</version>
	</parent>
	<artifactId>madura-vaadin</artifactId>
	<packaging>jar</packaging>
	<name>madura-vaadin</name>
	<url>www.madurasoftware.com</url>
	<description>Integrates Madura Objects with Vaadin applications including support for dynamic metadata changes (available choices, read/write status of fields etc).</description>
	<dependencies>
		<dependency>
		    <groupId>org.springframework</groupId>
		    <artifactId>spring-test</artifactId>
		    <scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.logback-extensions</groupId>
			<artifactId>logback-ext-spring</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>ch.qos.logback</groupId>
			<artifactId>logback-classic</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-spring</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>javax.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-server</artifactId>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-push</artifactId>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-client-compiled</artifactId>
		</dependency>
		<!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). 
			For widgetset compilation, vaadin-client-compiler is automatically added 
			on the compilation classpath by vaadin-maven-plugin so normally there is 
			no need for an explicit dependency. -->
		<!-- <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiler</artifactId> 
			<scope>provided</scope> </dependency> -->
		<dependency>
			<groupId>com.vaadin</groupId>
			<artifactId>vaadin-themes</artifactId>
		</dependency>
		<!-- end of vaadin stuff -->


		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
			<version>2.6</version>
		</dependency>
		<dependency>
			<groupId>javax.validation</groupId>
			<artifactId>validation-api</artifactId>
			<version>1.0.0.GA</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate.javax.persistence</groupId>
			<artifactId>hibernate-jpa-2.1-api</artifactId>
			<version>1.0.0.Final</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>com.vaadin.addon</groupId>
			<artifactId>jpacontainer</artifactId>
		</dependency>
		<dependency>
			<groupId>nz.co.senanque</groupId>
			<artifactId>madura-objects</artifactId>
		</dependency>
<!-- 
		<dependency>
			<groupId>nz.co.senanque</groupId>
			<artifactId>madura-login</artifactId>
		</dependency>
 -->
 		<dependency>
			<groupId>nz.co.senanque</groupId>
			<artifactId>madura-permission-manager</artifactId>
			<version>${project.version}</version>
		</dependency>

	</dependencies>
	<build>
		<defaultGoal>install</defaultGoal>
	    <extensions>
	      <extension>
	        <groupId>org.apache.maven.wagon</groupId>
	        <artifactId>wagon-ftp</artifactId>
	        <version>2.10</version>
	      </extension>
	    </extensions>
		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<phase>package</phase>
						<id>attach-artifacts</id>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<artifacts>
						<artifact>
							<file>${pdf}</file>
							<type>pdf</type>
						</artifact>
					</artifacts>
				</configuration>
			</plugin>
			<plugin>
				<inherited>true</inherited>
				<artifactId>maven-compiler-plugin</artifactId>
			</plugin>
		      <plugin>
		        <artifactId>maven-javadoc-plugin</artifactId>
					<configuration>
						<additionalparam>-Xdoclint:none</additionalparam>
					</configuration>
		        <executions>
		          <execution>
		            <id>attach-javadocs</id>
		            <goals>
		              <goal>jar</goal>
		            </goals>
		          </execution>
		        </executions>
		      </plugin>
			<plugin>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<index>true</index>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Built-By>${username}</Built-By>
							<Vaadin-Package-Version>1</Vaadin-Package-Version>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Title>${project.artifactId}</Implementation-Title>
							<Implementation-Vendor>Prometheus Consulting</Implementation-Vendor>
							<Vaadin-Addon>${project.artifactId}-${project.version}.jar</Vaadin-Addon>
						</manifestEntries>
					</archive>
				</configuration>
				<executions>
					<execution>
						<id>default-jar</id>
						<phase>package</phase>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.4.3</version>
				<executions>
					<execution>
						<id>default-resources</id>
						<phase>process-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
					</execution>
					<execution>
						<id>copy-resources</id>
						<!-- here the phase you need -->
						<phase>process-resources</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/extra-resources</outputDirectory>
							<resources>
								<resource>
									<directory>assembly</directory>
									<includes>
										<include>MANIFEST.MF</include>
									</includes>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>

					<execution>
						<id>default-testResources</id>
						<phase>process-test-resources</phase>
						<goals>
							<goal>testResources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>nz.co.senanque</groupId>
				<artifactId>maduradocs</artifactId>
				<version>6.3.2</version>
				<executions>
					<execution>
						<goals>
							<goal>pdf</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<subprojectDir>madura-vaadin</subprojectDir>
				</configuration>
			</plugin>
		</plugins>
		<pluginManagement>
			<plugins>
				<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>
											org.kuali.maven.plugins
										</groupId>
										<artifactId>
											properties-maven-plugin
										</artifactId>
										<versionRange>
											[1.1.9,)
										</versionRange>
										<goals>
											<goal>
												read-project-properties
											</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
 <profiles> 
   <profile>
     <id>addon</id>
     <activation>
     	<activeByDefault>false</activeByDefault>
     </activation>
         <build>
            <plugins>
      			<plugin>
				<!-- 
				use arg: org.apache.maven.plugins:maven-assembly-plugin:assembly
				outputs target/madura-vaadin-${project.version}-addon.jar 
				-->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.5.4</version>
				<configuration>
					<descriptors>
						<descriptor>assembly/distribution.xml</descriptor>
					</descriptors>
					<archive>
						<addMavenDescriptor>true</addMavenDescriptor>
						<manifest>
							<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
						</manifest>
						<manifestEntries>
							<Built-By>${username}</Built-By>
							<Vaadin-Package-Version>1</Vaadin-Package-Version>
							<Implementation-Version>${project.version}</Implementation-Version>
							<Implementation-Title>${project.artifactId}</Implementation-Title>
							<Implementation-Vendor>Prometheus Consulting</Implementation-Vendor>
							<Vaadin-Addon>${project.artifactId}-${project.version}.jar</Vaadin-Addon>
						</manifestEntries>
					</archive>
					<finalName>${project.artifactId}-${project.version}-addon.zip</finalName>
					<appendAssemblyId>false</appendAssemblyId>
				</configuration>
			</plugin>
            </plugins>
         </build>
   </profile>
	<profile>
		<id>release</id>
		<build>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-gpg-plugin</artifactId>
					<version>1.5</version>
					<executions>
						<execution>
							<id>sign-artifacts</id>
							<phase>verify</phase>
							<goals>
								<goal>sign</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
				<!-- 
				<plugin>
					<groupId>org.codehaus.mojo</groupId>
					<artifactId>wagon-maven-plugin</artifactId>
					<version>1.0</version>
					<executions>
						<execution>
							<id>upload-assembly</id>
							<phase>install</phase>
							<goals>
								<goal>upload-single</goal>
							</goals>
							<configuration>
								<serverId>bluehost</serverId>
								<fromFile>${project.build.directory}/${project.build.finalName}.pdf</fromFile>
								<url>${env.BLUEHOST_URL}</url>
								<toFile>/public_html/madura/${project.build.finalName}.pdf</toFile>
							</configuration>
						</execution>
					</executions>
				</plugin>
				-->
				<plugin>
					<groupId>org.sonatype.plugins</groupId>
					<artifactId>nexus-staging-maven-plugin</artifactId>
					<version>1.6.3</version>
					<extensions>true</extensions>
					<configuration>
						<serverId>ossrh</serverId>
						<nexusUrl>https://oss.sonatype.org/</nexusUrl>
						<autoReleaseAfterClose>true</autoReleaseAfterClose>
					</configuration>
				</plugin>
			</plugins>
		</build>
	</profile>
 </profiles>

</project>
