简体   繁体   中英

How to compile mixed (Java and Groovy) project?

I have a project (Java Swing application), in which I want to mix Java and Groovy.

I can compile and run the project without problems inside IntelliJ Idea.

But I can't compile it with Maven:

  1. In src/main/groovy I define a Groovy class GroovyClass .
  2. In src/main/java there is a Java class, which uses GroovyClass .
  3. When compiling the project with Maven, I get the message [ERROR] ...\\JavaClass.java:[13,47] error: cannot find symbol .

How can I change the pom.xml file in order to be able to compile and package the application using Maven?

Add the groovy-eclipse compiler maven plugin to your pom.xml

Instructions are on the plugins page at https://github.com/groovy/groovy-eclipse/wiki/Groovy-Eclipse-Maven-plugin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM