• 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>
  • 相关阅读:
    正则表达式
    c#文件流
    css
    Flash笔记 快捷键
    .Net截取指定长度的汉字,其余用...表示的方法
    远程修改最新消息管理系统(JQuery版)
    远程修改最新消息管理系统
    kubernetes 1.6 集群实践 (一)
    创建kafak集群
    创建zookeeper集群
  • 原文地址:https://www.cnblogs.com/lhfcws/p/6739405.html
Copyright © 2020-2023  润新知