<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>org.phoebus</groupId>
    <artifactId>dependencies</artifactId>
    <version>5.0.5</version>
  </parent>
  <artifactId>phoebus-target</artifactId>
  <name>${project.groupId}:${project.artifactId}</name>
  <properties>
    <preReleaseScripts>${project.basedir}/release_classpath.py</preReleaseScripts>
  </properties>

  <profiles>
    <!-- Overriding the default release profile to run the pre release script 
      with makes the required modification to .classpath and other manually maintained 
      files -->
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
              <execution>
                <goals>
                  <goal>exec</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <executable>python</executable>
              <!-- <workingDirectory>dependencies/phoebus-target</workingDirectory> -->
              <arguments>
                <argument>${preReleaseScripts}</argument>
              </arguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <!-- For testing. mockito-all contains hamcrest packages, resulting in 
      conflicts. This combination of junit, mockito, hamcrest seems to work -->
    <dependency>
      <groupId>org.phoebus</groupId>
      <artifactId>install-jars</artifactId>
      <version>5.0.5</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>

    <!-- JavaFX, since JDK 11 a separate module -->
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <version>${openjfx.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-web</artifactId>
      <version>${openjfx.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-swing</artifactId>
      <version>${openjfx.version}</version>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
      <version>${openjfx.version}</version>
    </dependency>

    <!--  Includes
          jca-2.4.6.jar
          epics-util-1.0.4.jar
          epics-pvdata-6.1.6.jar
          epics-pvaccess-5.1.6.jar
          epics-ntypes-0.3.6.jar
     -->
    <dependency>
      <groupId>org.epics</groupId>
      <artifactId>epics-core</artifactId>
      <version>${epics.version}</version>
      <type>pom</type>
    </dependency>

    <!-- PVA compression codec -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-compress</artifactId>
      <version>${commons.compress.version}</version>
    </dependency>

    <dependency>
      <groupId>org.epics</groupId>
      <artifactId>vtype</artifactId>
      <version>${vtype.version}</version>
    </dependency>

    <dependency>
      <groupId>org.epics</groupId>
      <artifactId>vtype-json</artifactId>
      <version>${vtype.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.mail</groupId>
      <artifactId>javax.mail</artifactId>
      <version>1.6.1</version>
    </dependency>
    <dependency>
      <groupId>org.python</groupId>
      <artifactId>jython-standalone</artifactId>
      <version>${jython.version}</version>
    </dependency>
    <dependency>
      <groupId>net.sf.py4j</groupId>
      <artifactId>py4j</artifactId>
      <version>0.10.2.1</version>
    </dependency>
    <!-- JDBC connectors For Oracle, MySQL, Postgres -->
    <dependency>
      <groupId>com.oracle.database.jdbc</groupId>
      <artifactId>ojdbc8</artifactId>
      <version>12.2.0.1</version>
      <exclusions>
        <exclusion>
          <groupId>com.oracle.database.jdbc</groupId>
          <artifactId>ucp</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.oracle.database.security</groupId>
          <artifactId>oraclepki</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.oracle.database.security</groupId>
          <artifactId>osdt_cert</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.oracle.database.security</groupId>
          <artifactId>osdt_core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.oracle.database.ha</groupId>
          <artifactId>simplefan</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.oracle.database.ha</groupId>
          <artifactId>ons</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.mysql</groupId>
      <artifactId>mysql-connector-j</artifactId>
      <version>${mysql.version}</version>
    </dependency>
    <dependency>
      <groupId>org.postgresql</groupId>
      <artifactId>postgresql</artifactId>
      <version>${postgresql.driver.version}</version>
    </dependency>
    <!-- For data browser to export Matlab files -->
    <dependency>
      <groupId>org.tallison</groupId>
      <artifactId>jmatio</artifactId>
      <version>1.2</version>
    </dependency>

    <!-- JavaScript (replacement for nashorn) -->
    <dependency>
      <groupId>org.mozilla</groupId>
      <artifactId>rhino</artifactId>
      <version>1.7.12</version>
    </dependency>


    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jaxb</groupId>
      <artifactId>jaxb-runtime</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.activation</groupId>
      <artifactId>javax.activation</artifactId>
      <version>1.2.0</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>${jackson.version}</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr310</artifactId>
      <version>${jackson.version}</version>
    </dependency>

    <!-- Jetty, web server used by scan server, archive engine, .. -->
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
      <version>${jetty.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-security</artifactId>
      <version>${jetty.version}</version>
    </dependency>

    <!-- Derby, database used by scan server -->
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derby</artifactId>
      <version>${derby.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derbytools</artifactId>
      <version>${derby.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.derby</groupId>
      <artifactId>derbyshared</artifactId>
      <version>${derby.version}</version>
    </dependency>

    <!-- Kafka, used by alarm tools -->
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-streams</artifactId>
      <version>${kafka.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>${kafka.version}</version>
    </dependency>

    <!-- Reactive ('Flow') API used by PV -->
    <dependency>
      <groupId>io.reactivex.rxjava3</groupId>
      <artifactId>rxjava</artifactId>
      <version>3.0.9</version>
    </dependency>

    <!-- freeTTS text to speech library used by annunciator -->
    <dependency>
      <groupId>net.sf.sociaal</groupId>
      <artifactId>freetts</artifactId>
      <version>1.2.2</version>
    </dependency>

    <!-- elastic client -->
    <dependency>
      <groupId>co.elastic.clients</groupId>
      <artifactId>elasticsearch-java</artifactId>
      <version>${elasticsearch.version}</version>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>elasticsearch-rest-client-sniffer</artifactId>
      <version>${elasticsearch.version}</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.jfxtras/jfxtras-controls -->
    <dependency>
      <groupId>org.jfxtras</groupId>
      <artifactId>jfxtras-controls</artifactId>
      <version>9.0-r1</version>
    </dependency>
    <dependency>
      <groupId>org.jfxtras</groupId>
      <artifactId>jfxtras-agenda</artifactId>
      <version>9.0-r1</version>
    </dependency>
    <dependency>
      <groupId>org.jfxtras</groupId>
      <artifactId>jfxtras-common</artifactId>
      <version>9.0-r1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.atlassian.commonmark/commonmark -->
    <dependency>
      <groupId>com.atlassian.commonmark</groupId>
      <artifactId>commonmark</artifactId>
      <version>0.15.2</version>
    </dependency>
    <dependency>
      <groupId>com.atlassian.commonmark</groupId>
      <artifactId>commonmark-ext-gfm-tables</artifactId>
      <version>0.15.2</version>
    </dependency>
    <dependency>
      <groupId>com.atlassian.commonmark</groupId>
      <artifactId>commonmark-ext-image-attributes</artifactId>
      <version>0.15.2</version>
    </dependency>

    <!-- Display Builder -->
    <dependency>
      <groupId>org.controlsfx</groupId>
      <artifactId>controlsfx</artifactId>
      <version>11.1.2</version>
      <exclusions>
        <exclusion>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-base</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-graphics</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-media</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- Apache Batik (for SVG) -->
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>batik-all</artifactId>
      <version>${batik.version}</version>
      <exclusions>
        <exclusion>
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.xmlgraphics</groupId>
      <artifactId>xmlgraphics-commons</artifactId>
      <version>2.4</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-math3</artifactId>
      <version>${apache.commons.math.version}</version>
    </dependency>

    <!-- MQTT client library -->
    <dependency>
      <groupId>org.eclipse.paho</groupId>
      <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
      <version>1.2.2</version>
    </dependency>
    <dependency>
      <groupId>org.testfx</groupId>
      <artifactId>testfx-core</artifactId>
      <version>4.0.13-alpha</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testfx</groupId>
      <artifactId>testfx-junit</artifactId>
      <version>4.0.13-alpha</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java -->
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
      <version>4.33.0</version>
    </dependency>
    <dependency>
      <groupId>org.epics</groupId>
      <artifactId>pbrawclient</artifactId>
      <version>0.2.2</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>${jgit.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit.archive</artifactId>
      <version>${jgit.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
      <version>${jgit.version}</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit.ssh.apache</artifactId>
      <version>${jgit.version}</version>
    </dependency>
    <!-- Spring Boot -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
      <version>${spring.boot.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
      <version>${spring.boot.version}</version>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <version>${spring.boot.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-websocket</artifactId>
      <version>${spring.boot.version}</version>
    </dependency>

    <dependency>
       <groupId>org.springdoc</groupId>
       <artifactId>springdoc-openapi-ui</artifactId>
       <version>1.7.0</version>
     </dependency>

    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
      <version>2.0.1.Final</version>
    </dependency>

    <!--log4j2 to slf4j adapter-->
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-to-slf4j</artifactId>
      <version>${log4j-to-slf4j.version}</version>
    </dependency>

    <!--JUL bindings for sfl4j-->
    <dependency> 
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.28</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.tango-controls/JTango -->
    <dependency>
      <groupId>org.tango-controls</groupId>
      <artifactId>JTango</artifactId>
      <version>9.7.0</version>
      <type>pom</type>
    </dependency>

    <dependency>
      <groupId>javax.jms</groupId>
      <artifactId>javax.jms-api</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>javax.json</groupId>
      <artifactId>javax.json-api</artifactId>
      <version>1.1.4</version>
    </dependency>

    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <version>2.1</version>
    </dependency>

    <!-- required but Qserver applications -->
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.19.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.apache.activemq/activemq-client -->
    <dependency>
      <groupId>org.apache.activemq</groupId>
      <artifactId>activemq-client</artifactId>
      <version>${activemq.client.version}</version>
    </dependency>

    <!-- EPICS Jackie client for Jackie PV source -->
    <dependency>
      <groupId>com.aquenos.epics.jackie</groupId>
      <artifactId>epics-jackie-client</artifactId>
      <version>3.1.0</version>
    </dependency>
    
    <!-- bouncycastle library used in PVA to decode and check OCSP confirmation of certificates
         bcpkix depends on bcutil, which depends on bcprov
     -->
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <version>1.82</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcutil-jdk18on</artifactId>
      <version>1.82</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <version>1.82</version>
    </dependency>
    
    <!-- Lib to read/write MS Office (Excel, ..) files, fetching only POI itself -->
    <dependency>
      <groupId>org.apache.poi</groupId>
      <artifactId>poi</artifactId>
      <exclusions>
        <exclusion>
          <groupId>com.zaxxer</groupId>
          <artifactId>SparseBitSet</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
        </exclusion>
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-collections4</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-math3</artifactId>
        </exclusion>
      </exclusions>
      <version>5.0.0</version>
    </dependency>

    <!-- For file content detection -->
    <dependency>
      <groupId>org.apache.tika</groupId>
      <artifactId>tika-core</artifactId>
      <version>3.2.0</version>
    </dependency>
    
    <!-- ChartFX library for the Waterfall Plot widget -->
    <dependency>
      <groupId>io.fair-acc</groupId>
      <artifactId>chartfx</artifactId>
      <version>11.3.1</version>
      <exclusions>
        <!-- Use the Phoebus versions of javafx-base and javafx-controls: -->
        <exclusion>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-base</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.openjfx</groupId>
          <artifactId>javafx-controls</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/lib</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
