OpenLiberty / liberty-tools-eclipse

Eclipse Public License 2.0
11 stars 8 forks source link

SVT:Multi module gradle projects are not importing as gradle projects in eclipse #472

Open jagraj opened 10 months ago

jagraj commented 10 months ago

I have multi module gradle projects, when I try to import all the projects into my eclipse workspace, all the children projects are not recognized as gradle projects.

Here is the screenshot from the eclipse workspace. You can see the gradle icon on the parent project but not for any of the children projects.

image

scottkurz commented 10 months ago

This is not a function of Liberty Tools Eclipse per se, but let's park this issue here for us to investigate. We ideally should be able to advise our users on how to resolve this issue.

scottkurz commented 9 months ago

Hmm..just taking another look at this. I was surprised originally that there was only 1 Eclipse project for the top level Gradle project and none for all the nested Gradle projects. But..that said.. the Gradle Tasks view still gives a nice UI around executing tasks in each of the child projects.

Besides this being unexpected what exactly does this prevent us from doing that we wanted to do in a case like this?

jagraj commented 9 months ago

After debugging this issue looks like one of the gradle task Task :GarageSaleRuntimeUtil:installFeature FAILED and this caused failed to import as gradle projects in the eclipse workspace and I don't see same behavior with I try to import same projects where they are configured as maven projects.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.3/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE SUCCESSFUL in 31s
> Task :nothing UP-TO-DATE

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4s
Working Directory: C:\MyData\MyWDTWorkspaces\GarageSale\GarageSaleJakartaEE10\LibertyTools\garageSale-ee
Gradle user home: C:\Users\Administrator\.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 7.6.3
Java Home: C:\MyData\MyWDTTools\LibertyTools\2023-09-R\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.9.v20231028-0858\jre
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
> Task :CreditCardDBJPA:cleanEclipseWtpComponent
> Task :CreditCardDBJPA:cleanEclipseWtpFacet
> Task :CreditCardDBJPA:cleanEclipseWtp UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:cleanEclipseWtpComponent UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:cleanEclipseWtpFacet UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleRuntimeUtil:cleanEclipseWtpComponent
> Task :GarageSaleRuntimeUtil:cleanEclipseWtpFacet
> Task :GarageSaleRuntimeUtil:cleanEclipseWtp UP-TO-DATE
> Task :WSBankDBJPA:cleanEclipseWtpComponent UP-TO-DATE
> Task :WSBankDBJPA:cleanEclipseWtpFacet UP-TO-DATE
> Task :WSBankDBJPA:cleanEclipseWtp UP-TO-DATE
> Task :GSjsf40LibertyWeb:cleanEclipseWtpComponent
> Task :GSjsf40LibertyWeb:cleanEclipseWtpFacet
> Task :GSjsf40LibertyWeb:cleanEclipseWtp UP-TO-DATE
> Task :WSBankEJB:cleanEclipseWtpComponent UP-TO-DATE
> Task :WSBankEJB:cleanEclipseWtpFacet UP-TO-DATE
> Task :WSBankEJB:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleLibertyEAR:cleanEclipseWtpComponent UP-TO-DATE
> Task :GarageSaleLibertyEAR:cleanEclipseWtpFacet UP-TO-DATE
> Task :GarageSaleLibertyEAR:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleWSClient:cleanEclipseWtpComponent UP-TO-DATE
> Task :GarageSaleWSClient:cleanEclipseWtpFacet UP-TO-DATE
> Task :GarageSaleWSClient:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleDBJPA:cleanEclipseWtpComponent
> Task :GarageSaleDBJPA:cleanEclipseWtpFacet
> Task :GarageSaleDBJPA:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleCDIExtensions:cleanEclipseWtpComponent
> Task :GarageSaleCDIExtensions:cleanEclipseWtpFacet
> Task :GarageSaleCDIExtensions:cleanEclipseWtp UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:cleanEclipseWtpComponent UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:cleanEclipseWtpFacet UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:cleanEclipseWtp UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:cleanEclipseWtpComponent UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:cleanEclipseWtpFacet UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:cleanEclipseWtp UP-TO-DATE
> Task :CreditCardEJB:cleanEclipseWtpComponent UP-TO-DATE
> Task :CreditCardEJB:cleanEclipseWtpFacet UP-TO-DATE
> Task :CreditCardEJB:cleanEclipseWtp UP-TO-DATE
> Task :GarageSaleEJB:cleanEclipseWtpComponent UP-TO-DATE
> Task :GarageSaleEJB:cleanEclipseWtpFacet UP-TO-DATE
> Task :GarageSaleEJB:cleanEclipseWtp UP-TO-DATE
> Task :CreditCardDBJPA:eclipseWtpComponent
> Task :CreditCardDBJPA:eclipseWtpFacet
> Task :CreditCardDBJPA:eclipseWtp
> Task :GSjsf40LibertyWeb:eclipseWtpComponent
> Task :GSjsf40LibertyWeb:eclipseWtpFacet
> Task :GSjsf40LibertyWeb:eclipseWtp
> Task :GarageSaleDBJPA:eclipseWtpComponent
> Task :GarageSaleDBJPA:eclipseWtpFacet
> Task :GarageSaleDBJPA:eclipseWtp
> Task :GarageSaleCDIExtensions:eclipseWtpComponent
> Task :GarageSaleCDIExtensions:eclipseWtpFacet
> Task :GarageSaleCDIExtensions:eclipseWtp
> Task :GarageSaleRuntimeUtil:eclipseWtpComponent
> Task :GarageSaleRuntimeUtil:eclipseWtpFacet
> Task :GarageSaleRuntimeUtil:installLiberty UP-TO-DATE
> Task :GarageSaleRuntimeUtil:libertyCreate UP-TO-DATE
> Task :GarageSaleRuntimeUtil:prepareFeature

> Task :GarageSaleRuntimeUtil:installFeature

> Task :GarageSaleRuntimeUtil:installFeature FAILED
> Task :GarageSaleRuntimeUtil:copyJaxRSThirdPartyJars UP-TO-DATE
> Task :GarageSaleRuntimeUtil:copyDB2Jars UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':GarageSaleRuntimeUtil:installFeature'.
> io.openliberty.tools.common.plugins.util.PluginExecutionException: CWWKF1299E: The following features could not be obtained: waspersonawebserviceshandlerfeature. Ensure that the features are valid for Open Liberty.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 12s
58 actionable tasks: 22 executed, 36 up-to-date
dependencies {
  //libertyApp project(':GarageSaleLibertyEAR')
  libertyApp project(path: ':GarageSaleLibertyEAR', configuration: 'archives')
  libertyRuntime group: 'io.openliberty', name: 'openliberty-runtime', version: '23.0.0.10'
}

The installFeature task is failed with openliberty-runtime but when I try to switch liberty runtime with WebSphere liberty then the installFeature is successful then all the projects imported as gradle projects into workspace.

dependencies {
  //libertyApp project(':GarageSaleLibertyEAR')
  libertyApp project(path: ':GarageSaleLibertyEAR', configuration: 'archives')
  //featuresBom 'com.ibm.ws.svt.gs.garagesale-ee10:WASPersonaWebServicesBOM:0.0.1-SNAPSHOT'
  libertyRuntime group: 'com.ibm.websphere.appserver.runtime', name: 'wlp-jakartaee10', version: '23.0.0.10'
}

When one of the task is failed in one of child gradle project then we should not fail to import parent gradle projects in multi gradle projects application.

scottkurz commented 9 months ago

@jagraj thx for the update.

Let me just ask.. when you see this:

Task :GarageSaleRuntimeUtil:installFeature FAILED Are you saying this is the error on import of Gradle project? (I know Eclipse Gradle does some sort of Gradle build upon import, though I'm still learning the details).

Or are you just making a connection yourself btw. this particular failure and the thing that gets messed up on importing the project(s)?

jagraj commented 9 months ago

@scottkurz

Yes, I see this failure when I import parent project which has all the multiple gradle modules. One of the module GarageSaleRuntimeUtil using liberty-grade-plugin failed when installing liberty user feature. My understanding is projects should be imported gracefully even though one of the task is failed from one of the child project.