i am getting error while using skype gradle depend

2020-05-01 09:06发布

问题:

I am developing a project in Liferay portlet where I have to use skype Gradle dependencies to send a message on skype group.

I put the dependencies

(compile group: 'com.github.taksan', name: 'skype-java-API', version: '1.7')

in build.gradle and deployed. It's working fine.

But whenever I import or use the skype package, I am getting an error like

Unresolved requirement: Import-Package: com.skype_ [Sanitized]

how to resolve this problem and if possible could you give me a code or suggestion? How to send the notification message to the skype group using Liferay java code?

回答1:

gradle dependencies apply at build time. They don't make the code available at runtime magically.

Ideally, you'd figure out that the skype API code is packaged as OSGi bundle (I'm on low bandwidth currently, can't check) and deploy it to the OSGi runtime (Liferay) as well to make it available. Potentially you might need to make its transitive dependencies available as well.

Less ideally, you'll find a version of the API jar that someone has repackaged as OSGi bundle. Or you do this yourself (and send a pullrequest to the original maintainer)

And even less ideally, you'll include the API jar within your own code. Within Liferay workspace, you can do this with the compileInclude directive in your gradle dependency declaration. See the drawbacks and consequences here (free registration to the free course required)