java项目中构建scala模块

在maven项目中构建scala模块,这样的话可以java和scala互相调用,最好在环境变量中配置scala home,ide加载相关的模块进行编译运行。

pom中的配置如下:

1<dependencies> 2 <dependency> 3 <groupId>org.scala-lang</groupId> 4 <artifactId>scala-library</artifactId> 5 <version>2.10.4</version> 6 </dependency> 7 <dependency> 8 <groupId>org.scala-lang</groupId> 9 <artifactId>scala-actors</artifactId> 10 <version>2.10.4</version> 11 </dependency> 12 <dependency> 13 <groupId>junit</groupId> 14 <artifactId>junit</artifactId> 15 <version>4.8.1</version> 16 <scope>test</scope> 17 </dependency> 18 <dependency> 19 <groupId>org.slf4j</groupId> 20 <artifactId>slf4j-api</artifactId> 21 <version>1.5.11</version> 22 <scope>provided</scope> 23 </dependency> 24 <dependency> 25 <groupId>com.google.guava</groupId> 26 <artifactId>guava</artifactId> 27 <version>15.0</version> 28 <scope>provided</scope> 29 </dependency> 30 31 <dependency> 32 <groupId>org.slf4j</groupId> 33 <artifactId>jcl-over-slf4j</artifactId> 34 <version>1.5.11</version> 35 <scope>test</scope> 36 </dependency> 37 <dependency> 38 <groupId>commons-logging</groupId> 39 <artifactId>commons-logging</artifactId> 40 <version>99.0-does-not-exist</version> 41 <scope>test</scope> 42 </dependency> 43 <dependency> 44 <groupId>org.slf4j</groupId> 45 <artifactId>slf4j-log4j12</artifactId> 46 <version>1.5.11</version> 47 <scope>test</scope> 48 </dependency> 49 <dependency> 50 <groupId>log4j</groupId> 51 <artifactId>log4j</artifactId> 52 <version>1.2.15</version> 53 <scope>test</scope> 54 <exclusions> 55 <exclusion> 56 <groupId>javax.mail</groupId> 57 <artifactId>mail</artifactId> 58 </exclusion> 59 <exclusion> 60 <groupId>javax.jms</groupId> 61 <artifactId>jms</artifactId> 62 </exclusion> 63 </exclusions> 64 </dependency> 65 </dependencies> 66 67 <build> 68 <plugins> 69 <plugin> 70 <groupId>org.apache.maven.plugins</groupId> 71 <artifactId>maven-compiler-plugin</artifactId> 72 <version>2.3.2</version> 73 <configuration> 74 <source>1.6</source> 75 <target>1.6</target> 76 <encoding>UTF-8</encoding> 77 </configuration> 78 </plugin> 79 <plugin> 80 <groupId>org.apache.maven.plugins</groupId> 81 <artifactId>maven-resources-plugin</artifactId> 82 <version>2.4.3</version> 83 <configuration> 84 <encoding>UTF-8</encoding> 85 <useDefaultDelimiters>false</useDefaultDelimiters> 86 <delimiters> 87 <delimiter>${*}</delimiter> 88 </delimiters> 89 </configuration> 90 </plugin> 91 <plugin> 92 <groupId>net.alchim31.maven</groupId> 93 <artifactId>scala-maven-plugin</artifactId> 94 <version>3.1.6</version> 95 <configuration> 96 <sourceDir>src/main/scala</sourceDir> 97 <testSourceDir>src/test/scala</testSourceDir> 98 <encoding>UTF-8</encoding> 99 <args> 100 <arg>-encoding</arg> 101 <arg>UTF-8</arg> 102 </args> 103 </configuration> 104 105 <executions> 106 <execution> 107 <id>scala-compile-first</id> 108 <phase>process-resources</phase> 109 <goals> 110 <goal>add-source</goal> 111 <goal>compile</goal> 112 </goals> 113 </execution> 114 <execution> 115 <id>scala-test-compile</id> 116 <phase>process-test-resources</phase> 117 <goals> 118 <goal>testCompile</goal> 119 </goals> 120 </execution> 121 <execution> 122 <id>scala-doc-generator</id> 123 <phase>package</phase> 124 <goals> 125 <goal>doc-jar</goal> 126 </goals> 127 </execution> 128 </executions> 129 </plugin> 130 </plugins> 131 </build>
点赞
收藏

评论区

加载中...

相关推荐

MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1

文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s

Oracle 分组与拼接字符串同时使用

SELECTT.,ROWNUMIDFROM(SELECTT.EMPLID,T.NAME,T.BU,T.REALDEPART,T.FORMATDATE,SUM(T.S0)S0,MAX(UPDATETIME)CREATETIME,LISTAGG(TOCHAR(

MySQL部分从库上面因为大量的临时表tmp_table造成慢查询

背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_

皕杰报表之UUID

​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为

手写Java HashMap源码

HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22

2020年前端实用代码段,为你的工作保驾护航

有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )