Google Client API in OSGI

非 Y 不嫁゛ 提交于 2019-11-28 14:18:09

So I finally have it working. I've posted the code in case it helps others, or perhaps to find better ways to do it.

The dependencies...

<!-- Embedded Google Client API JAR's -->
<dependency>
 <groupId>com.google.api-client</groupId>
 <artifactId>google-api-client</artifactId>
 <version>1.20.0</version>
</dependency>
<dependency>
  <groupId>com.google.http-client</groupId>
  <artifactId>google-http-client</artifactId>
  <version>1.20.0</version>
</dependency>
<dependency>
  <groupId>com.google.api-client</groupId>
  <artifactId>google-api-client-java6</artifactId>
  <version>1.20.0</version>
</dependency>
<dependency>
    <groupId>com.google.http-client</groupId>
    <artifactId>google-http-client-jackson2</artifactId>
    <version>1.20.0</version>
</dependency>
<dependency>
    <groupId>com.google.http-client</groupId>
    <artifactId>google-http-client-gson</artifactId>
    <version>1.20.0</version>
</dependency>
<dependency>
  <groupId>com.google.oauth-client</groupId>
  <artifactId>google-oauth-client</artifactId>
  <version>1.20.0</version>
</dependency>
<dependency>
  <groupId>com.google.oauth-client</groupId>
  <artifactId>google-oauth-client-java6</artifactId>
  <version>1.20.0</version>
</dependency>
<dependency>
    <groupId>org.apache.servicemix.bundles</groupId>
    <artifactId>org.apache.servicemix.bundles.avalon-framework</artifactId>
    <version>4.3.1_1</version>
</dependency>
<dependency>
    <groupId>commons-logging</groupId>
    <artifactId>commons-logging</artifactId>
    <version>1.1</version>
</dependency>
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.jms</artifactId>
    <version>3.2-b06</version>
</dependency>

the maven-bundle-plugin settings

    <plugin>
      <groupId>org.apache.felix</groupId>
      <artifactId>maven-bundle-plugin</artifactId>
      <extensions>true</extensions>
      <configuration>
          <instructions>
              <Bundle-Activator>com.r2i.michigan.lsa.services.osgi.Activator</Bundle-Activator>
              <Embed-Dependency>                             
                  *;scope=compile|runtime,
              </Embed-Dependency>
                <Embed-Transitive>true</Embed-Transitive> 
                <Import-Package>
                  sun.misc;resolution:=optional,
                  com.sun.jdmk.comm;resolution:=optional,*
                </Import-Package>                       
              <Sling-Test-Regexp>.*Test</Sling-Test-Regexp>
          </instructions>
      </configuration>
    </plugin>   
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!