This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 257100

Summary: Unable to have/open a NodeJS and Maven or Gradle project at the same level
Product: projects Reporter: _ wadechandler <wadechandler>
Component: Generic InfrastructureAssignee: Tomas Stupka <tstupka>
Status: NEW ---    
Severity: normal CC: markiewb, wadechandler
Priority: P1    
Version: 8.1   
Hardware: PC   
OS: Mac OS X   
Issue Type: ENHANCEMENT Exception Reporter:

Description _ wadechandler 2015-12-10 13:19:05 UTC
We have a previously existing project which has build.gradle and package.json on the same level. The projects structures are then in sub-folders for both Node and Gradle. The IDE doesn't make it easy to choose which project type to use at any moment, and really I would like to work on both regardless, so it is difficult to work with this structure. The structure seems quite logical IMO; this is a multi-module Node and Gradle project which serves a UI from a Microservice (a micro UI). This also affects similar Maven projects. I will try to put together a simple example to attach sometime soon as well if it will help.
Comment 1 _ wadechandler 2015-12-10 13:20:38 UTC
I set this as a P1 per the guidelines for bug priority. I'm not sure there is a work around other than using files tab, and it isn't an easy solution as the IDE doesn't correctly enable all features. I would like to work on both with the provided features.
Comment 2 Tomas Stupka 2016-08-03 15:06:41 UTC
This is WAD. The netbeans project system was never meant (and therefore not designed) to work with more than one project type per project directory -> changing to feature request.

still - a simple example project would be appreciated. Also some deeper description of what exactly isn't working and what is requested 

thanks
Comment 3 mefiu767 2017-03-12 09:47:51 UTC
I found workaround to make NetBeans open node.js or html5 project containing build.gradle with gradle support plugin installed. You have to close NB, delete nbproject directory and .nb-gradle-properties file from project directory. Move your build.gradle and gradle.properties to other directory temporary. Then open and configure project as usually for html5 or node.js project. After that you can move back gradle files to project. NB will always open that project as web app, not as gradle project. That's not perfect but good for me when I have one subproject for backend and second one for frontend. I can use all editor's features for web project and run it with gradle in console. Tested with NB 8.2.
Comment 4 idclaar 2017-08-07 23:30:17 UTC
I have the same issue, and have tried to use the same workaround with a little success.  Still, this would be a really great feature, as it's a pretty common setup for a project where I'm working.  To get full IDE support for test/debug of automation and unit tests, I've had to switch to IDEA, which supports this type of development out of the box.

For background, here are some of the notes from my project example:
When we have npm files located in the root folder of a sub-project (namely package.json), along with all of the gradle project files, the IDE automatically considers the project type to be html5 when using the Projects window's context menu "Open Project...".  Opening the project as a sub-project from the parent project's sub-project list shows it as a gradle project though.

If it is opened from the parent project's sub-project list, the project opens, but displays as the parent project in the Projects window (gradle project), but in the Files window it shows up labeled correctly.  Trying to close the project from the Projects window fails.  It can only be closed from the Files window.  Until the project is closed through the Files window, it generates errors and seems to cause constant checking for external changes.
Comment 5 _ wadechandler 2017-08-08 11:57:21 UTC
(In reply to idclaar from comment #4)
> I have the same issue, and have tried to use the same workaround with a
> little success.  Still, this would be a really great feature, as it's a
> pretty common setup for a project where I'm working.  To get full IDE
> support for test/debug of automation and unit tests, I've had to switch to
> IDEA, which supports this type of development out of the box.
> 
> For background, here are some of the notes from my project example:
> When we have npm files located in the root folder of a sub-project (namely
> package.json), along with all of the gradle project files, the IDE
> automatically considers the project type to be html5 when using the Projects
> window's context menu "Open Project...".  Opening the project as a
> sub-project from the parent project's sub-project list shows it as a gradle
> project though.
> 
> If it is opened from the parent project's sub-project list, the project
> opens, but displays as the parent project in the Projects window (gradle
> project), but in the Files window it shows up labeled correctly.  Trying to
> close the project from the Projects window fails.  It can only be closed
> from the Files window.  Until the project is closed through the Files
> window, it generates errors and seems to cause constant checking for
> external changes.

Can you give more details of the IDEA workflow for this idclaar? Is this all in IDEA, or are you using differ JetBrains tools? Is this the same window or 2 different ones? How did you open both projects, or was all functionality under a single project type? Thanks