0

I'm creating a twitter application using eclipse, and I can't find TwitterTemplate inside the maven dependency. Here is my pom file.

<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>ddd</groupId>
  <artifactId>assignment7</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>assignment7</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
<repositories>
<repository>
    <id>springsource-repo</id>
    <name>SpringSource Repository</name>
    <url>http://repo.springsource.org/release</url>
    </repository>
</repositories>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
 <groupId>org.springframework</groupId>
 <artifactId>spring-context</artifactId>
 <version>3.1.1.RELEASE</version>
</dependency> 
<dependency>
 <groupId>org.springframework.social</groupId>
 <artifactId>spring-social-core</artifactId>
 <version>1.0.1.RELEASE</version>
</dependency> 
  </dependencies>
</project>

So far, this is what I wrote on my eclipse

package ddd.assignment7;
public class App {
    public static void main( String[] args )
    {   
        String consumerKey = "xxx"; // The application's consumer key
        String consumerSecret = "xxx"; // The application's consumer secret
        String accessToken = "xxx"; // The access token granted after OAuth authorization
        String accessTokenSecret = "xxx"; // The access token secret granted after OAuth authorization
        Twitter twitter = new TwitterTemplate(consumerKey, consumerSecret, accessToken, accessTokenSecret);


}
}

what I need is TwitterTemplate class, but can't find it inside the maven dependency. what should I do? I'm very new to java and I'm really confused what I'm suppose to do.

Slava Semushin
  • 14,904
  • 7
  • 53
  • 69

1 Answers1

0

TwitterTemplate packaged into separate artifact spring-social-twitter, so to make it available add following to your pom.xml:

<dependency>
    <groupId>org.springframework.social</groupId>
    <artifactId>spring-social-twitter</artifactId>
    <version>1.0.1.RELEASE</version>
</dependency>

(BTW, 1.0.2.RELEASE available)

Slava Semushin
  • 14,904
  • 7
  • 53
  • 69