Compile groovy mixed with java in Maven
Assuming that groovy codes are in src/main/groovy and java codes are in src/main/java.
We can use 2 maven-compiler-plugin to compile groovy and java, and add groovy-all dependency. And finally we can find the both groovy and java class files in jar.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<compilerId>groovy-eclipse-compiler</compilerId>
</configuration>
<dependencies>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-compiler</artifactId>
<version>2.9.2-01</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-eclipse-batch</artifactId>
<version>2.4.3-01</version>
</dependency>
</dependencies>
</plugin>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.3</version>
</dependency>
Compile groovy mixed with java in Maven的更多相关文章
- lua、groovy嵌入到java中的性能对比(转)
lua和groovy都是可以嵌入到java中的脚本语言.lua以高性能著称,与C/C++在游戏开放中有较多使用,groovy是一个基于Java虚拟机(JVM)的敏捷动态语言,在jvm下有着不错的性能. ...
- 使用 Java 和 Maven (JBake) 生成静态网站
使用 JBake("mvn generate-resources")构建您的静态网站或博客.使用布局.宏和数据文件. 我们迁移了整个www.optaplanner.org网站(13 ...
- YangTools从YANG生成Java类(Maven)
1.说明 ODL提供了Yang Tools工具从YANG文件生成Java类, 本文介绍使用Maven插件的方式生成, 基于yang-maven-plugin这个插件. 2.创建Maven工程 Ecli ...
- Java修改maven的默认jdk版本为1.7
Java修改maven的默认jdk版本 问题: 1.创建maven项目的时候,jdk版本是1.5版本,而自己安装的是1.7或者1.8版本. 2.每次右键项目名-maven->update pro ...
- java、maven、tomcat 环境变量配置
Linux 配置java.maven.tomcat 环境变量 打开 /etc/profile 在下面写上 # java env JAVA_HOME=/usr/local/tools/java (j ...
- Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 错误处理
出现 Error:Cannot compile Groovy files: no Groovy library is defined for module 'xxxx' 只要在 project str ...
- JEECG(二) JEECG框架下调用webservice java springmvc maven 调用 webservice
JEECG系列教程二 如何在JEECG框架下使用webservice 本文所使用的webservice是c#开发的 其实无论是什么语言开发的webservice用法都一样 java springmvc ...
- Java Jar maven 下载地址
Java Jar maven 下载地址 https://repo1.maven.org/maven2/ 根据maven artifactid 查找相关jar
- Groovy小结:java调用Groovy方法并传递参数
Groovy小结:java调用Groovy方法并传递参数 @(JAVA总结) 1. 场景描述 在网上查了资料发现,java有三种方式调用groovy脚本.但是真正在实际的服务器环境中,嵌入groovy ...
随机推荐
- [转] 设置div的overflow:scroll,但是在手机上滑动的时候有点卡顿
设置div的overflow:scroll,但是在手机上滑动的时候有点卡顿,所以在这个div上加一个css: -webkit-overflow-scrolling : touch; 在苹果手机上使用- ...
- es6 新增字符串方法
es6新增了4个字符串处理的方法:startsWith,endsWith,includes,repeat. 1.简单使用 includes()返回布尔值,表示是否找到了参数字符串 startsWith ...
- Spring MVC基础知识整理➣国际化和异常处理
概述 Spring框架为WEB项目提供了国际化以及异常处理机制.所谓的国际化也就是不同国籍,显示不同国籍的语言与符号.异常处理,也就是能够捕获WEB项目下的所有异常信息,并能处理记录这些异常信息机制. ...
- 【BZOJ2298】[HAOI2011]problem a
题解: 虽然也是个可以过得做法...但又没有挖掘到最简单的做法... 正解是发现这个东西等价于求不相交区间个数 直接按照右端点排序,然后贪心就可以O(n)过了 而我的做法是按照a排序(其实我是在模拟这 ...
- Python_模块介绍
模块:一组或者一个.py文件实现了某个功能的代码集合 模块分为三种: 自定义模块 内置标准模块(又称标准库):Python自带的模块 开源模块:自己写的模块,有可以供人使用的功能 开源模块的集散地:P ...
- go-无法下载websocket的问题
由于限制问题,国内使用 go get 安装 golang 官方包可能会失败,如我自己在安装 collidermain 时,出现了以下报错: $ go get collidermain package ...
- plink命令
用plink远程登陆link主机执行脚本,但是无法执行sudo命令 完成后自己关闭 plink -l root 192.168.1.21 df -h plink.exe -ssh -p ...
- Python class NameError name "xxx" is not defined
Python class NameError name "xxx" is not defined 这是因为在 class 中调用了带双下划线 "__" 的函数对 ...
- 关于thinkphp3自动完成的笔记
当我在前台传入的主键id与字段表的主键id值时,在更新时tp总是判断为新增的状态(解决办法:将前台的表单主键名保持和数据表主键id名一只,手动创建数据) create时是先获取主键id判断'$type ...
- Idea中在代码顶部添加自定义作者和时间
一.在工具栏找到File=>settings=>Editor=>File and Code Templates 二.选择右边的File Header,在编辑框中添加自定义信息,例如: ...