dnebing / vitamins

Repo for a custom vitamins headless api.
10 stars 11 forks source link

Does not compile #1

Closed mir333 closed 4 years ago

mir333 commented 4 years ago

The project is failing on Gradle build. Seems there is some dependencies mix-up.

dnebing commented 4 years ago

Can you provide some more details?

I'm aware of a current issue where an updated version of RESTBuilder breaks the build, but this is the first I'm hearing about a dependency issue...

mir333 commented 4 years ago

When I run the ./gradlew clean buildREST build on a fresh copy the build fails.

It fails on

...
symbol:   method description()
  location: @interface GraphQLField
/tmp/vitamins/modules/headless-vitamins/headless-vitamins-api/src/main/java/com/dnebinger/headless/vitamins/dto/v1_0/Vitamin.java:162: error: cannot find symbol
        description = "The chemical names of the vitamin or mineral if it has some."
...                   ^

This can be resolved by removing the description from the yaml. After that, the generation goes well but the compilation fails. The vulcan.api that is included in the BOM does not have classes that are generated by the rest builder.

I fix this by including the latest version of the vulcan.API and also the vulcan.impl into my bundle.

It deploys but on deploy time it will complain about GraphQL annotation dependencies. At this point, I'm getting quite annoyed by it :)

Is there somewhere a record that shows what dependencies are there for a particular version of rest builder?

javiergamarra commented 4 years ago

Yep, that's the issue David was referring to. I'll investigate the exact dependency this project is using and send a PR

javiergamarra commented 4 years ago

It's using the 1.0.23 version, I've updated the build.gradle to reflect it and everything should generate accordingly as the uploaded code (except a test that was manually commented).

This should deploy and execute without issues in 7.2, please reopen the issue if necessary :)

mir333 commented 4 years ago

The problem at deployment time still remains as I mentioned in the previous comment.

rg.osgi.framework.BundleException: Could not resolve module: im.ligas.restbuilder.api [1127]_  Unresolved requirement: Import-Package: com.liferay.portal.vulcan.graphql.annotation; version="[1.2.0,2.0.0)"_ [Sanitized]

I think we need the API of version 4.0.0 a least but what version of vulcan impl goes with it and what rest builder version?

https://github.com/liferay/liferay-portal/commit/68cc4662671740a8f685abaa23a9a809e05c0e7c#diff-8caad1286554d6b2fb79659b48b790fc

javiergamarra commented 4 years ago

I'll fix vulcan versions. Which version of Liferay are you using? 7.2 GA2?

This package (generated with 1.0.23) shouldn't need com.liferay.portal.vulcan.graphql.annotation (custom annotations), so it should need an older vulcan version.

mir333 commented 4 years ago

I'm using this DXPC image liferaycloud/liferay-dxp:7.2.10-sp1-3.0.14

And I used liferay.workspace.target.platform.version=7.2.10.fp2

javiergamarra commented 4 years ago

Ok, sp1 is pretty recent, that's why you need the new annotations (AFAIK this project was build with 7.2 GA1).

No need to update vulcan, just use the versions provided in 7.2.10 sp1 (3.8.4 of vulcan api I think*). I've created a branch with the right rest builder, regenerated (I have to do a version matrix) and tried in a fresh 7.2 sp1 and everything should work ok: https://github.com/dnebing/vitamins/commits/7.2.sp1

Please reopen if neccesary :)