title: How to Run After Build Success in maven Project in Eclipse luna
body: <p>How to Run Maven  You Tube API sample code.i got this Message in eclipse console what is next Step to run Maven  </p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] 
  [INFO] Using the builder  [INFO] Scanning for projects...
  [INFO] 
  [INFO] Using the builder   org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a   thread count of 1
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building youtube-api-cmdline-samples 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] &gt;&gt;&gt; maven-eclipse-plugin:2.9:eclipse (default-cli) @ samples &gt;&gt;&gt;
  [INFO] 
  [INFO] &lt;&lt;&lt; maven-eclipse-plugin:2.9:eclipse (default-cli) @ samples &lt;&lt;&lt;
  [INFO] 
  [INFO] --- maven-eclipse-plugin:2.9:eclipse (default-cli) @ samples ---
  [INFO] Not running eclipse plugin goal for pom project
  [INFO] Using Eclipse Workspace: null
  [INFO] Adding default classpath container: org.eclipse.jdt.launching.JRE_CONTAINER
  [INFO] ------------------------------------------------------------------------   
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 5.672 s
  [INFO] Finished at: 2014-12-12T10:53:45+05:30
  [INFO] Final Memory: 7M/17M
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>my pom.xml</p>
  
  <pre><code>&lt;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"&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.google.api.services.samples.youtube.cmdline&lt;/groupId&gt;
  &lt;artifactId&gt;samples&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
  &lt;name&gt;youtube-api-cmdline-samples&lt;/name&gt;
  &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
  &lt;properties&gt;
      &lt;project.youtube.version&gt;v3-rev107-1.18.0-rc&lt;/project.youtube.version&gt;
      &lt;project.youtube.analytics.version&gt;v1-rev24-1.17.0-rc&lt;/project.youtube.analytics.version&gt;
      &lt;project.http.version&gt;1.18.0-rc&lt;/project.http.version&gt;
      &lt;project.oauth.version&gt;1.18.0-rc&lt;/project.oauth.version&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
  &lt;/properties&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;google-api-services&lt;/id&gt;
          &lt;url&gt;http://google-api-client-libraries.appspot.com/mavenrepo&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  
  &lt;dependencies&gt;
  
      &lt;!-- YouTube Data V3 support --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
          &lt;artifactId&gt;google-api-services-youtube&lt;/artifactId&gt;
          &lt;version&gt;${project.youtube.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- Required for any code that makes calls to the Google Analytics API --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.apis&lt;/groupId&gt;
          &lt;artifactId&gt;google-api-services-youtubeAnalytics&lt;/artifactId&gt;
          &lt;version&gt;${project.youtube.analytics.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;!-- This dependency is only used for the Topics API sample, which requires the Jackson JSON parser --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
          &lt;version&gt;1.9.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.http-client&lt;/groupId&gt;
          &lt;artifactId&gt;google-http-client-jackson2&lt;/artifactId&gt;
          &lt;version&gt;${project.http.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.oauth-client&lt;/groupId&gt;
          &lt;artifactId&gt;google-oauth-client-jetty&lt;/artifactId&gt;
          &lt;version&gt;${project.oauth.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;com.google.collections&lt;/groupId&gt;
          &lt;artifactId&gt;google-collections&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
      &lt;/dependency&gt;
  
  &lt;/dependencies&gt;
  
  &lt;build&gt;
  
      &lt;plugins&gt;
          &lt;!-- Forces Maven to use Java 1.6 --&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.3.2&lt;/version&gt;
  
              &lt;configuration&gt;
                  &lt;source&gt;1.7&lt;/source&gt;
                  &lt;target&gt;1.7&lt;/target&gt;
                  &lt;packageing&gt;pom&lt;/packageing&gt;
  
                  &lt;compilerArgument&gt;&lt;/compilerArgument&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>This is my java code </p>
  
  <pre><code>/**
   * This example uses the YouTube Data and YouTube Analytics APIs to retrieve
   * YouTube Analytics data. It also uses OAuth 2.0 for authorization.
   *
   * @author Christoph Schwab-Ganser and Jeremy Walker
   */
  
  package com.google.api.services.samples.youtube.cmdline.analytics;
  
  import com.google.api.client.auth.oauth2.Credential;
  import com.google.api.client.http.HttpTransport;
  import com.google.api.client.http.javanet.NetHttpTransport;
  import com.google.api.client.json.JsonFactory;
  import com.google.api.client.json.jackson2.JacksonFactory;
  import com.google.api.services.samples.youtube.cmdline.Auth;
  import com.google.api.services.youtube.YouTube;
  import com.google.api.services.youtube.model.Channel;
  import com.google.api.services.youtube.model.ChannelListResponse;
  import com.google.api.services.youtubeAnalytics.YouTubeAnalytics;
  import com.google.api.services.youtubeAnalytics.model.ResultTable;
  import com.google.api.services.youtubeAnalytics.model.ResultTable.ColumnHeaders;
  import com.google.common.collect.Lists;
  import java.io.IOException;
  import java.io.PrintStream;
  import java.math.BigDecimal;
  import java.util.List;
  
  
   public class YouTubeAnalyticsReports {
  
  /**
   * Define a global instance of the HTTP transport.
   */
  private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();
  
  /**
   * Define a global instance of the JSON factory.
   */
  private static final JsonFactory JSON_FACTORY = new JacksonFactory();
  
  /**
   * Define a global instance of a Youtube object, which will be used
   * to make YouTube Data API requests.
   */
  private static YouTube youtube;
  
  /**
   * Define a global instance of a YoutubeAnalytics object, which will be
   * used to make YouTube Analytics API requests.
   */
  private static YouTubeAnalytics analytics;
  
  /**
   * This code authorizes the user, uses the YouTube Data API to retrieve
   * information about the user's YouTube channel, and then fetches and
   * prints statistics for the user's channel using the YouTube Analytics API.
   *
   * @param args command line args (not used).
   */
  public static void main(String[] args) {
  
      // These scopes are required to access information about the
      // authenticated user's YouTube channel as well as Analytics
      // data for that channel.
      List&lt;String&gt; scopes = Lists.newArrayList(
              "https://www.googleapis.com/auth/yt-analytics.readonly",
              "https://www.googleapis.com/auth/youtube.readonly"
  
  
      );
     /* System.out.println("scopes "+
              scopes.toString());*/
      try {
          // Authorize the request.
          Credential credential = Auth.authorize(scopes, "analyticsreports");
  
          // This object is used to make YouTube Data API requests.
          youtube = new YouTube.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
                  .setApplicationName("youtube-analytics-api-report-example")
                  .build();
  
          // This object is used to make YouTube Analytics API requests.
          analytics = new YouTubeAnalytics.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential)
                  .setApplicationName("youtube-analytics-api-report-example")
                  .build();
  
          // Construct a request to retrieve the current user's channel ID.
          YouTube.Channels.List channelRequest = youtube.channels().list("id,snippet");
          channelRequest.setMine(true);
          channelRequest.setFields("items(id,snippet/title)");
          ChannelListResponse channels = channelRequest.execute();
  
          // List channels associated with the user.
          List&lt;Channel&gt; listOfChannels = channels.getItems();
  
          // The user's default channel is the first item in the list.
          Channel defaultChannel = listOfChannels.get(0);
          String channelId = defaultChannel.getId();
  
          PrintStream writer = System.out;
          if (channelId == null) {
              writer.println("No channel found.");
          } else {
              writer.println("Default Channel: " + defaultChannel.getSnippet().getTitle() +
                      " ( " + channelId + " )\n");
  
              printData(writer, "Views Over Time.", executeViewsOverTimeQuery(analytics, channelId));
              printData(writer, "Top Videos", executeTopVideosQuery(analytics, channelId));
              printData(writer, "Demographics", executeDemographicsQuery(analytics, channelId));
          }
      } catch (IOException e) {
          System.err.println("IOException: " + e.getMessage());
          e.printStackTrace();
      } catch (Throwable t) {
          System.err.println("Throwable: " + t.getMessage());
          t.printStackTrace();
      }
  }
  
  /**
   * Retrieve the views and unique viewers per day for the channel.
   *
   * @param analytics The service object used to access the Analytics API.
   * @param id        The channel ID from which to retrieve data.
   * @return The API response.
   * @throws IOException if an API error occurred.
   */
  private static ResultTable executeViewsOverTimeQuery(YouTubeAnalytics analytics,
                                                       String id) throws IOException {
  
      return analytics.reports()
              .query("channel==" + id,     // channel id
                      "2012-01-01",         // Start date.
                      "2012-01-14",         // End date.
                      "views,uniques")      // Metrics.
              .setDimensions("day")
              .setSort("day")
              .execute();
  }
  
  /**
   * Retrieve the channel's 10 most viewed videos in descending order.
   *
   * @param analytics the analytics service object used to access the API.
   * @param id        the string id from which to retrieve data.
   * @return the response from the API.
   * @throws IOException if an API error occurred.
   */
  private static ResultTable executeTopVideosQuery(YouTubeAnalytics analytics,
                                                   String id) throws IOException {
  
      return analytics.reports()
              .query("channel==" + id,                          // channel id
                      "2012-01-01",                              // Start date.
                      "2012-08-14",                              // End date.
                      "views,subscribersGained,subscribersLost") // Metrics.
              .setDimensions("video")
              .setSort("-views")
              .setMaxResults(10)
              .execute();
  }
  
  /**
   * Retrieve the demographics report for the channel.
   *
   * @param analytics the analytics service object used to access the API.
   * @param id        the string id from which to retrieve data.
   * @return the response from the API.
   * @throws IOException if an API error occurred.
   */
  private static ResultTable executeDemographicsQuery(YouTubeAnalytics analytics,
                                                      String id) throws IOException {
      return analytics.reports()
              .query("channel==" + id,     // channel id
                      "2007-01-01",         // Start date.
                      "2012-08-14",         // End date.
                      "viewerPercentage")   // Metrics.
              .setDimensions("ageGroup,gender")
              .setSort("-viewerPercentage")
              .execute();
  }
  
  /**
   * Prints the API response. The channel name is printed along with
   * each column name and all the data in the rows.
   *
   * @param writer  stream to output to
   * @param title   title of the report
   * @param results data returned from the API.
   */
  private static void printData(PrintStream writer, String title, ResultTable results) {
      writer.println("Report: " + title);
      if (results.getRows() == null || results.getRows().isEmpty()) {
          writer.println("No results Found.");
      } else {
  
          // Print column headers.
          for (ColumnHeaders header : results.getColumnHeaders()) {
              writer.printf("%30s", header.getName());
          }
          writer.println();
  
          // Print actual data.
          for (List&lt;Object&gt; row : results.getRows()) {
              for (int colNum = 0; colNum &lt; results.getColumnHeaders().size(); colNum++) {
                  ColumnHeaders header = results.getColumnHeaders().get(colNum);
                  Object column = row.get(colNum);
                  if ("INTEGER".equals(header.getUnknownKeys().get("dataType"))) {
                      long l = ((BigDecimal) column).longValue();
                      writer.printf("%30d", l);
                  } else if ("FLOAT".equals(header.getUnknownKeys().get("dataType"))) {
                      writer.printf("%30f", column);
                  } else if ("STRING".equals(header.getUnknownKeys().get("dataType"))) {
                      writer.printf("%30s", column);
                  } else {
                      // default output.
                      writer.printf("%30s", column);
                  }
              }
              writer.println();
          }
          writer.println();
      }
  }
  
  }
  </code></pre>