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 175013 - Improve Java->Groovy integration
Summary: Improve Java->Groovy integration
Status: NEW
Alias: None
Product: groovy
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All Linux
: P2 blocker with 2 votes (vote)
Assignee: Martin Janicek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-20 14:37 UTC by Petr Hejl
Modified: 2017-03-28 11:30 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
maven based groovy project (9.19 KB, application/xml)
2012-09-11 17:09 UTC, nikoM
Details
mixed java/groovy project (34.42 KB, application/octet-stream)
2012-09-12 12:39 UTC, nikoM
Details
error messages in Java/Groovy mixed project (121.28 KB, image/jpeg)
2012-09-12 14:12 UTC, nikoM
Details
Same Java/Groovy mixed project withtout any error (307.30 KB, image/png)
2012-09-18 12:28 UTC, Martin Janicek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2009-10-20 14:37:31 UTC
For example navigation from java source to groovy source does not work.
Comment 1 Petr Hejl 2009-10-21 15:56:35 UTC
This was meant as enhancement.
Comment 2 Martin Janicek 2012-06-18 09:40:26 UTC
Another use case (reported by Vincent Hardion):

No completion for Java class:
   1. Create a Java SE application project called "MyJavaApplication1"
   2. Create new Groovy class in the package myjavaapplication1
   3. In this GRoovy class, try to add a variable from type MyJavaApplication1 

=>  Failed even after a clean build of the project
Comment 3 nikoM 2012-09-11 15:56:43 UTC
It should be possible to import  mixed project there groovy scripts are located in the src/main/groovy
Right now after I open the project this folders is not considered as the src folder
Comment 4 nikoM 2012-09-11 17:00:31 UTC
(In reply to comment #3)
> It should be possible to import  mixed project there groovy scripts are located
> in the src/main/groovy
> Right now after I open the project this folders is not considered as the src
> folder

some corrections:
If I import maven based mixed Groovy/Java project using gmaven-plugin then
the src/main/groovy folder will be not used as the src folder for the project and all Java classes importing groovy classes can't compile.
Comment 5 nikoM 2012-09-11 17:09:16 UTC
Created attachment 124179 [details]
maven based groovy project

can't use IDE to navigate in the sources then I open this mixed groovy/java maven project. IDE is also showing me the error in the java classes importing the groovy 
classes.
Comment 6 Martin Janicek 2012-09-12 06:54:57 UTC
Could you please attach the whole project so I will be able to see the problem? (I mean not only the pom.xml, but also java/groovy sources)
Comment 7 nikoM 2012-09-12 12:39:22 UTC
Created attachment 124238 [details]
mixed java/groovy project
Comment 8 nikoM 2012-09-12 12:42:07 UTC
(In reply to comment #6)
> Could you please attach the whole project so I will be able to see the problem?
> (I mean not only the pom.xml, but also java/groovy sources)

Please find attached my project sources. If I import it with Netbeans it looks like it ignore groovy folder in src folders , but can build project without problem.
Comment 9 Martin Janicek 2012-09-12 13:07:49 UTC
Thanks for a quick response. Regarding your comments:

1] Problems with compilation - not sure how to reproduce this. I can successfully build the whole project using "Build with Dependencies" and I can't see any error after the build

2] Error in java classes importing groovy classes - can't reproduce this either. I can see warning in case if the imported class has the same package name as the importing one. Agree, that this would be good to fix, but can't see any compilation error

3] Navigation from java class to groovy class - this one is definitely correct. I can't do that either and agree it should be fixed.

Is my behavior the same as yours or am I doing something wrong? :]
Comment 10 nikoM 2012-09-12 14:12:02 UTC
Created attachment 124246 [details]
error messages in Java/Groovy mixed project

error messages in Java/Groovy mixed project
Comment 11 nikoM 2012-09-12 14:18:24 UTC
(In reply to comment #9)

> Thanks for a quick response. Regarding your comments:
Thanks for your answer too. 

> 
> 1] Problems with compilation - not sure how to reproduce this. I can
> successfully build the whole project using "Build with Dependencies" and I
> can't see any error after the build
> 
I agree .. I can build it. but to work with a project is not possible normally.



> 2] Error in java classes importing groovy classes - can't reproduce this
> either. I can see warning in case if the imported class has the same package
> name as the importing one. Agree, that this would be good to fix, but can't see
> any compilation error

I attach the screenshot from my latest netbeans installation.
It show me errors (or it is warnings ??) in the java class which use groovy classes.


> 
> 3] Navigation from java class to groovy class - this one is definitely correct.
> I can't do that either and agree it should be fixed.

Yes it will be really cool if it can be fixed. 

> Is my behavior the same as yours or am I doing something wrong? :]

in generally project show me something like errors but yes can build it..
So it is not really possible to work normally. I will be glad if it will be improved.

Thanks !
Comment 12 Martin Janicek 2012-09-18 12:26:48 UTC
> > 2] Error in java classes importing groovy classes - can't reproduce this
> > either. I can see warning in case if the imported class has the same package
> > name as the importing one. Agree, that this would be good to fix, but can't see
> > any compilation error
> 
> I attach the screenshot from my latest netbeans installation.
> It show me errors (or it is warnings ??) in the java class which use groovy
> classes.
> 

Interesting, I don't see the same result. After the build I have the project without any error (I'm going to attach my screen-shot). Could you please try to reproduce with the latest nightly build? (http://bits.netbeans.org/download/trunk/nightly/latest/)
Comment 13 Martin Janicek 2012-09-18 12:28:11 UTC
Created attachment 124507 [details]
Same Java/Groovy mixed project withtout any error
Comment 14 nikoM 2012-09-19 08:02:36 UTC
(In reply to comment #12)
> > > 2] Error in java classes importing groovy classes - can't reproduce this
> > > either. I can see warning in case if the imported class has the same package
> > > name as the importing one. Agree, that this would be good to fix, but can't see
> > > any compilation error
> > 
> > I attach the screenshot from my latest netbeans installation.
> > It show me errors (or it is warnings ??) in the java class which use groovy
> > classes.
> > 
> 
> Interesting, I don't see the same result. After the build I have the project
> without any error (I'm going to attach my screen-shot). Could you please try to
> reproduce with the latest nightly build?
> (http://bits.netbeans.org/download/trunk/nightly/latest/)

Hi,
I have tried with last build. This  release does not have this errors.
(In reply to comment #12)
> > > 2] Error in java classes importing groovy classes - can't reproduce this
> > > either. I can see warning in case if the imported class has the same package
> > > name as the importing one. Agree, that this would be good to fix, but can't see
> > > any compilation error
> > 
> > I attach the screenshot from my latest netbeans installation.
> > It show me errors (or it is warnings ??) in the java class which use groovy
> > classes.
> > 
> 
> Interesting, I don't see the same result. After the build I have the project
> without any error (I'm going to attach my screen-shot). Could you please try to
> reproduce with the latest nightly build?
> (http://bits.netbeans.org/download/trunk/nightly/latest/)

I have tried with the last build. This has shown no errors..
Exactly how on yours screenshot. I see it only with 7.2 release  on my WinXP box.
Comment 15 Martin Janicek 2012-09-19 08:05:17 UTC
Great, thanks for the verification!
Comment 16 tkellerer 2016-09-28 07:36:46 UTC
Another exmaple on where the integration doesn't work is the Mouqui project which makes heavy use of Groovy and Java

https://github.com/moqui/moqui-framework/tree/master/framework/src/main/groovy/org/moqui/impl/entity
Comment 17 aplatypus 2017-03-28 11:30:41 UTC
This issue STILL exists in Netbeans 8.2 (2017 latest updates) and with Gradle builds.