<?xml version="1.0" encoding="utf-8"?>
<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>
	<groupId>com.novartis.opensource</groupId>
	<artifactId>YADA</artifactId>
	<version>6.2.3</version>
	<name>YADA</name>
	<url>http://opensource.nibr.com/yada</url>
	<description>YADA (Yet Another Data Abstraction) Thin Server Framework</description>
	<inceptionYear>2016</inceptionYear>
	<packaging>pom</packaging>
	<licenses>
	  <license>
	    <name>Apache License, Version 2.0</name>
	    <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
	  </license>
	</licenses>
	<organization>
	 <name>Novartis Institutes for BioMedical Research, Inc</name>
	 <url>http://opensource.nibr.com</url>
	</organization>
	<distributionManagement>
		<site>
			<id>yada.site</id>
			<name>YADA site</name>
			<url>${distribution.site.url}</url>
		</site>
		<snapshotRepository>
	    <id>ossrh</id>
	    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
	  </snapshotRepository>
	  <repository>
	    <id>ossrh</id>
	    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
	  </repository>
	</distributionManagement>
	<developers>
	 <developer>
	   <name>David Varon</name>
	   <email>varontron@gmail.com</email>
	   <organization>Novartis Institutes for BioMedical Research</organization>
	   <organizationUrl>http://opensource.nibr.com</organizationUrl>
	 </developer>
	</developers>
	<scm>
	  <connection>scm:git:ssh:git@github.com:Novartis/YADA.git</connection>
	  <developerConnection>scm:git:ssh://git@github.com/Novartis/YADA.git</developerConnection>
	  <url>scm:git:ssh://github.com/Novartis/YADA</url>
	  <tag>6.2.3</tag>
  </scm>
	<properties>
    <display.version>${project.version}</display.version>
    <projectVersion>${project.version}</projectVersion>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <main.basedir>${project.basedir}</main.basedir>
  </properties>
	<modules>
		<module>yada-api</module>
		<module>yada-war</module>
	</modules>
	<build>
		<plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <goals>deploy</goals>
        </configuration>
      </plugin>
		  <plugin>
			  <groupId>org.sonatype.plugins</groupId>
			  <artifactId>nexus-staging-maven-plugin</artifactId>
			  <version>1.6.6</version>
			  <extensions>true</extensions>
			  <configuration>
			     <serverId>ossrh</serverId>
			     <nexusUrl>https://oss.sonatype.org/</nexusUrl>
			     <autoReleaseAfterClose>true</autoReleaseAfterClose>
			  </configuration>
			</plugin>
		  <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>com.mycila</groupId>
		    <artifactId>license-maven-plugin</artifactId>
		    <version>2.11</version>
		    <configuration>
		      <header>${main.basedir}/src/main/resources/license.txt</header>
		      <useDefaultExcludes>true</useDefaultExcludes>
		      <properties>
		      	<year>${project.inceptionYear}</year>
		      </properties>
		      <includes>
		      	<include>**/*.java</include>
		      	<include>**/*.xml</include>
		      	<include>**/*.xsl</include>
		      	<include>**/*.pl</include>
		      	<include>**/*.js</include>
		      	<include>**/*.html</include>
		      	<include>**/*.css</include>
		      	<include>**/*.jsp</include>
		      </includes>
		      <excludes>
		        <exclude>pom.xml</exclude>
		        <exclude>target/**</exclude>
		        <exclude>src/site/**</exclude>
		        <exclude>src/test/resources/conf/**</exclude>
		        <exclude>src/test/resources/test/**</exclude>
		        <exclude>src/main/resources/conf/**</exclude>
		        <exclude>src/main/webapp/META-INF/**</exclude>
		        <exclude>src/main/webapp/WEB-INF/**</exclude>
		        <exclude>src/main/webapp/yada-admin/lib/**</exclude>
		        <exclude>yada-api/src/main/resaurces/utils/r.js</exclude>
		      </excludes>
		    </configuration>
		    <executions>
		      <execution>
		        <goals>
		          <goal>check</goal>
		        </goals>
		      </execution>
		    </executions>
		  </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<version>3.3</version>
				<dependencies>
					<dependency>
						<groupId>org.apache.maven.doxia</groupId>
						<artifactId>doxia-module-markdown</artifactId>
						<version>1.4</version>
					</dependency>
					<dependency>
						<groupId>org.apache.maven.wagon</groupId>
						<artifactId>wagon-ssh</artifactId>
						<version>1.0-beta-7</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>com.github.jeluard</groupId>
				<artifactId>plantuml-maven-plugin</artifactId>
				<version>1.1</version>
				<configuration>
					<sourceFiles>
						<directory>${basedir}</directory>
						<includes>
							<include>src/site/uml/*.uml</include>
						</includes>
					</sourceFiles>
					<outputDirectory>${basedir}/src/site/resources/images</outputDirectory>
				</configuration>
				<executions>
					<execution>
						<id>uml</id>
						<phase>pre-site</phase>
						<goals>
							<goal>generate</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>net.sourceforge.plantuml</groupId>
						<artifactId>plantuml</artifactId>
						<version>8029</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>1.6</version>
				<executions>
					<execution>
						<id>stub-assembly</id>
						<phase>pre-site</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<delete>
									<fileset dir="src/site/resources/downloads" includes="**/*.war,**/*.zip,**/*.xml)" />
								</delete>
								<!-- for site -->
								<copy file="${basedir}/../YADA-Quickstart/pom.xml" todir="src/site/resources/downloads" />
								<copy file="${basedir}/../YADA-Quickstart/target/YADA-Quickstart-${project.version}.war" todir="src/site/resources/downloads" />
								<!-- for github -->
								<copy file="${basedir}/../YADA-Quickstart/pom.xml" todir="${basedir}/../YADA/src/site/resources/downloads" />
								<copy file="${basedir}/../YADA-Quickstart/target/YADA-Quickstart-${project.version}.war" todir="${basedir}/../YADA/src/site/resources/downloads" />
								
									
								<copy overwrite="true" file="readme.md" tofile="src/site/markdown/index.md" />
								
								<!-- update to project.version in documentation -->
								<replaceregexp byline="true">
									<regexp pattern="YADA-Quickstart-((\d+\.){2})\d+(-SNAPSHOT)?" />
									<substitution expression="YADA-Quickstart-${project.version}" />
									<fileset dir="${basedir}/src/site/markdown/">
										<include name="deployment.md" />
									</fileset>
								</replaceregexp>
								
								<!-- update to releaseVersion in documentation -->
                <replaceregexp byline="true">
                  <regexp pattern="YADA-Quickstart-(((\d+\.){2})\d+)(-SNAPSHOT)?" />
                  <substitution expression="YADA-Quickstart-\1" />
                  <fileset dir="${basedir}/src/site/markdown/">
                    <include name="deployment.md" />
                  </fileset>
                </replaceregexp>
								
								<!-- update image refs in index -->
								<replaceregexp byline="true">
									<regexp pattern="(\!\[.+\]\()src/site/resources/(images/.+\))" />
									<substitution expression="\1\2" />
									<fileset dir="${basedir}/src/site/markdown/">
										<include name="index.md" />
									</fileset>
								</replaceregexp>
								
								<!-- update pure html image refs in index -->
								<replaceregexp byline="true">
									<regexp pattern="(&lt;img src=&quot;)src/site/resources/(images/.+)" />
									<substitution expression="\1\2" />
									<fileset dir="${basedir}/src/site/markdown/">
										<include name="index.md" />
									</fileset>
								</replaceregexp>
							</target>
						</configuration>
					</execution>
					<execution>
						<id>html-it</id>
						<phase>post-site</phase>
						<goals>
							<goal>run</goal>
						</goals>
						<configuration>
							<target>
								<!-- convert .md hrefs into .html -->
								<replaceregexp flags="g" byline="true">
									<regexp pattern="((href=&quot;(src/site/markdown/)?(\w+)\.md(#\w+)?&quot;)+)" />
									<substitution expression="href=&quot;\4.html\5&quot;" />
									<fileset dir="${basedir}/target/">
										<include name="site/*.html" />
										<include name="staging/*.html" />
									</fileset>
								</replaceregexp>
								
								<!-- insert YAML into index.html STAGING ONLY. 
								     staging goes to svn for opensource.nibr.com
								     site gets deployed internally -->
								<replaceregexp file="${stagingDirectory}/index.html">
									<regexp pattern="(&lt;body\s.+&gt;)" />
									<substitution expression="\1--- name: YADA abbreviation: YADA projectName: YADA          launched: 2015-11-01          icon: images/blox250.png          summary: A universal remote control for data.         description: |           Access any data, at any source, in any format, from any environment, using just a URL, with just one-time configuration.           Get data from multiple sources, in different formats, merge the results into one with uniform column names, on-the-fly, using one URL.           **YADA** exists to simplify data access and eliminate work.                  **YADA** is a lightweight framework for data retrieval, searching, storage, and manipulation.                  **YADA** is an instant web service for your data.                  **YADA** is a tool to enable efficient development of interfaces and data-processing pipelines.                  **YADA** is an implementation of [Thin Server Architecture](http://bit.ly/1dhuiRY).                  **YADA** is an acronym for &quot;Yet Another Data Abstraction.&quot;                     Its [raisons d'être](http://bit.ly/1SHuiAd) are to enable efficient, non-redundant development of data-dependent applications and utilities, data source querying, data analysis, processing pipelines, extract, transform, and load (ETL) processes, etc.             **YADA** does all this while preserving total decoupling between data access and other aspects of application architecture such as user interface.     ---" />									
								</replaceregexp>
								
								<!-- add link for github docs to site -->
                <replaceregexp file="${basedir}/target/site/index.html">
								  <regexp pattern="(&lt;div id=&quot;bodyColumn&quot;\s+class=&quot;span9&quot;\s*&gt;)" />
                  <substitution expression="\1&lt;p&gt;For the most recent updates to documentation, see &lt;a href=&quot;http://github.com/Novartis/YADA&quot;&gt;https://github.com/Novartis/YADA&lt;/a&gt;.&lt;/p&gt;" />                 
								</replaceregexp>
								
								<!-- add link for github docs stage -->
                <replaceregexp file="${stagingDirectory}/index.html">
                  <regexp pattern="(&lt;div id=&quot;bodyColumn&quot;\s+class=&quot;span9&quot;\s*&gt;)" />
                  <substitution expression="\1&lt;p&gt;For the most recent updates to documentation, see &lt;a href=&quot;http://github.com/Novartis/YADA&quot;&gt;https://github.com/Novartis/YADA&lt;/a&gt;.&lt;/p&gt;" />                 
                </replaceregexp>
								
								<!-- update image refs in html files -->
								<replaceregexp flags="g" byline="true">
									<regexp pattern="(src=&quot;)\.\./resources/(images/.+)" />
									<substitution expression="\1\2" />
									<fileset dir="${basedir}/target/">
										<include name="site/*.html" />
                    <include name="staging/*.html" />
									</fileset>
								</replaceregexp>
								
								<!-- update download paths in html files -->
               <replaceregexp flags="g" byline="true">
                  <regexp pattern="(href=&quot;)\.\./resources/(downloads/.+)" />
                  <substitution expression="\1\2" />
                  <fileset dir="${basedir}/target/">
                    <include name="site/*.html" />
                    <include name="staging/*.html" />
                  </fileset>
                </replaceregexp>
								
								<!-- mod copyright in html files -->
                <replaceregexp flags="g" byline="true">
                  <regexp pattern="All Rights Reserved." />
                  <substitution expression="" />
                  <fileset dir="${basedir}/target/">
                    <include name="site/*.html" />
                    <include name="staging/*.html" />
                  </fileset>
                </replaceregexp>
								
								<!-- add float to icon -->
								<replaceregexp>
									<regexp pattern="(&lt;img src=&quot;images/blox250.png.+)" />
									<substitution expression="&lt;div style=&quot;float:right;margin-top:-43px;&quot;&gt;\1&lt;/div&gt;" />
									<fileset dir="${basedir}/target/">
										<include name="site/*.html" />
                    <include name="staging/*.html" />
									</fileset>
								</replaceregexp>						

							</target>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	<reporting>
		<plugins>
		  <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.7</version>
        <configuration>
            <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
            <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
        </configuration>
      </plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>2.16</version>
				<reportSets>
					<!-- <reportSet> defines unit test reports in the modules <id>unit-tests</id> 
						<reports> <report>report</report> </reports> </reportSet> -->

					<reportSet>
						<!-- defines aggregate unit test report -->
						<id>unit-tests-aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>report-only</report>
						</reports>
						<configuration>
							<aggregate>true</aggregate>
						</configuration>
					</reportSet>

					<!-- <reportSet> defines integration test reports in the modules <id>integration-tests</id> 
						<reports> <report>failsafe-report-only</report> </reports> </reportSet> -->
					<reportSet>
						<!-- defines aggregate integration test report -->
						<id>integration-tests-aggregate</id>
						<inherited>false</inherited>
						<reports>
							<report>failsafe-report-only</report>
						</reports>
						<configuration>
							<aggregate>true</aggregate>
						</configuration>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>javax.servlet</groupId>
				<artifactId>servlet-api</artifactId>
				<version>2.5</version>
				<scope>provided</scope>
			</dependency>
			<dependency>
				<groupId>org.testng</groupId>
				<artifactId>testng</artifactId>
				<version>6.8.21</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat</groupId>
				<artifactId>catalina</artifactId>
				<version>6.0.37</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>log4j</groupId>
				<artifactId>log4j</artifactId>
				<version>1.2.17</version>
			</dependency>
			<dependency>
				<groupId>nl.javadude.assumeng</groupId>
				<artifactId>assumeng</artifactId>
				<version>1.2.4</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.xerial</groupId>
				<artifactId>sqlite-jdbc</artifactId>
				<version>3.8.11.1</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.apache.tomcat</groupId>
				<artifactId>tomcat-dbcp</artifactId>
				<version>7.0.47</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
</project>
