yasuflatland-lf / damascus

⚔️ CRUD boilerplate generator for Liferay DXP
https://yasuflatland-lf.github.io/damascus-doc/
GNU Lesser General Public License v3.0
51 stars 35 forks source link

Import Liferay Module Project: Location is not recognized #80

Closed icarrara closed 4 years ago

icarrara commented 4 years ago

At first, many congratulations for the great work.

I'll consider to use Damascus so I'm starting some tests related to our use cases.

I undertand that this is not an Issue and the I'm not in the right place but I'll try to post the below question: In Liferay Developer Studio pointing to the 'modules' folder I tried to Import ---> Liferay Module Projects(s) but picking the 'todo' folder generated by Damascus I get the "Location is not recognized as a valid projecy type" error.

Please could you help me ?

Moreover, are you planning some form of Support forum or other form of Support service?

Thank you in advance. Ivano C.

icarrara commented 4 years ago

Update: If you create a new module in the 'modules' folder, Liferay Developer Studio import other modules not yet in the workspace autonomously. This close the issue for me.

Moreover, are you planning some form of Support forum or other form of Support service?

Thank you in advance. Ivano C.

yasuflatland-lf commented 4 years ago

Hi @icarrara , thank you for being interested in Damascus! Answering your question quickly, in case you create a project by Damascus, you may want to run "Refresh" and "Refresh Gradle Project" in the Liferay Developer Studio (LDS). What I tried and confirmed are the following steps.

I hope it works for you.

  1. Create a new folder ldrtmp
  2. Open up LDS and point the workplace to the ldrtmp folder
  3. Under the ldrtmp folder, create ws folder and navigate there
  4. Run “blade init -v 7.2” and create Liferay 7.2 workspace.
  5. Go to modules folder, and run damascus init -c Todo -p com.liferay.sb.test -v 7.2
  6. And go to todo folder and run damascus create
  7. In LDS menu, File -> import and import the ws folder as Liferay Workspace Project. Select Workspace Location (the ws folder. Leave build type as it is, gradle-liferay-workspace, assuming you are using gradle.
  8. In the Project Explorer, right-click on ws, imported Liferay Workspace and in the context menu, select Refresh. It may take a while to refresh the project
  9. You may be able to see the Todo bundles are recognized as gradle projects. In case you still see general folder icons, not gradle project folder icon, select ws in the Project Explorer panel and do right-click, then in the context menu, select Gradle -> Refresh Gradle Project, then you’ll be able to see the projects properly recognized as Gradle projects
yasuflatland-lf commented 4 years ago

Hi, @icarrara , I created Gitter account for the communication. https://gitter.im/liferay-damascus/community#

Will add a link as a badge in README.md when I release next time.

icarrara commented 4 years ago

Hi @yasuflatland-lf , great !

I just joined damascus/community.

Thank you !

icarrara commented 4 years ago

Ok, it worked.

Thank you @yasuflatland-lf !

icarrara commented 4 years ago

The import worked for the first project "Todo". Then I tried to import the second project "Employee" and again I'm not able to import in the same liferay workspace: immagine

When I try to import the "emplyee" folder I get the below error: immagine

icarrara commented 4 years ago

I found the workaround: Every time a create a new Damascus project, I delete the liferay workspace from Liferay Developer Studio and then reimport it.

yasuflatland-lf commented 4 years ago

@icarrara , you may just need to place the employee project and try the way that I introduced above. LDS would recognize the project properly.

icarrara commented 4 years ago

For sure it is my fault but what you introduced above it is ok for the first module, in my case Todo module. I imported it successifully following your directives.

My problem is to import the second (Employee) and other modules after the first Todo module.

I tried to import Employee module as a Liferay Module Project what it fails as you can see in the previous scree shot.

My workaround is to delete the whole liferay workspace and then reimport again after I generated new modules using Damascus.

yasuflatland-lf commented 4 years ago

@icarrara Got it, thank you for your clarification. Let me try to import the second module in the Liferay Workspace in Liferay Developer Studio.

yasuflatland-lf commented 4 years ago

@icarrara, it worked for me, Liferay Developer Studio(3.6.2) loaded 2 projects (employee, a sample of 2 models relations and todo, the initial sample that Damascus creates) properly. The steps are below:

  1. Create a workspace for Liferay Developer Studio(LDS), say ${home}/ldstest
  2. Create ${home}/ldstest/ws directory and go to the directory, then run blade init -v 7.2
  3. Back to LDS, Import the Liferay Workspace just created, File > import > Liferay Workspace
  4. Go to modules and run damascus init -c Todo -p com.liferay.sb.test -v 7.2 and then go to todo directory and run damascus create
  5. On LDS, right-click on the ws root folder and run refresh and gradle > Refresh Gradle Project. You'll see the todo project recognized a gradle project.
  6. Go back to the console and run damascus init -c Employee -p com.liferay.sb -v 7.2 and copy and past the sample in base.json and run damascus create
  7. On LDS, right-click on the ws root folder and run refresh and gradle > Refresh Gradle Project. You'll see the employee project recognized a gradle project without errors.

I basically didn't use LDS for the loading module... If you consider this is a bug, please go ahead to report this on our official bug tracker for IDE

icarrara commented 4 years ago

Dear @yasuflatland-lf, thank you very much for your help.

I'm a bit confused and frustrated because solving one thing then I get new issue. The gradle > Refresh Gradle Project works but now all references to Todo and Employee are in error.

I changed to "distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip" in the "gradle\wrapper\gradle-wrapper.properties" file because with the original "4.10.2" version the import fails.

Here is the LDS status after the import of Liferat workspace: immagine

The errors are caused by references to Todo and Employee models: immagine But build.gradle has references to -service and -api modules: `// // // // // apply plugin: 'java' apply plugin: 'groovy' apply plugin: 'idea' apply plugin: 'eclipse'

sourceCompatibility = 1.8 targetCompatibility = 1.8

//Need for Windows def defaultEncoding = 'UTF-8'

dependencies { compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.5.0" compile group: "org.apache.poi", name: "poi", version: "4.0.1" compile group: "org.apache.poi", name: "poi-ooxml", version: "4.0.1" compile group: "org.apache.poi", name: "poi-ooxml-schemas", version: "4.0.1"

compileOnly group: "com.liferay", name: "com.liferay.application.list.api", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.asset.api", version: "2.1.+"
compileOnly group: "com.liferay", name: "com.liferay.asset.display.page.api", version: "5.1.0"
compileOnly group: "com.liferay", name: "com.liferay.asset.display.page.item.selector.api", version: "2.0.0"
compileOnly group: "com.liferay", name: "com.liferay.asset.info.display.api", version: "2.1.0"
compileOnly group: "com.liferay", name: "com.liferay.asset.taglib", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.comment.taglib", version: "2.0.+"
compileOnly group: "com.liferay", name: "com.liferay.frontend.taglib", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.frontend.taglib.clay", version: "2.1.+"
compileOnly group: "com.liferay", name: "com.liferay.frontend.taglib.soy", version: "3.0.0"
compileOnly group: "com.liferay", name: "com.liferay.frontend.taglib.util", version: "2.0.+"
compileOnly group: "com.liferay", name: "com.liferay.info.api", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.item.selector.api", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.item.selector.criteria.api", version: "4.0.+"
compileOnly group: "com.liferay", name: "com.liferay.item.selector.taglib", version: "3.0.+"
compileOnly group: "com.liferay", name: "com.liferay.petra.reflect", version: "3.0.+"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "4.13.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "4.1.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.1"
compileOnly group: "javax.servlet.jsp", name: "javax.servlet.jsp-api", version: "2.3.1"
compileOnly group: "jstl", name: "jstl", version: "1.2"
compileOnly group: "org.apache.felix", name: "org.apache.felix.http.servlet-api", version: "1.1.2"
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
compileOnly project(":modules:employee:employee-api")
compileOnly project(":modules:employee:employee-service")

}

So I'm in a bad moment.

Please could you help me some more ? Ivano C.`

yasuflatland-lf commented 4 years ago

@icarrara You are basically not necessary to modify any code or Gradle versions that blade gw command use for compile, deploy and load the code in LDS. Let me ask some questions.

icarrara commented 4 years ago

Dear @yasuflatland-lf , below the environment:

What version of LDS are you using? 3.7.1.201910160309-ga2
Is the Liferay Workspace targeting 7.2? 7.2.0
What version of blade are you using? 3.8.0.201909200317
What version of JDK your LDS is targeting to? 1.8.0_161
What's your JDK version installed on your machine? 1.8.0_161
Is your environment behind a proxy? No. It download every thing its needs

I'll try to restart from scratch ...

yasuflatland-lf commented 4 years ago

@icarrara the environment looks ok to me. It looks like the issue of LDS side that it doesn't recognize libraries paths. What you may be able to do is

icarrara commented 4 years ago

Dear @yasuflatland-lf ,

I restarted from scratch and finally the environment is working and it imports Damascus project without problems.

The actual environment as below:

Thank you for your support. You can close the issue if you wish.

yasuflatland-lf commented 4 years ago

@icarrara ok!