ANY23-356 clean up poms from cli/core/encoding/mime/service/parent, update deps.
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/6b76f346 Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/6b76f346 Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/6b76f346 Branch: refs/heads/master Commit: 6b76f3466da0916dc7f61b8136133b55e0400ffa Parents: 99f3f0a Author: Hans <[email protected]> Authored: Fri Jun 29 17:26:25 2018 -0500 Committer: Hans <[email protected]> Committed: Mon Jul 2 18:24:38 2018 -0500 ---------------------------------------------------------------------- cli/pom.xml | 70 +++++++ core/pom.xml | 181 +++++++++++++++---- encoding/pom.xml | 72 ++++++++ mime/pom.xml | 101 +++++++++-- pom.xml | 84 ++++----- service/pom.xml | 44 +++-- .../org/apache/any23/servlet/ServletTest.java | 94 +++++----- 7 files changed, 472 insertions(+), 174 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/cli/pom.xml ---------------------------------------------------------------------- diff --git a/cli/pom.xml b/cli/pom.xml index 9ff9796..0cae013 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -31,6 +31,8 @@ <description>Command line interface.</description> <dependencies> + + <!-- BEGIN: Any23 --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>apache-any23-api</artifactId> @@ -89,6 +91,8 @@ <version>${project.version}</version> <scope>runtime</scope> </dependency> + <!-- END: Any23 --> + <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> @@ -202,6 +206,72 @@ <optional>true</optional> </dependency> <!-- END: Test Dependencies --> + + <!-- BEGIN: additional dependencies used by RDF4J or Tika + (include to ensure versions match those specified in + dependencyManagement section of parent pom) --> + <dependency> <!-- used by RDF4J, Tika --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpmime</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-cache</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-osgi</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>fluent-hc</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-osgi</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-nio</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi-scratchpad</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + </dependency> + <!-- END: additional dependencies used by RDF4J or Tika --> + </dependencies> <build> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/core/pom.xml ---------------------------------------------------------------------- diff --git a/core/pom.xml b/core/pom.xml index 09c13e2..e492fb6 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -31,6 +31,8 @@ <description>Core Any23 library implementation.</description> <dependencies> + + <!-- BEGIN: Any23 --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>apache-any23-api</artifactId> @@ -58,38 +60,42 @@ <type>test-jar</type> <scope>test</scope> </dependency> - <dependency> - <groupId>commons-lang</groupId> - <artifactId>commons-lang</artifactId> - </dependency> - <dependency> + <!-- END: Any23 --> + + <!-- BEGIN: httpcomponents --> + <dependency> <!-- used by RDF4J, Tika --> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> </dependency> - <dependency> + <dependency> <!-- used by RDF4J, Tika --> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpcore</artifactId> </dependency> - <dependency> - <groupId>commons-codec</groupId> - <artifactId>commons-codec</artifactId> + <dependency> <!-- used by RDF4J, Tika --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpmime</artifactId> </dependency> - <dependency> - <groupId>net.sourceforge.nekohtml</groupId> - <artifactId>nekohtml</artifactId> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-cache</artifactId> </dependency> - <dependency> - <groupId>org.jsoup</groupId> - <artifactId>jsoup</artifactId> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient-osgi</artifactId> </dependency> - <dependency> - <groupId>com.beust</groupId> - <artifactId>jcommander</artifactId> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>fluent-hc</artifactId> </dependency> - <dependency> - <groupId>org.yaml</groupId> - <artifactId>snakeyaml</artifactId> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-osgi</artifactId> + </dependency> + <dependency> <!-- used by RDF4J --> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore-nio</artifactId> </dependency> + <!-- END: httpcomponents --> <!-- BEGIN: Tika --> <dependency> @@ -100,41 +106,69 @@ <groupId>org.apache.tika</groupId> <artifactId>tika-parsers</artifactId> </dependency> - <dependency> + <dependency> <!-- used by Tika --> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> </dependency> <!-- END: Tika --> <!-- BEGIN: RDF4J --> - <dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-model</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-rio-api</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-jsonld</artifactId> + <artifactId>rdf4j-rio-languages</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-turtle</artifactId> + <artifactId>rdf4j-rio-datatypes</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-rdfxml</artifactId> + <artifactId>rdf4j-rio-binary</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-n3</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-nquads</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-rio-ntriples</artifactId> </dependency> - <dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-rdfjson</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-rdfxml</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-rio-trix</artifactId> </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-turtle</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-trig</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-jsonld</artifactId> + </dependency> <dependency> <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-repository-sail</artifactId> @@ -147,7 +181,8 @@ <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-repository-api</artifactId> </dependency> - <dependency> + + <dependency> <!-- used by RDF4J: must include to force v. 0.12.0 --> <groupId>com.github.jsonld-java</groupId> <artifactId>jsonld-java</artifactId> </dependency> @@ -159,6 +194,14 @@ <groupId>net.sourceforge.owlapi</groupId> <artifactId>owlapi-rio</artifactId> </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>net.sourceforge.owlapi</groupId> + <artifactId>owlapi-parsers</artifactId> + </dependency> + <dependency> <!-- used by owlapi-rio --> + <groupId>net.sourceforge.owlapi</groupId> + <artifactId>owlapi-api</artifactId> + </dependency> <!-- Need to include apibinding in runtime scope to allow dependency injection to work transparently inside of owlapi --> <dependency> @@ -168,13 +211,77 @@ </dependency> <!-- END: RDF4J --> - <!-- BEGIN: Apache Commons, this version is hosted in the - any23-repository-external repository --> - <dependency> + <!-- BEGIN: Misc --> + <dependency> <!-- used by Tika --> <groupId>org.apache.commons</groupId> <artifactId>commons-csv</artifactId> </dependency> - <!-- END: Apache Commons CSV --> + + <dependency> <!-- used by Tika --> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + </dependency> + + <dependency> <!-- used by Tika --> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + + <dependency> + <groupId>commons-lang</groupId> + <artifactId>commons-lang</artifactId> + </dependency> + + <dependency> + <groupId>net.sourceforge.nekohtml</groupId> + <artifactId>nekohtml</artifactId> + </dependency> + + <dependency> <!-- used by Tika --> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + </dependency> + + <dependency> + <groupId>com.beust</groupId> + <artifactId>jcommander</artifactId> + </dependency> + + <dependency> + <groupId>org.yaml</groupId> + <artifactId>snakeyaml</artifactId> + </dependency> + <!-- END: Misc --> + + <!-- BEGIN: slf4j --> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + </dependency> + <!-- END: slf4j --> + + <!-- BEGIN: POI --> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi-scratchpad</artifactId> + </dependency> + <dependency> <!-- used by Tika --> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + </dependency> + <!-- END: POI --> <!-- BEGIN: Test Dependencies --> <dependency> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/encoding/pom.xml ---------------------------------------------------------------------- diff --git a/encoding/pom.xml b/encoding/pom.xml index a9edb1d..ab4b7af 100644 --- a/encoding/pom.xml +++ b/encoding/pom.xml @@ -31,6 +31,8 @@ <description>Encoding detection library.</description> <dependencies> + + <!-- BEGIN: Any23 --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>apache-any23-api</artifactId> @@ -43,10 +45,78 @@ <scope>test</scope> <type>test-jar</type> </dependency> + <!-- END: Any23 --> + + <!-- BEGIN: Tika --> <dependency> <groupId>org.apache.tika</groupId> <artifactId>tika-parsers</artifactId> </dependency> + <!-- ensure dependencies of tika-parsers match versions + specified in dependencyManagement section of parent pom --> + <dependency> + <groupId>org.apache.tika</groupId> + <artifactId>tika-core</artifactId> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-csv</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpmime</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-scratchpad</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + </dependency> + <dependency> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> + </dependency> + <!-- END: Tika --> + + <!-- BEGIN: test dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> @@ -57,6 +127,8 @@ <artifactId>slf4j-log4j12</artifactId> <scope>test</scope> </dependency> + <!-- END: test dependencies --> + </dependencies> <build> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/mime/pom.xml ---------------------------------------------------------------------- diff --git a/mime/pom.xml b/mime/pom.xml index 57927e4..6e2b9ec 100644 --- a/mime/pom.xml +++ b/mime/pom.xml @@ -31,6 +31,8 @@ <description>MIME Type detection library.</description> <dependencies> + + <!-- BEGIN: Any23 --> <dependency> <groupId>${project.groupId}</groupId> <artifactId>apache-any23-api</artifactId> @@ -48,15 +50,37 @@ <scope>test</scope> <type>test-jar</type> </dependency> + <!-- END: Any23 --> + + <!-- BEGIN: RDF4J --> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <scope>test</scope> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-turtle</artifactId> + <scope>compile</scope> </dependency> <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-ntriples</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-n3</artifactId> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-nquads</artifactId> + <scope>runtime</scope> + </dependency> + <!-- END: RDF4J --> + + <dependency> <!-- used by Tika, rdf4j --> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </dependency> + + <!-- BEGIN: Tika --> <dependency> <groupId>org.apache.tika</groupId> <artifactId>tika-core</artifactId> @@ -65,33 +89,76 @@ <groupId>org.apache.tika</groupId> <artifactId>tika-parsers</artifactId> </dependency> + <!-- ensure dependencies of tika-parsers match versions + specified in dependencyManagement section of parent pom --> <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-turtle</artifactId> - <scope>compile</scope> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> </dependency> <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-ntriples</artifactId> - <scope>runtime</scope> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> </dependency> <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-n3</artifactId> - <scope>runtime</scope> + <groupId>org.apache.commons</groupId> + <artifactId>commons-csv</artifactId> </dependency> <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-nquads</artifactId> - <scope>runtime</scope> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpmime</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-scratchpad</artifactId> + </dependency> + <dependency> + <groupId>org.apache.poi</groupId> + <artifactId>poi-ooxml</artifactId> + </dependency> + <dependency> + <groupId>org.jsoup</groupId> + <artifactId>jsoup</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jul-to-slf4j</artifactId> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>jcl-over-slf4j</artifactId> </dependency> - <!-- Logging --> + <!-- END: Tika --> + + + <!-- BEGIN: test dependencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> - <version>${slf4j.logger.version}</version> <scope>test</scope> </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <scope>test</scope> + </dependency> + <!-- END: test dependencies --> + </dependencies> <build> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index 97d5ac8..29f44cc 100644 --- a/pom.xml +++ b/pom.xml @@ -272,12 +272,12 @@ <httpclient.version>4.5.5</httpclient.version> <httpcore.version>4.4.9</httpcore.version> - <owlapi.version>5.1.3</owlapi.version> - <poi.version>3.16</poi.version> + <owlapi.version>5.1.5</owlapi.version> + <poi.version>3.17</poi.version> <rdf4j.version>2.3.2</rdf4j.version> <semargl.version>0.7</semargl.version> <slf4j.logger.version>1.7.25</slf4j.logger.version> - <tika.version>1.17</tika.version> + <tika.version>1.18</tika.version> <openie_2.11.version>4.2.6</openie_2.11.version> <openregex.version>1.1.1</openregex.version> @@ -374,17 +374,12 @@ <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> - <version>1.10</version> - </dependency> - <dependency> - <groupId>commons-cli</groupId> - <artifactId>commons-cli</artifactId> - <version>1.2</version> + <version>1.11</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-compress</artifactId> - <version>1.14</version> + <version>1.17</version> </dependency> <dependency> <groupId>net.sourceforge.nekohtml</groupId> @@ -420,11 +415,6 @@ </dependency> <dependency> <groupId>org.apache.poi</groupId> - <artifactId>poi-ooxml-schemas</artifactId> - <version>${poi.version}</version> - </dependency> - <dependency> - <groupId>org.apache.poi</groupId> <artifactId>poi-scratchpad</artifactId> <version>${poi.version}</version> </dependency> @@ -443,6 +433,21 @@ </dependency> <dependency> <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-languages</artifactId> + <version>${rdf4j.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-datatypes</artifactId> + <version>${rdf4j.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-binary</artifactId> + <version>${rdf4j.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-rio-turtle</artifactId> <version>${rdf4j.version}</version> </dependency> @@ -478,6 +483,16 @@ </dependency> <dependency> <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-trig</artifactId> + <version>${rdf4j.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> + <artifactId>rdf4j-rio-jsonld</artifactId> + <version>${rdf4j.version}</version> + </dependency> + <dependency> + <groupId>org.eclipse.rdf4j</groupId> <artifactId>rdf4j-repository-sail</artifactId> <version>${rdf4j.version}</version> </dependency> @@ -502,14 +517,6 @@ <version>${semargl.version}</version> </dependency> <!-- END: RDF4J --> - - <!-- BEGIN: Misc --> - <dependency> - <groupId>org.eclipse.rdf4j</groupId> - <artifactId>rdf4j-rio-jsonld</artifactId> - <version>${rdf4j.version}</version> - </dependency> - <!-- END: Misc --> <!-- BEGIN: OWLAPI --> <dependency> @@ -519,11 +526,6 @@ </dependency> <dependency> <groupId>net.sourceforge.owlapi</groupId> - <artifactId>owlapi-impl</artifactId> - <version>${owlapi.version}</version> - </dependency> - <dependency> - <groupId>net.sourceforge.owlapi</groupId> <artifactId>owlapi-rio</artifactId> <version>${owlapi.version}</version> </dependency> @@ -548,25 +550,10 @@ <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> - <version>2.4</version> + <version>2.6</version> </dependency> <!-- END: Apache Commons --> - <!-- BEGIN: Servlet Deps. --> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>servlet-api-3.0</artifactId> - <version>7.0.0pre2</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-servlet-tester</artifactId> - <version>7.0.0.pre5</version> - <scope>test</scope> - </dependency> - <!-- END: Servlet Deps. --> - <!-- BEGIN: Plugins specific dependencies --> <dependency> <groupId>de.l3s.boilerpipe</groupId> @@ -580,6 +567,7 @@ <artifactId>jcommander</artifactId> <version>1.30</version> </dependency> + <!-- BEGIN: logger --> <dependency> <groupId>org.slf4j</groupId> @@ -588,12 +576,12 @@ </dependency> <dependency> <groupId>org.slf4j</groupId> - <artifactId>slf4j-jdk14</artifactId> + <artifactId>jcl-over-slf4j</artifactId> <version>${slf4j.logger.version}</version> </dependency> <dependency> <groupId>org.slf4j</groupId> - <artifactId>jcl-over-slf4j</artifactId> + <artifactId>jul-to-slf4j</artifactId> <version>${slf4j.logger.version}</version> </dependency> <dependency> @@ -606,7 +594,7 @@ <dependency> <groupId>org.yaml</groupId> <artifactId>snakeyaml</artifactId> - <version>1.17</version> + <version>1.21</version> </dependency> <!-- BEGIN: Test Dependencies --> @@ -619,7 +607,7 @@ <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> - <version>2.8.47</version> + <version>2.19.0</version> <scope>test</scope> </dependency> <!-- END: Test Dependencies --> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/service/pom.xml ---------------------------------------------------------------------- diff --git a/service/pom.xml b/service/pom.xml index 0555bc4..fc3d8ba 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -33,7 +33,7 @@ <properties> <!-- the following property is used in the bash script as well, don't remove it! --> - <jetty.runner.version>9.4.10.RC0</jetty.runner.version> + <jetty.runner.version>9.4.11.v20180605</jetty.runner.version> <output.directory>${project.build.directory}/${project.artifactId}-${project.version}/WEB-INF/lib/apache-any23-openie</output.directory> </properties> @@ -70,43 +70,41 @@ <scope>provided</scope> </dependency> - <!-- Logging --> + <!-- BEGIN: Jetty Dependencies --> <dependency> - <groupId>org.slf4j</groupId> - <artifactId>slf4j-log4j12</artifactId> - <version>${slf4j.logger.version}</version> - <scope>test</scope> - </dependency> - - <!-- BEGIN: Servlet Deps. --> - <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>servlet-api-3.0</artifactId> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-runner</artifactId> + <version>${jetty.runner.version}</version> <scope>provided</scope> + <optional>true</optional> </dependency> + <!-- BEGIN: Test Dependencies --> <dependency> - <groupId>org.mortbay.jetty</groupId> - <artifactId>jetty-servlet-tester</artifactId> + <groupId>org.eclipse.jetty</groupId> + <artifactId>jetty-servlet</artifactId> + <version>${jetty.runner.version}</version> <scope>test</scope> + <classifier>tests</classifier> </dependency> - <!-- END: Servlet Deps. --> - - <!-- BEGIN: Jetty Deps. --> <dependency> <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-runner</artifactId> + <artifactId>jetty-http</artifactId> <version>${jetty.runner.version}</version> - <scope>provided</scope> - <optional>true</optional> + <scope>test</scope> + <classifier>tests</classifier> </dependency> - <!-- END: Jetty Deps. --> - - <!-- BEGIN: Test Dependencies --> + <!-- END: Jetty Dependencies --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>${slf4j.logger.version}</version> + <scope>test</scope> + </dependency> <!-- END: Test Dependencies --> </dependencies> http://git-wip-us.apache.org/repos/asf/any23/blob/6b76f346/service/src/test/java/org/apache/any23/servlet/ServletTest.java ---------------------------------------------------------------------- diff --git a/service/src/test/java/org/apache/any23/servlet/ServletTest.java b/service/src/test/java/org/apache/any23/servlet/ServletTest.java index 1a0128d..96dd3c5 100644 --- a/service/src/test/java/org/apache/any23/servlet/ServletTest.java +++ b/service/src/test/java/org/apache/any23/servlet/ServletTest.java @@ -29,8 +29,8 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.mortbay.jetty.testing.HttpTester; -import org.mortbay.jetty.testing.ServletTester; +import org.eclipse.jetty.http.HttpTester; +import org.eclipse.jetty.servlet.ServletTester; /** * Test case for {@link Servlet} class. @@ -64,21 +64,21 @@ public class ServletTest { @Test public void testGETOnlyFormat() throws Exception { - HttpTester response = doGetRequest("/xml"); + HttpTester.Response response = doGetRequest("/xml"); Assert.assertEquals(404, response.getStatus()); assertContains("Missing IRI", response.getContent()); } @Test public void testGETWrongFormat() throws Exception { - HttpTester response = doGetRequest("/dummy/foo.com"); + HttpTester.Response response = doGetRequest("/dummy/foo.com"); Assert.assertEquals(400, response.getStatus()); assertContains("Invalid format", response.getContent()); } @Test public void testGETInvalidIRI() throws Exception { - HttpTester response = doGetRequest("/xml/mailto:[email protected]"); + HttpTester.Response response = doGetRequest("/xml/mailto:[email protected]"); Assert.assertEquals(400, response.getStatus()); assertContains("Invalid input IRI", response.getContent()); } @@ -86,7 +86,7 @@ public class ServletTest { @Test public void testGETWorks() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt/foo.com/bar.html"); + HttpTester.Response response = doGetRequest("/nt/foo.com/bar.html"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com/bar.html", requestedIRI); String res = response.getContent(); @@ -99,7 +99,7 @@ public class ServletTest { @Test public void testGETAddsHTTPScheme() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt/foo.com"); + HttpTester.Response response = doGetRequest("/nt/foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); } @@ -107,7 +107,7 @@ public class ServletTest { @Test public void testGETIncludesQueryString() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt/http://foo.com?id=1"); + HttpTester.Response response = doGetRequest("/nt/http://foo.com?id=1"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com?id=1", requestedIRI); } @@ -115,7 +115,7 @@ public class ServletTest { @Test public void testGETwithIRIinParam() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt?uri=http://foo.com?id=1"); + HttpTester.Response response = doGetRequest("/nt?uri=http://foo.com?id=1"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com?id=1", requestedIRI); } @@ -123,7 +123,7 @@ public class ServletTest { @Test public void testGETwithFormatAndIRIinParam() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/?format=nt&uri=http://foo.com?id=1"); + HttpTester.Response response = doGetRequest("/?format=nt&uri=http://foo.com?id=1"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com?id=1", requestedIRI); } @@ -131,7 +131,7 @@ public class ServletTest { @Test public void testGETwithURLDecoding() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt/http%3A%2F%2Ffoo.com"); + HttpTester.Response response = doGetRequest("/nt/http%3A%2F%2Ffoo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); } @@ -139,14 +139,14 @@ public class ServletTest { @Test public void testGETwithURLDecodingInParam() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/nt?uri=http%3A%2F%2Ffoo.com"); + HttpTester.Response response = doGetRequest("/nt?uri=http%3A%2F%2Ffoo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); } @Test public void testPOSTNothing() throws Exception { - HttpTester response = doPostRequest("/", "", null); + HttpTester.Response response = doPostRequest("/", "", null); Assert.assertEquals(400, response.getStatus()); assertContains("Invalid POST request", response.getContent()); } @@ -154,7 +154,7 @@ public class ServletTest { @Test public void testPOSTWorks() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doPostRequest("/", "format=nt&uri=http://foo.com", "application/x-www-form-urlencoded"); + HttpTester.Response response = doPostRequest("/", "format=nt&uri=http://foo.com", "application/x-www-form-urlencoded"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); String res = response.getContent(); @@ -164,7 +164,7 @@ public class ServletTest { @Test public void testPOSTWorksWithParametersOnContentType() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doPostRequest( + HttpTester.Response response = doPostRequest( "/", "format=nt&uri=http://foo.com", "application/x-www-form-urlencoded;charset=UTF-8" @@ -181,7 +181,7 @@ public class ServletTest { @Test public void testPOSTBodyWorks() throws Exception { String body = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doPostRequest("/nt", body, "text/html"); + HttpTester.Response response = doPostRequest("/nt", body, "text/html"); Assert.assertEquals(200, response.getStatus()); String res = response.getContent(); assertContains( @@ -194,7 +194,7 @@ public class ServletTest { @Test public void testPOSTBodyInParamWorks() throws Exception { String body = URLEncoder.encode("<html><body><div class=\"vcard fn\">Joe</div></body></html>", "utf-8"); - HttpTester response = doPostRequest("/", "format=nt&body=" + body, + HttpTester.Response response = doPostRequest("/", "format=nt&body=" + body, "application/x-www-form-urlencoded"); Assert.assertEquals(200, response.getStatus()); String res = response.getContent(); @@ -208,7 +208,7 @@ public class ServletTest { @Test public void testPOSTonlyIRI() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doPostRequest("/", "uri=http://foo.com", "application/x-www-form-urlencoded"); + HttpTester.Response response = doPostRequest("/", "uri=http://foo.com", "application/x-www-form-urlencoded"); Assert.assertEquals(200, response.getStatus()); String res = response.getContent(); assertContains("a vcard:VCard", res); @@ -216,7 +216,7 @@ public class ServletTest { @Test public void testPOSTonlyFormat() throws Exception { - HttpTester response = doPostRequest("/", "format=rdf", "application/x-www-form-urlencoded"); + HttpTester.Response response = doPostRequest("/", "format=rdf", "application/x-www-form-urlencoded"); Assert.assertEquals(400, response.getStatus()); assertContains("uri", response.getContent()); } @@ -230,7 +230,7 @@ public class ServletTest { @Test public void testGETwithURLEncoding() throws Exception { content = null; - HttpTester response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller"); + HttpTester.Response response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller"); Assert.assertEquals(200, response.getStatus()); } @@ -243,7 +243,7 @@ public class ServletTest { @Test public void testGETwithURLEncodingWithQuery() throws Exception { content = null; - HttpTester response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller?appo=xxx"); + HttpTester.Response response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller?appo=xxx"); Assert.assertEquals(200, response.getStatus()); } @@ -256,14 +256,14 @@ public class ServletTest { @Test public void testGETwithURLEncodingWithFragment() throws Exception { content = null; - HttpTester response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller#abcde"); + HttpTester.Response response = doGetRequest("/best/http://semanticweb.org/wiki/Knud_M%C3%B6ller#abcde"); Assert.assertEquals(200, response.getStatus()); } @Test public void testCorrectBaseIRI() throws Exception { content = "@prefix foaf: <http://xmlns.com/foaf/0.1/> . <> a foaf:Document ."; - HttpTester response = doGetRequest("/nt/foo.com/test.n3"); + HttpTester.Response response = doGetRequest("/nt/foo.com/test.n3"); Assert.assertEquals(200, response.getStatus()); assertContains("<http://foo.com/test.n3>", response.getContent()); } @@ -271,7 +271,7 @@ public class ServletTest { @Test public void testDefaultBaseIRIinPOST() throws Exception { String body = "@prefix foaf: <http://xmlns.com/foaf/0.1/> . <> a foaf:Document ."; - HttpTester response = doPostRequest("/nt", body, "text/rdf+n3;charset=utf-8"); + HttpTester.Response response = doPostRequest("/nt", body, "text/rdf+n3;charset=utf-8"); Assert.assertEquals(200, response.getStatus()); assertContains("<" + Servlet.DEFAULT_BASE_IRI + ">", response.getContent()); } @@ -279,7 +279,7 @@ public class ServletTest { @Test public void testPOSTwithoutContentType() throws Exception { String body = "@prefix foaf: <http://xmlns.com/foaf/0.1/> . <http://example.com/asdf> a foaf:Document ."; - HttpTester response = doPostRequest("/nt", body, null); + HttpTester.Response response = doPostRequest("/nt", body, null); Assert.assertEquals(400, response.getStatus()); assertContains("Content-Type", response.getContent()); } @@ -287,14 +287,14 @@ public class ServletTest { @Test public void testPOSTwithContentTypeParam() throws Exception { String body = URLEncoder.encode("<http://foo.bar> <http://foo.bar> <http://foo.bar> .", "utf-8"); - HttpTester response = doPostRequest("/", "format=nt&body=" + body + "&type=application/x-foobar", + HttpTester.Response response = doPostRequest("/", "format=nt&body=" + body + "&type=application/x-foobar", "application/x-www-form-urlencoded"); Assert.assertEquals(415, response.getStatus()); } @Test public void testPOSTbodyMissingFormat() throws Exception { - HttpTester response = doPostRequest( + HttpTester.Response response = doPostRequest( "/", "<html><body><div class=\"vcard fn\">Joe</div></body></html>", "text/html" ); @@ -306,7 +306,7 @@ public class ServletTest { @Test public void testContentNegotiationDefaultsToTurtle() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("a vcard:VCard", response.getContent()); @@ -316,7 +316,7 @@ public class ServletTest { public void testContentNegotiationForWildcardReturnsTurtle() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "*/*"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("a vcard:VCard", response.getContent()); @@ -326,7 +326,7 @@ public class ServletTest { public void testContentNegotiationForUnacceptableFormatReturns406() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "image/jpeg"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(406, response.getStatus()); Assert.assertNull(requestedIRI); } @@ -335,7 +335,7 @@ public class ServletTest { public void testContentNegotiationForTurtle() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "text/turtle"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("a vcard:VCard", response.getContent()); @@ -345,7 +345,7 @@ public class ServletTest { public void testContentNegotiationForTurtleAlias() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "application/x-turtle"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("a vcard:VCard", response.getContent()); @@ -355,7 +355,7 @@ public class ServletTest { public void testContentNegotiationForRDFXML() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "application/rdf+xml"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("<rdf1:RDF", response.getContent()); @@ -365,7 +365,7 @@ public class ServletTest { public void testContentNegotiationForNTriples() throws Exception { content = "<html><body><div class=\"vcard fn\">Joe</div></body></html>"; acceptHeader = "text/plain"; - HttpTester response = doGetRequest("/best/http://foo.com"); + HttpTester.Response response = doGetRequest("/best/http://foo.com"); Assert.assertEquals(200, response.getStatus()); Assert.assertEquals("http://foo.com", requestedIRI); assertContains("<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>", response.getContent()); @@ -377,7 +377,7 @@ public class ServletTest { new File("src/test/resources/org/apache/any23/servlet/missing-og-namespace.html") ).readStream(); acceptHeader = "text/plain"; - HttpTester response = doGetRequest("/best/http://foo.com?validation-mode=validate-fix&report=on"); + HttpTester.Response response = doGetRequest("/best/http://foo.com?validation-mode=validate-fix&report=on"); Assert.assertEquals(200, response.getStatus()); final String content = response.getContent(); assertContainsTag("response", content); @@ -396,7 +396,7 @@ public class ServletTest { @Test public void testJSONResponseFormat() throws Exception { String body = "<http://sub/1> <http://pred/1> \"123\"^^<http://datatype> <http://graph/1>."; - HttpTester response = doPostRequest("/json", body, "application/n-quads"); + HttpTester.Response response = doPostRequest("/json", body, "application/n-quads"); Assert.assertEquals(200, response.getStatus()); final String EXPECTED_JSON = "[ {\n" @@ -414,7 +414,7 @@ public class ServletTest { @Test public void testJSONLDResponseFormat() throws Exception { String body = "<http://sub/1> <http://pred/1> \"123\"^^<http://datatype> <http://graph/1>."; - HttpTester response = doPostRequest("/jsonld", body, "application/n-quads"); + HttpTester.Response response = doPostRequest("/jsonld", body, "application/n-quads"); Assert.assertEquals(200, response.getStatus()); final String EXPECTED_JSON = "[ {\n" + @@ -433,7 +433,7 @@ public class ServletTest { @Test public void testTriXResponseFormat() throws Exception { String body = "<http://sub/1> <http://pred/1> \"123\"^^<http://datatype> <http://graph/1>."; - HttpTester response = doPostRequest("/trix", body, "application/n-quads"); + HttpTester.Response response = doPostRequest("/trix", body, "application/n-quads"); Assert.assertEquals(200, response.getStatus()); final String content = response.getContent(); assertContainsTag("graph", false, 1, content); @@ -441,13 +441,12 @@ public class ServletTest { assertContainsTag("triple", false, 1, content); } - private HttpTester doGetRequest(String path) throws Exception { + private HttpTester.Response doGetRequest(String path) throws Exception { return doRequest(path, "GET"); } - private HttpTester doPostRequest(String path, String content, String contentType) throws Exception { - HttpTester response = new HttpTester(); - HttpTester request = new HttpTester(); + private HttpTester.Response doPostRequest(String path, String content, String contentType) throws Exception { + HttpTester.Request request = HttpTester.newRequest(); request.setMethod("POST"); request.setVersion("HTTP/1.0"); @@ -457,13 +456,11 @@ public class ServletTest { request.setHeader("Content-Type", contentType); } request.setURI(path); - response.parse(tester.getResponses(request.generate())); - return response; + return HttpTester.parseResponse(tester.getResponses(request.generate())); } - private HttpTester doRequest(String path, String method) throws Exception { - HttpTester request = new HttpTester(); - HttpTester response = new HttpTester(); + private HttpTester.Response doRequest(String path, String method) throws Exception { + HttpTester.Request request = HttpTester.newRequest(); request.setMethod(method); request.setVersion("HTTP/1.0"); @@ -473,8 +470,7 @@ public class ServletTest { } request.setURI(path); - response.parse(tester.getResponses(request.generate())); - return response; + return HttpTester.parseResponse(tester.getResponses(request.generate())); } private void assertContains(String expected, String container) {
