You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "mik (JIRA)" <ji...@apache.org> on 2016/05/15 08:52:12 UTC

[jira] [Created] (GROOVY-7839) Can't use groovy and java code in the same maven module

mik created GROOVY-7839:
---------------------------

             Summary: Can't use groovy and java code in the same maven module
                 Key: GROOVY-7839
                 URL: https://issues.apache.org/jira/browse/GROOVY-7839
             Project: Groovy
          Issue Type: Bug
            Reporter: mik
            Priority: Critical


When I try to compile my project using groovy-eclipse compiler with following classes: 

{code:java}
 import groovy.transform.builder.Builder 

// @author: m on 10.05.16 22:15. 
@Builder 
class F { 

   int a 

}
{code} 
and 

{code:java}
public class B { 

   int a; 

public static void main(String[] args) { 
    F.FBuilder builder = F.builder(); 

    F build = builder.a(1).build(); 
  } 
} 
{code}
The following error occurs: 

{code}
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files 
[INFO] ------------------------------------------------------------- 
[ERROR] COMPILATION ERROR : 
[INFO] ------------------------------------------------------------- 
[ERROR] /Users/m/git_repo/mix/src/main/java/B.java:[7,1] 1. ERROR in /Users/m/git_repo/mix/src/main/java/B.java (at line 7) 
    F.FBuilder builder = F.builder(); 
    ^^^^^^^^^^ 
F.FBuilder cannot be resolved to a type 

[ERROR] /Users/m/git_repo/mix/src/main/java/B.java:[7,24] 2. ERROR in /Users/m/git_repo/mix/src/main/java/B.java (at line 7) 
    F.FBuilder builder = F.builder(); 
                           ^^^^^^^ 
The method builder() is undefined for the type F 
[ERROR] Found 2 errors and 0 warnings. 
{code}
You can find project here: https://github.com/originalrusyn/mix/tree/a2672e42e6fecd46ead0e74c5585018db75733d5



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)