<?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>org.tango-controls</groupId>
    <artifactId>tango-idl-java</artifactId>
    <version>6.0.4</version>
    <packaging>jar</packaging>

    <properties>
        <project.scm.name>${project.artifactId}</project.scm.name>
        <jacorb.version>3.8</jacorb.version>
	    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <name>${project.scm.name}</name>
    <description>TANGO interface defined in IDL and compiled with jacorb IDL compiler</description>
    <url>https://gitlab.com/tango-controls/${project.scm.name}.git</url>
    <inceptionYear>2004</inceptionYear>


    <issueManagement>
        <system>Gitlab</system>
        <url>https://gitlab.com/tango-controls/${project.scm.name}/-/issues</url>
    </issueManagement>

    <licenses>
        <license>
            <name>GNU Lesser General Public License, Version 3.0</name>
            <url>https://www.gnu.org/licenses/lgpl-3.0.html</url>
			<distribution>repo</distribution>
        </license>
    </licenses>
    
    <organization>
        <name>tango-controls</name>
        <url>https://tango-controls.org</url>
    </organization>

    <developers>
        <developer>
            <id>verdier</id>
            <name>Pascal Verdier</name>
            <email>verdier@esrf.fr</email>
            <organization>ESRF</organization>
            <organizationUrl>https://www.ersf.eu</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
            <timezone>1</timezone>
        </developer>
        <developer>
            <id>abeille</id>
            <name>Gwenaëlle Abeillé</name>
            <email>gwenaelle.abeille@synchrotron-soleil.fr</email>
            <organization>Synchrotron Soleil</organization>
            <organizationUrl>https://www.synchrotron-soleil.fr</organizationUrl>
            <roles>
                <role>Integrator</role>
                <role>Developer</role> 
            </roles>
            <timezone>1</timezone>
        </developer>
        <developer>
            <id>ingvord</id>
            <name>Igor Khokhriakov</name>
            <email>mail@ingvord.ru</email>
            <roles>
                <role>Integrator</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@gitlab.com:tango-controls/${project.scm.name}</connection>
        <developerConnection>scm:git:git@gitlab.com:tango-controls/${project.scm.name}</developerConnection>
        <url>https://gitlab.com/tango-controls/${project.scm.name}</url>
    </scm>

    <distributionManagement>
        <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>

    <dependencies>
        <dependency>
            <groupId>org.jacorb</groupId>
            <artifactId>jacorb-omgapi</artifactId>
            <version>${jacorb.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jacorb</groupId>
            <artifactId>jacorb-idl-compiler</artifactId>
            <version>${jacorb.version}</version>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>${project.basedir}</directory>
                <includes>
                    <include>include/tango.idl</include>
                </includes>
            </resource>
        </resources>
        <plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.14.0</version>
				<configuration>
					<release>8</release>
					<source>8</source>
					<target>8</target>
				</configuration>
			</plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>idlj-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <id>compile-tango-idl</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                        <configuration>
                            <debug>true</debug>
                            <compiler>jacorb</compiler>
                            <sources>
                                <source>
                                    <additionalArguments>
                                        <additionalArgument>-notimestamps</additionalArgument>
                                        <additionalArgument>-nofinal</additionalArgument>
                                    </additionalArguments>
                                    <packagePrefix>fr.esrf</packagePrefix>
                                    <includes>
                                        <include>include/tango.idl</include>
                                    </includes>
                                    <emitStubs>true</emitStubs>
                                    <emitSkeletons>true</emitSkeletons>
                                </source>
                            </sources>
                            <sourceDirectory>${project.basedir}</sourceDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.2</version>
                <configuration>
                    <forceCreation>true</forceCreation>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.1.0</version>
                <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>
                <version>3.1.0</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                        	 <doclint>none</doclint>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>versions-maven-plugin</artifactId>
                        <version>2.7</version>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.7.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>

