<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>
		<groupId>io.imunity</groupId>
		<artifactId>unity-server-parent</artifactId>
		<version>4.2.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>unity-documentation</artifactId>
	<packaging>jar</packaging>
	<name>UNITY ${m.name}</name>
	<description>Documentation of the whole Unity system</description>

	<properties>
		<m.name>documentation</m.name>
	</properties>

	<scm>
		<connection>${scm.base}/${m.name}</connection>
		<developerConnection>${scm.base}/${m.name}</developerConnection>
		<tag>unity-server-parent-4.2.0</tag>
	</scm>

	<distributionManagement>
		<site>
      		<id>unity-idm.eu</id>
      		<url>scpexe://109.106.246.117:65002/home/u455073191/domains/unity-idm.eu/public_html/documentation/unity-${project.version}</url>
    	</site>
	</distributionManagement>

	<dependencies>
		<!-- dependencies are used to generate documentation from the code -->
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-engine</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-engine-api</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-storage</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-ws</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-saml</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-oauth</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-pam</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-otp-ldap</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-ldap</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-rest</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-user-home</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-web-attr-introspection</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-web-upman</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.imunity</groupId>
			<artifactId>unity-server-scim</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>eu.unicore.security</groupId>
			<artifactId>securityLibrary</artifactId>
		</dependency>
	</dependencies>

	<build>
		<extensions>
			<!-- Enabling the use of SCP -->
			<extension>
				<groupId>org.apache.maven.wagon</groupId>
				<artifactId>wagon-ssh-external</artifactId>
			</extension>
		</extensions>

		<plugins>
		<!-- the current asciidoctor maven plugin is outdated -->
		<!-- 
			<plugin>
				<groupId>org.asciidoctor</groupId>
				<artifactId>asciidoctor-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>output-html</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>process-asciidoc</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
					<sourceDocumentName>src/main/doc/manual.txt</sourceDocumentName>
					<backend>html5</backend>
				</configuration>
			</plugin>
			 -->
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-documentation-to-workspace</id>
						<phase>pre-site</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>target/workspace</outputDirectory>
							<resources>
								<resource>
									<directory>src/main/doc</directory>
									<filtering>true</filtering>
								</resource>
								<resource>
									<directory>src/main/saml-howto</directory>
									<filtering>true</filtering>
								</resource>
								<resource>
									<directory>src/main/update-howto</directory>
									<filtering>true</filtering>
								</resource>
								<resource>
									<directory>src/main/unicore-howto</directory>
									<filtering>true</filtering>
								</resource>
								<resource>
									<directory>src/main/rest-api</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
					<execution>
						<id>copy-documentation-images</id>
						<phase>pre-site</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.reporting.outputDirectory}/figures</outputDirectory>
							<resources>
								<resource>
									<directory>target/workspace/figures</directory>
									<filtering>true</filtering>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>


			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>exec-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>generate-conf-references</id>
						<phase>pre-site</phase>
						<configuration>
							<mainClass>pl.edu.icm.unity.doc.utils.AsciidoctorFormatter</mainClass>
							<cleanupDaemonThreads>false</cleanupDaemonThreads>
							<arguments>
								<argument>target/workspace</argument>
								<argument>eu.unicore.security.canl.TruststoreProperties|sec-ref-trustProperties.txt|.</argument>
								<argument>eu.unicore.security.canl.CredentialProperties|sec-ref-credProperties.txt|.</argument>
								<argument>pl.edu.icm.unity.engine.api.config.UnityPKIConfiguration|ref-pkiProperties.txt|</argument>
								<argument>pl.edu.icm.unity.engine.api.config.UnityHttpServerConfiguration|ref-httpServerProperties.txt|</argument>
								<argument>pl.edu.icm.unity.engine.api.config.UnityServerConfiguration|ref-mainServerProperties.txt|</argument>
								<argument>pl.edu.icm.unity.ws.CXFEndpointProperties|ref-cxfEndpointProperties.txt|</argument>
								<argument>pl.edu.icm.unity.rest.RESTEndpointProperties|ref-restEndpointProperties.txt|</argument>
								<argument>pl.edu.icm.unity.ldap.client.config.LdapProperties|ref-ldapProperties.txt|</argument>
								<argument>io.imunity.vaadin.endpoint.common.VaadinEndpointProperties|ref-vaadinEndpointProperties.txt|</argument>
								<argument>pl.edu.icm.unity.saml.idp.SamlIdpProperties|ref-samlIdPProperties.txt|</argument>
								<argument>pl.edu.icm.unity.saml.sp.SAMLSPProperties|ref-samlSPProperties.txt|</argument>
								<argument>pl.edu.icm.unity.oauth.client.config.OAuthClientProperties|ref-oauthClientProperties.txt|</argument>
								<argument>pl.edu.icm.unity.oauth.client.config.CustomProviderProperties|ref-oauthProviderProperties.txt|</argument>
								<argument>pl.edu.icm.unity.store.StorageConfiguration|ref-dbProperties.txt|</argument>
								<argument>pl.edu.icm.unity.store.rdbms.RDBMSConfiguration|ref-storeRDBMSProperties.txt|</argument>
								<argument>pl.edu.icm.unity.rest.jwt.JWTAuthenticationProperties|ref-JWTManProperties.txt|</argument>
								<argument>pl.edu.icm.unity.oauth.as.OAuthASProperties|ref-oauthASProperties.txt|</argument>
								<argument>pl.edu.icm.unity.oauth.rp.OAuthRPProperties|ref-oauthRPProperties.txt|</argument>
								<argument>io.imunity.home.HomeEndpointProperties|ref-homeEndpointProperties.txt|</argument>
								<argument>pl.edu.icm.unity.engine.userimport.UserImportProperties|ref-genericUserImportProperties.txt|</argument>
								<argument>pl.edu.icm.unity.pam.PAMProperties|ref-PAMProperties.txt|</argument>
								<argument>io.imunity.vaadin.auth.extensions.PasswordRetrievalProperties|ref-PasswordRetrievalProperties.txt|</argument>
								<argument>io.imunity.vaadin.auth.extensions.SMSRetrievalProperties|ref-SMSRetrievalProperties.txt|</argument>
								<argument>io.imunity.vaadin.auth.extensions.TLSRetrievalProperties|ref-TLSRetrievalProperties.txt|</argument>
								<argument>io.imunity.otp.ldap.OTPWithLDAPProperties|ref-OTPLDAPProperties.txt|</argument>
								<argument>io.imunity.upman.UpmanEndpointProperties|ref-UpmanProperties.txt|</argument>
								<argument>io.imunity.scim.config.SCIMEndpointProperties|ref-scimEndpointProperties.txt|</argument>
								<argument>pl.edu.icm.unity.oauth.rp.local.LocalOAuthRPProperties|ref-LocalOAuthRPProperties.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>java</goal>
						</goals>
					</execution>
					<execution>
						<id>asciidoctor-updatehowto</id>
						<phase>pre-site</phase>
						<configuration>
							<executable>asciidoctor</executable>
							<arguments>
								<argument>-D</argument>
								<argument>${project.reporting.outputDirectory}</argument>
								<argument>target/workspace/update-howto-v2.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
					<execution>
						<id>asciidoctor</id>
						<phase>pre-site</phase>
						<configuration>
							<executable>asciidoctor</executable>
							<arguments>
								<argument>-D</argument>
								<argument>${project.reporting.outputDirectory}</argument>
								<argument>-a</argument>
								<argument>revnumber=${project.version}@</argument>
								<argument>target/workspace/manual.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
					<execution>
						<id>asciidoctor-samlhowto</id>
						<phase>pre-site</phase>
						<configuration>
							<executable>asciidoctor</executable>
							<arguments>
								<argument>-D</argument>
								<argument>${project.reporting.outputDirectory}</argument>
								<argument>target/workspace/saml-howto.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
					<execution>
						<id>asciidoctor-restapi</id>
						<phase>pre-site</phase>
						<configuration>
							<executable>asciidoctor</executable>
							<arguments>
								<argument>-D</argument>
								<argument>${project.reporting.outputDirectory}</argument>
								<argument>target/workspace/rest-api-v1.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
					<execution>
						<id>asciidoctor-upmanrestapi</id>
						<phase>pre-site</phase>
						<configuration>
							<executable>asciidoctor</executable>
							<arguments>
								<argument>-D</argument>
								<argument>${project.reporting.outputDirectory}</argument>
								<argument>target/workspace/upman-rest-api-v1.txt</argument>
							</arguments>
						</configuration>
						<goals>
							<goal>exec</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
	
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>3.3.1</version>
				<configuration>
					<includeDependencySources>true</includeDependencySources>
					<dependencySourceIncludes>
						<dependencySourceInclude>io.imunity:unity-types-api</dependencySourceInclude>
						<dependencySourceInclude>io.imunity:unity-server-engine-api</dependencySourceInclude>
					</dependencySourceIncludes>
					<additionalparam>-Xdoclint:none</additionalparam>
					<subpackages>pl.edu.icm.unity</subpackages>
				</configuration>
				<reportSets>
					<reportSet>
						<reports>
							<report>javadoc</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-project-info-reports-plugin</artifactId>
				<version>2.6</version>
				<reportSets>
					<reportSet>
						<reports>
							<report>summary</report>
							<report>scm</report>
							<!-- 
							<report>mailing-list</report>
							<report>project-team</report>
							<report>issue-tracking</report>
							<report>license</report>
							<report>dependencies</report> 
							-->
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>	
</project>
