Hacker News new | ask | show | jobs
by manishsharan 4859 days ago
I want to give you an idea of how bad things are with REST Api Client . This is a Maven POM for Google APIs for java web project that uses Google APIs for Profile, Drive and Oauth2. Its insane:

  <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>
  <parent>
    <groupId>com.google</groupId>
    <artifactId>google</artifactId>
    <version>5</version>
  </parent>
  <groupId>com.google.api.client</groupId>
  <artifactId>google-plus-java-webapp-starter</artifactId>
  <packaging>war</packaging>
  <version>1.0.0</version>
  <name>google-plus-java-webapp-starter</name>
  <description>
    Web application example for the Google+ platform using JSON and OAuth 2
  </description>

  <url>https://code.google.com/p/google-plus-java-starter</url>

  <issueManagement>
    <system>code.google.com</system>
    <url>https://code.google.com/p/google-plus-java-starter/issues</url>
  </issueManagement>

  <inceptionYear>2011</inceptionYear>

  <prerequisites>
    <maven>2.0.9</maven>
  </prerequisites>

  <scm>
    <connection>
      scm:hg:https://hg.codespot.com/p/google-plus-java-starter/
    </connection>
    <developerConnection>
      scm:hg:https://hg.codespot.com/p/google-plus-java-starter/
    </developerConnection>
    <url>
      https://code.google.com/p/google-plus-java-starter/source/browse/
    </url>
  </scm>

  <developers>
    <developer>
      <id>jennymurphy</id>
      <name>Jennifer Murphy</name>
      <organization>Google</organization>
      <organizationUrl>http://www.google.com</organizationUrl>
      <roles>
        <role>owner</role>
        <role>developer</role>
      </roles>
      <timezone>-8</timezone>
    </developer>
  </developers>

  <repositories>
    <!--
        The repository for service specific Google client libraries. See
        http://code.google.com/p/google-api-java-client/wiki/APIs#Maven_support
        for more information
    -->
    <repository>
      <id>google-api-services</id>
      <url>http://mavenrepo.google-api-java-client.googlecode.com/hg</url>
    </repository>
    <repository>
      <id>google-api-services-drive</id>
      <url>http://google-api-client-libraries.appspot.com/mavenrepo</url>
    </repository>    
  </repositories>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.3.2</version>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <configuration>
          <contextPath>/</contextPath>
          <systemProperties>
            <systemProperty>
              <name>configurationPath</name>
              <value>./src/main/resources/config.properties</value>
            </systemProperty>
          </systemProperties>
        </configuration>
      </plugin>
    </plugins>
    <finalName>${project.artifactId}-${project.version}</finalName>
  </build>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server>
    <project.http.version>1.13.1-beta</project.http.version>
    <project.oauth.version>1.13.1-beta</project.oauth.version>    
    <webapi.version>6.0</webapi.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>13.0.1</version>
    </dependency>

 <dependency>
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-drive</artifactId>
      <version>v2-rev53-1.13.2-beta</version>
    </dependency>
  <dependency>
      <!-- A generated library for Google+ APIs. Visit here for more info:
          http://code.google.com/p/google-api-java-client/wiki/APIs#Google+_API
      -->
      <groupId>com.google.apis</groupId>
      <artifactId>google-api-services-plus</artifactId>
      <version>v1-rev22-1.8.0-beta</version>
    </dependency>  


   <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client</artifactId>
      <version>1.13.2-beta</version>
    </dependency>

  <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client-servlet</artifactId>
      <version>1.13.1-beta</version>
    </dependency>   

    <dependency>


      <!-- The Google OAuth Java client. Visit here for more  info:
          http://code.google.com/p/google-oauth-java-client/
      -->

      <groupId>com.google.oauth-client</groupId>
      <artifactId>google-oauth-client</artifactId>
      <version>1.13.1-beta</version>
    </dependency>    

    <dependency>
    	<groupId>com.google.oauth-client</groupId>
    	<artifactId>google-oauth-client-servlet</artifactId>
    	<version>1.13.1-beta</version>
    </dependency>


    <dependency>
    	<groupId>com.google.http-client</groupId>
    	<artifactId>google-http-client-gson</artifactId>
    	<version>1.13.1-beta</version>
    </dependency>

    <dependency>
    	<groupId>com.google.code.gson</groupId>
    	<artifactId>gson</artifactId>
    	<version>2.1</version>
    </dependency>

  <dependency>
     <groupId>com.google.http-client</groupId>
     <artifactId>google-http-client</artifactId>
     <version>1.13.1-beta</version>
   </dependency>

  <!-- Third party dependencies -->
    <dependency>
      <groupId>com.google.http-client</groupId>
      <artifactId>google-http-client-jackson2</artifactId>
      <version>1.13.1-beta</version>
    </dependency>

  <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>${webapi.version}</version>
        <scope>provided</scope>
    </dependency>    
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.0.1</version>
    </dependency>

  <dependency>
	<groupId>commons-logging</groupId>
	<artifactId>commons-logging</artifactId>
	<version>1.1.1</version>
  </dependency>

 <dependency>
	<groupId>org.apache.httpcomponents</groupId>
	<artifactId>httpclient</artifactId>
	<version>4.0.3</version>
  </dependency>

  <dependency>
	<groupId>org.apache.httpcomponents</groupId>
	<artifactId>httpcore</artifactId>
	<version>4.0.1</version>
  </dependency>


  <dependency>
	<groupId>org.codehaus.jackson</groupId>
	<artifactId>jackson-core-asl</artifactId>
	<version>1.9.4</version>
  </dependency>

  <dependency>
	<groupId>javax.jdo</groupId>
	<artifactId>jdo2-api</artifactId>
	<version>2.3-eb</version>
  </dependency>

  <dependency>
	<groupId>com.google.code.findbugs</groupId>
	<artifactId>jsr305</artifactId>
	<version>1.3.9</version>
  </dependency>

  <dependency>
	<groupId>com.google.protobuf</groupId>
	<artifactId>protobuf-java</artifactId>
	<version>2.2.0</version>
  </dependency>

  <dependency>
	<groupId>javax.transaction</groupId>
	<artifactId>jta</artifactId>
	<version>1.1</version>
  </dependency>

  <dependency>
	<groupId>xpp3</groupId>
	<artifactId>xpp3</artifactId>
	<version>1.1.4c</version>
  </dependency>

  </dependencies>

  </project>
3 comments

Can you stick that in a gist[1] so as to not mess up the HN comments?

[1] https://gist.github.com/

I realize now that cut-paste from my code into comment was a bad idea ; I wish I could edit this post -- but i am unable to do ( no edit link). Lesson learnt for next time.
What would you remove? How could it be simpler? I don't mean how could it be less verbose, but how could you describe those various project attributes in a way that wouldn't lead you to another markup language with the same data?
I am getting rid of all Google api jars. Google has a well documented REST API for OAuth 2.0 and drive ; I am refactoring my code to only use standard commons http client jars along with java JSON (e.g. jackson )jars and invoke standard REST api.
Is there a public repo where I could follow your progress? My interest is piqued.
Yes, see the github repo here: https://github.com/ttezel/unio
Thats a great idea. I haven't set up my github profile yet -- this may very well be the project to start with.
Argh, if this is what REST looks like, we should just go back to SOAP.