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 213024 - Cannt create new groovy package in maven project
Summary: Cannt create new groovy package in maven project
Status: RESOLVED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-25 15:37 UTC by Skvorec
Modified: 2013-07-31 02:24 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Patch fixing the issue (1.39 KB, patch)
2013-07-30 12:31 UTC, Martin Janicek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Skvorec 2012-05-25 15:37:40 UTC
I have maven project that have some java packages and some groovy packages.
I want to add new groovy package. I right-click on existing groovy package and choose "New -> Java package".
But NetBeans will create this new package in java-src, not in groovy-src.
For example, I want to create package "new.groovy.package".
So, I want to create dir project_root_dir/src/main/groovy/new/groovy/package, but NetBeans creates dir project_root_dir/src/main/JAVA/new/groovy/package
Comment 1 Martin Janicek 2012-05-31 12:05:40 UTC
Thanks for reporting this! Definitely valid issue --> Setting TM = Next
Comment 2 _ wadechandler 2013-03-05 21:14:50 UTC
Bumping this to a P2. The affect this has is that one must create separate directories, and from a usability perspective it is very difficult; I'm working on moving some Java stuff over to groovy, and just want my folder structure laid out versus trying to copy the whole thing and then removing stuff. The only other quick workaround is to go to the CLI and use mkdir with options to create parents. There is no way using the wizard. You can select "Resources" in the wizard for instance, and you can create a new package there, but there is not option in the new package wizard for Groovy, so you sit there looking at the screen going...ummm...oh...well I guess I can create some directories on the CLI or one directory at a time, but I know I can do that because I have used it before. Some new user would most likely tuck tail and run as it is very confusing. This may be an issue of the mvn support perhaps...seems it would be handy to be able to create a new package under some directory created under main/* or test/*, and that would allow the IDE to more likely be used to support other up and coming technologies which could be used through mvn.
Comment 3 _ wadechandler 2013-03-05 21:19:03 UTC
One workaround I just tested, for anyone who may find this, and which you can use in the mean time, is to use the new Folder wizard. In there you can type multiple directory names, and it will create them all for you. So, lets say you right click on the Groovy packages node. You can choose new Folder, and you could enter in org/mydomain/myproduct/mypackage, and then press enter, and it will create them all for you in one shot. Still, although a viable workaround in this case, it is still confusing if you don't know about it, and to find out about it, you must look in the right place and know how to find it...at this point...this issue.
Comment 4 Martin Janicek 2013-03-06 08:27:40 UTC
Agree with you Wade, this is pretty annoying. The issue is here because our Groovy code currently use "Java package" wizard as it is. And the author of the code probably didn't expected that someone might need to create java package in a different folder than the standard one.
I'll fix it for NetBeans 8.0
Comment 5 Martin Janicek 2013-07-30 12:31:54 UTC
Created attachment 137998 [details]
Patch fixing the issue

Patch fixing the problem. Changes are in java.project module, class NewJavaFileWizardIterator where we need to check also for groovy source groups.
Comment 6 Martin Janicek 2013-07-30 12:36:04 UTC
Tomasi could you please take a look at the patch ? I made small changes in java.project - NewJavaFileWizardIterator to be able to fix this issue. Thanks
Comment 7 Tomas Zezula 2013-07-30 12:55:41 UTC
Seems OK to me.
Comment 8 Martin Janicek 2013-07-30 13:16:08 UTC
Thanks! Pushed in: web-main #4f9d87ec5f25
Comment 9 Quality Engineering 2013-07-31 02:24:40 UTC
Integrated into 'main-silver', will be available in build *201307302300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4f9d87ec5f25
User: Martin Janicek <mjanicek@netbeans.org>
Log: #213024 - Cannt create new groovy package in maven project