Google Client API in OSGI

前端 未结 1 1952
既然无缘
既然无缘 2020-12-19 21:56

I\'m having trouble providing the dependencies needed for OAuth Client Library for Java within an OSGI application framework (AEM).

https://developers.google.com/api

相关标签:
1条回答
  • 2020-12-19 22:26

    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>   
    
    0 讨论(0)
提交回复
热议问题