RE: Google Api auth libraries problem

Raffaele Guasco, modified 6 Years ago. New Member Posts: 22 Join Date: 9/20/18 Recent Posts
Hi to all,

I'm developing a home page that tries to access the portal using the Google authorization.
Unfortunately, I'm having a problem with the libraries. 
in the specific (in gradle)
these are 
    // https://mvnrepository.com/artifact/com.google.apis/google-api-services-oauth2
   compileOnly group: 'com.google.apis', name: 'google-api-services-oauth2', version: 'v2-rev131-1.23.0'

// https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty
   compileOnly group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.25.0'
The problem is that I can't deploy(probably they are not compliant with osgi module).
Does someone know how can I solve this problem?
Are there any alternative libraries?
The Liferay version is 7.0

Many thanks.
thumbnail
Tomas Polesovsky, modified 6 Years ago. Liferay Master Posts: 677 Join Date: 2/13/09 Recent Posts
Hi,

by saying "compileOnly" you make the dependencies compile only. It means you expect them to be present in the runtime, provided by someone else.

I think portal doesn't provide those libraries OOTB. Try to use "compileInclude" to package the libraries into your project.

​​​​​​​-- tom +
Raffaele Guasco, modified 6 Years ago. New Member Posts: 22 Join Date: 9/20/18 Recent Posts
Hi Tomas,

many thanks for your suggestion.

Unfortunately, it doesn't work.
I'm really thinking that the problem could be any conflict with all the libraries that I 'm using.



dependencies {
   compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
   compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
   compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
   compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
   compileOnly group: "jstl", name: "jstl", version: "1.2"
   compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
   compileOnly group: 'org.apache.servicemix.bundles', name: 'org.apache.servicemix.bundles.javax.mail', version: '1.4.1_5'


   // https://mvnrepository.com/artifact/com.google.apis/google-api-services-oauth2
   compileInclude group: 'com.google.apis', name: 'google-api-services-oauth2', version: 'v2-rev131-1.23.0'

   // https://mvnrepository.com/artifact/com.google.oauth-client/google-oauth-client-jetty
   compileInclude group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.25.0'

}
Asier Hernández, modified 6 Years ago. New Member Posts: 24 Join Date: 2/1/11 Recent Posts

Hi there, 

 

I am also having problems with this library inside my portlet:

 

compileInclude group: 'com.google.oauth-client', name: 'google-oauth-client-jetty', version: '1.24.1'

 

Could you solve this conflict with Liferay?

 

Thanks in advance!