Adobe-Consulting-Services / com.adobe.acs.bundles.retrofit

Apache License 2.0
2 stars 4 forks source link

Retrofit-dependency package com.squareup.okhttp is not being exported #1

Open jreece1567 opened 10 years ago

jreece1567 commented 10 years ago

Looking at the way that the Retrofit-bundle is set up, I see this in the bundle-POM …

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Export-Package>
                        !retrofit.android,
                        !retrofit.appengine,
                        com.squareup.okhttp.*;version=${okhttp.version},
                        retrofit.*;version=${retrofit.version},
                        com.adobe.acs.bundles.retrofit
                    </Export-Package>
                    <Import-Package>
                        !android.*,
                        !com.google.appengine.*,
                        !org.apache.http*,
                        rx*;resolution:=optional,
                        *
                    </Import-Package>
                    <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency>
                    <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
                </instructions>
            </configuration>
        </plugin>

Note that this exports the com.squareup.okhttp package.

However, when I build with an explicit dependency on a class in that package (com.squareup.okhttp), then deploy to AEM, the AEM-bundles-console shows this error (com.squareup.okhttp -- Cannot be resolved):

Imported Packages    com.google.common.collect,version=[15.0,16) from com.google.guava (78)
com.google.gson,version=[2.2,3) from com.google.gson (391)
com.google.gson.annotations,version=[2.2,3) from com.google.gson (391)
com.squareup.okhttp -- Cannot be resolved
javax.xml.parsers from org.apache.felix.framework (0)
org.scribe.builder from com.adobe.granite.scribe (155)
org.scribe.builder.api from com.adobe.granite.scribe (155)
org.scribe.model from com.adobe.granite.scribe (155)
org.scribe.oauth from com.adobe.granite.scribe (155)
org.slf4j,version=[1.6,2) from slf4j.api (14)
org.w3c.dom from org.apache.felix.framework (0)
org.xml.sax from org.apache.felix.framework (0)
retrofit,version=1.6.1 from com.adobe.acs.bundles.retrofit-bundle (394)
retrofit.client,version=1.6.1 from com.adobe.acs.bundles.retrofit-bundle (394)
retrofit.converter,version=1.6.1 from com.adobe.acs.bundles.retrofit-bundle (394)
retrofit.http,version=1.6.1 from com.adobe.acs.bundles.retrofit-bundle (394)
retrofit.mime,version=1.6.1 from com.adobe.acs.bundles.retrofit-bundle (394)
justinedelson commented 9 years ago

This bundle does not export anything related to com.squareup.okhttp. See https://github.com/Adobe-Consulting-Services/com.adobe.acs.bundles.retrofit/blob/master/bundle/pom.xml#L73

As far as I know, OKHttp is just an implementation detail of Retrofit. It isn't part of the API, thus is doesn't need to be exported.