zoukankan      html  css  js  c++  java
  • 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>
  • 相关阅读:
    Linux/windows查看设置环境变量指令
    转载:windows查看进程相关指令
    Ubuntu开启SSHD服务
    Ubuntu root方式登录
    洛谷P1466 集合 Subset Sums
    洛谷P1726 上白泽慧音
    洛谷P1983 车站分级
    洛谷P2577 [ZJOI2005]午餐
    洛谷P1119 灾后重建
    P1169 [ZJOI2007]棋盘制作
  • 原文地址:https://www.cnblogs.com/lhfcws/p/6739405.html
Copyright © 2011-2022 走看看