0

I want to use the Factual Jar file for Geo Location services however I have imported the Jar file to the project but the documentation states that the pom.xml tells you what dependencies you'll need to plug into your project to get the driver to work.

My question is what dependencies do I need to import and where at in the project. I am using Netbeans to build my Java projects.

pom.xml file: http://repo1.maven.org/maven2/com/factual/factual-java-driver/1.5.0/factual-java-driver-1.5.0.pom

<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>com.factual</groupId>
<artifactId>factual-java-driver</artifactId>
<version>1.5.0</version>
<packaging>jar</packaging>
<name>factual-java-driver</name>
<description>Factual's officially supported Java driver</description>
<url>http://github.com/Factual/factual-java-driver</url>
<scm>
<connection>
scm:git:git@github.com:Factual/factual-java-driver.git
</connection>
<developerConnection>
scm:git:git@github.com:Factual/factual-java-driver.git
</developerConnection>
<url>git@github.com:Factual/factual-java-driver.git</url>
<!--
url>https://github.com/Factual/factual-java-driver/tree/master</url> <connection>scm:git:git://github.com/Factual/factual-java-driver.git</connection
-->
</scm>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>
http://github.com/Factual/factual-java-driver/blob/master/LICENSE.txt
</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>aaron</id>
<name>Aaron Crow</name>
<email>aaron@factual.com</email>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>r09</version>
</dependency>
<dependency>
<groupId>com.google.api-client</groupId>
<artifactId>google-api-client</artifactId>
<version>1.7.0-beta</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-lgpl</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20090211</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<scope>test</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<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>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<configuration>
<pushChanges>false</pushChanges>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>jar-with-dependencies.xml</descriptor>
</descriptors>
<finalName>factual-java-driver</finalName>
<outputDirectory>target</outputDirectory>
<workDirectory>target/assembly/work</workDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8</version>
</plugin>
</plugins>
</build>
<!--
distributionManagement> <repository> <id>sonatype-nexus-staging</id> <name>Sonatype Staging</name> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> </repository> </distributionManagement
-->
</project>
Brandon Wilson
  • 4,462
  • 7
  • 60
  • 90

1 Answers1

1

You can manually download the dependencies from http://mvnrepository.com/. Pom.xml shows the name of the dependencies in detail:

<dependencies>
  <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>r09</version>
  </dependency>
  ...
<dependencies> 

Just check the artifactId's to see what to search for. Go ahead and download them by searching:

  • guava
  • google-api-client
  • jackson-core-asl
  • jackson-core-lgpl
  • jackson-mapper-asl
  • commons-io
  • json
  • junit

(be careful to download correct version of each dependency)
At the end, you need to import these 8 jar files to your project, and then it should work.

Community
  • 1
  • 1
yigit
  • 116
  • 3
  • I was able to search for Factual on the mvnrepository.com and it come up with all the dependencies for the Factual Jar. – Brandon Wilson Jul 26 '12 at 22:55
  • Would you know why I would be getting this error: `Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/google/api/client/http/HttpResponseException` – Brandon Wilson Jul 27 '12 at 01:21
  • Seems there's a version mismatch between your Factual vs google-api-client. Factual is using a class (HttpResponseException) which doesn't exists in the current google-api-client.jar you've added. Pom.xml above mentions that you need version '1.7.0-beta' of google-api-client; can you re-check your current pom.xml to see if the imported version of google-api-client matches? Searching for a correct dependency version sucks, but hope you'll figure it out :) – yigit Jul 27 '12 at 22:59