<?xml version="1.0" encoding="UTF-8"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<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.apache.jena</groupId>
  <artifactId>jena-parent</artifactId>
  <packaging>pom</packaging>
  <url>http://jena.apache.org/</url>
  <version>12</version>
  <name>Apache Jena - Parent</name>

  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <!-- This version number is also in the top POM -->
    <version>16</version>
    <relativePath />
  </parent>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <organization>
    <name>The Apache Software Foundation</name>
    <url>http://www.apache.org/</url>
  </organization>

  <properties>
    <ver.slf4j>1.7.6</ver.slf4j>
    <ver.log4j>1.2.17</ver.log4j>
    <ver.junit>4.11</ver.junit>
    <ver.xerces>2.11.0</ver.xerces>

    <ver.jsonldjava>0.5.1</ver.jsonldjava>
    <!-- Used by jena-osgi and must be in-step with jsonldjava -->
    <ver.jackson>2.3.3</ver.jackson>

    <!-- These are connected because solr4j depends on httpclient as well -->
    <ver.httpclient>4.2.6</ver.httpclient>
    <ver.httpcore>4.2.5</ver.httpcore>
    <ver.lucene>4.6.1</ver.lucene>
    <ver.solr>4.6.1</ver.solr>
    <ver.spatial4j>0.4</ver.spatial4j>

    <jdk.version>1.7</jdk.version>
    <targetJdk>${jdk.version}</targetJdk> <!-- MPMD-86 workaround -->

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
  </properties>

  <profiles>
    <profile>
      <!-- Turn of doclint for java8 and later -->
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>

      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <!-- Version management -->
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${ver.junit}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>${ver.xerces}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient-cache</artifactId>
        <version>${ver.httpclient}</version>
        <exclusions>
          <!-- Replace with slf4j adapter -->
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${ver.httpclient}</version>
        <exclusions>
          <!-- Replace with slf4j adapter -->
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <dependency>
	<groupId>org.apache.thrift</groupId>
	<artifactId>libthrift</artifactId>
	<version>0.9.2</version>
	<exclusions>
	  <!-- Use whatever version Jena is using -->
	  <exclusion>
	    <groupId>org.apache.httpcomponents</groupId>
	    <artifactId>httpcore</artifactId>
	  </exclusion>
	  <exclusion>
	    <groupId>org.apache.commons</groupId>
	    <artifactId>commons-lang3</artifactId>
	  </exclusion>
	</exclusions>
      </dependency>

      <dependency>
	<groupId>org.apache.commons</groupId>
	<artifactId>commons-csv</artifactId>
	<version>1.0</version>
      </dependency>

      <dependency>
	<groupId>org.apache.commons</groupId>
	<artifactId>commons-lang3</artifactId>
	<version>3.3.2</version>
      </dependency>

      <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.1</version>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-collections4</artifactId>
        <version>4.0</version>
      </dependency>
      
      <dependency>
        <groupId>com.github.jsonld-java</groupId>
        <artifactId>jsonld-java</artifactId>
        <version>${ver.jsonldjava}</version>
        <exclusions>
          <exclusion>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
          </exclusion>
          <!-- Exclude so we use our choice of versions -->
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-cache</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Lucene dependencies -->
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>${ver.lucene}</version>
        <type>jar</type>
      </dependency>

      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers-common</artifactId>
        <version>${ver.lucene}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-queryparser</artifactId>
        <version>${ver.lucene}</version>
      </dependency>

      <!-- Solr client -->
      <!-- Exclusion of slf4j: Necessary so as to pick the version we want. 
        solrj->zookeeper has a dependency on slf4j -->

      <dependency>
        <artifactId>solr-solrj</artifactId>
        <groupId>org.apache.solr</groupId>
        <version>${ver.solr}</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- For jena-spatial -->
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-spatial</artifactId>
        <version>${ver.lucene}</version>
      </dependency>

      <dependency>
        <groupId>com.spatial4j</groupId>
        <artifactId>spatial4j</artifactId>
        <version>${ver.spatial4j}</version>
      </dependency>

      <!-- Logging -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${ver.slf4j}</version>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${ver.slf4j}</version>
      </dependency>

      <!-- And intercept any uses of Jakarta Commons Logging e.g. Apache Common 
        HTTP client. -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>${ver.slf4j}</version>
      </dependency>

      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>${ver.log4j}</version>
        <exclusions>
          <!-- Exclude things that don't resolve in some versions of log4j -->
          <exclusion>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jdmk</groupId>
            <artifactId>jmxtools</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.sun.jmx</groupId>
            <artifactId>jmxri</artifactId>
          </exclusion>
          <exclusion>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>

    <!-- Needed because of the logging helper code -->
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
    </dependency>

  </dependencies>

  <build>
    <!-- Run the enforcer plugin automatically at compile time -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration combine.self="override">
              <rules>
                <requireJavaVersion>
                  <version>1.7.0</version>
                </requireJavaVersion>
                <requirePluginVersions>
                  <message>Best practice is to always define plugin versions!</message>
                  <banLatest>true</banLatest>
                  <banRelease>true</banRelease>
                </requirePluginVersions>
                <requireReleaseDeps>
                  <message>No SNAPSHOT dependencies are allowed!</message>
                  <onlyWhenRelease>true</onlyWhenRelease>
                </requireReleaseDeps>
              </rules>
              <fail>true</fail>
              <failFast>true</failFast>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Run the RAT Plugin -->
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.11</version>
        <executions>
          <execution>
            <id>rat-checks</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
           <excludeSubProjects>true</excludeSubProjects>
             <excludes>
               <!--
               jena-core exclusions
               -->
               <exclude>**/src-examples/data/*</exclude>
               
               <!--
               jena-fuseki exclusions
               -->
               <exclude>**/dist/ABOUT</exclude>
               <exclude>**/SEE_FUSEKI2</exclude>
               <!-- 
               Need to exclude JS and CSS since much of it comes from other Apache licensed projects 
               e.g. Bootstrap, Qonsole
               
               -->
               <exclude>**/src/main/webapp/css/*</exclude>
               <exclude>**/src/main/webapp/fonts/*</exclude>
               <exclude>**/src/main/webapp/js/**/*</exclude>
               
               <!-- General exclusions -->
               <!-- 
               Vocabularies are often just local copies of vocabularies
               published by others
               -->
               <exclude>**/vocabularies/*</exclude>
               <exclude>**/Vocabularies/*</exclude>

               <!--
               Javadoc add-ons files are required to be simple and our javadoc configuration
               will ensure appropriate license and copyright statements are inserted
               into generated documentation anyway so no need to put license statements in these
               files
               -->
               <exclude>**/src/main/**/*.html</exclude>
               <exclude>**/src/**/package-info.java</exclude>
               
               <exclude>**/DEPENDENCIES</exclude>
               
               <!--
               Text and Markdown files are typically used only for documentation purposes
               and license declarations are usually spurious in these files since often they
               will refer to the LICENSE/NOTICE for users to find the actual licenses
               -->
               <exclude>**/*.txt</exclude>
               <exclude>**/*.md</exclude>
               
               <!--
               META-INF services files can include comments but a license header would be
               unecessarily clutter so we exclude these
               -->
               <exclude>**/META-INF/services/*</exclude>
               
               <!--
               Jena historically has large numbers of small test file
               with no license headers.  Such small files are not required 
               to have headers. 

               In addition, there are files with different Licenses
               (e.g. W3C Software Licence, W3C Test Suite License) as
               noted in the code tree.
               -->
               <exclude>**/src/test/resources/**/*</exclude>
               <exclude>**/testing/**/*</exclude>

               <exclude>**/log4j.properties</exclude>
               <exclude>**/log4j-testing.properties</exclude>
               <exclude>**/derby.log</exclude>
               <exclude>**/DB/**/*</exclude>
	       <!-- TDB config files JSON - no comments allowed -->
               <exclude>**/tdb*.cfg</exclude>
	       <!-- Fuseki2 server "run" area -->
	       <exclude>**/run/**/*</exclude>
	       <!-- Cached classpath for commands - autogenerated -->
	       <exclude>**/*.classpath</exclude>

	       <!-- Exclude anything created during the build (plugin generated files) ->-->
	       <exclude>**/target/**/*</exclude>
	       <!-- MSHADE-124 -->
	       <exclude>**/dependency-reduced-pom.xml</exclude>
            </excludes>
        </configuration>
      </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <extensions>true</extensions>
        </plugin>
    </plugins>

    <!-- Plugin version list: http://maven.apache.org/plugins/index.html -->
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <configuration>
            <encoding>UTF-8</encoding>
            <debug>true</debug>
            <debuglevel>source,lines,vars</debuglevel>
            <optimize>true</optimize>
            <source>${jdk.version}</source>
            <target>${jdk.version}</target>
          </configuration>
        </plugin>

        <!-- Avoid the warning from m2e: 
	     "maven-remote-resources-plugin (goal "process") is ignored by m2e." 
	-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <!-- 
		    Warning: 
		    "maven-remote-resources-plugin (goal "process") is ignored by m2e." 
		  -->
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <!-- Warning: "maven-enforcer-plugin (goal "enforce") is ignored by m2e." -->
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-remote-resources-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>process</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>

              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
            <!-- Only needed in some jars <execution> <id>attach-sources-test</id> 
              <goals> <goal>test-jar-no-fork</goal> </goals> </execution> -->
          </executions>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <version>true</version>
            <show>public</show>
            <quiet>true</quiet>
            <encoding>UTF-8</encoding>
            <windowtitle>${project.name} ${project.version}</windowtitle>
            <doctitle>${project.name} ${project.version}</doctitle>
            <bottom>Licensed under the Apache License, Version 2.0</bottom>
            <links>
              <link>http://jena.apache.org/documentation/javadoc/jena/</link>
              <link>http://jena.apache.org/documentation/javadoc/arq/</link>
              <link>http://jena.apache.org/documentation/javadoc/tdb/</link>
              <link>http://jena.apache.org/documentation/javadoc/text/</link>
              <link>http://jena.apache.org/documentation/javadoc/spatial/</link>
              <link>http://jena.apache.org/documentation/javadoc/fuseki/</link>
              <link>http://jena.apache.org/documentation/javadoc/security/</link>
              <link>http://jena.apache.org/documentation/javadoc/jdbc/</link>
            </links>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <configuration>
            <encoding>UTF-8</encoding>
          </configuration>
        </plugin>

	<!-- Temp fix for remote-resources while waiting for remote-resources >1.5
	     1.6 should fix this - SNAPSHOT already does.
	-->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-remote-resources-plugin</artifactId>
          <version>1.5</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.shared</groupId>
              <artifactId>maven-filtering</artifactId>
              <version>1.2</version>
            </dependency>
          </dependencies>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <configuration>
            <overWriteReleases>false</overWriteReleases>
            <overWriteIfNewer>true</overWriteIfNewer>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.9</version>
          <configuration>
            <!-- By default, have separate Eclipse and maven build areas -->
            <buildOutputDirectory>${project.build.directory}/classes-eclipse</buildOutputDirectory>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>false</downloadJavadocs>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <executions>
            <execution>
              <id>enforce</id>
              <goals>
                <goal>enforce</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <rules>
              <requirePluginVersions>
                <message>Best practice is to always define plugin versions!</message>
                <banLatest>true</banLatest>
                <banRelease>true</banRelease>
              </requirePluginVersions>
              <requireReleaseDeps>
                <message>No SNAPSHOT dependencies are allowed!</message>
                <onlyWhenRelease>true</onlyWhenRelease>
              </requireReleaseDeps>
              <DependencyConvergence />
            </rules>
            <fail>true</fail>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>2.5.3</version>
          <extensions>true</extensions>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <reporting>
    <!-- <outputDirectory>${project.build.directory}/site</outputDirectory> -->

    <plugins>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <outputDirectory>${project.basedir}/target/surefire-reports-html</outputDirectory>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <instrumentation>
            <ignores>
              <ignore>org.slf4j.*</ignore>
            </ignores>
          </instrumentation>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.7</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.3</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <linkXref>true</linkXref>
          <sourceEncoding>utf-8</sourceEncoding>
          <minimumTokens>100</minimumTokens>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>2.3.2</version>
      </plugin>

    </plugins>

  </reporting>

  <scm>
    <tag>jena-2.13.0-rc1</tag>
  </scm>
</project>
