加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

Scala关闭文件名

发布时间:2020-12-16 10:02:50 所属栏目:安全 来源:网络整理
导读:我有一个问题,因为编译器使用 Scala 2.9.2为 Scala类中的一个闭包提供了文件名的长度 CurrencyInitializer $$anonfun $COM $gottex $gottware $服务器$启动$初始化$IMPL $货币$CurrencyInitializer $$updateDepositEquivalentBonds $1.class 我对这个文件名
我有一个问题,因为编译器使用 Scala 2.9.2为 Scala类中的一个闭包提供了文件名的长度

CurrencyInitializer $$anonfun $COM $gottex $gottware $服务器$启动$初始化$IMPL $货币$CurrencyInitializer $$updateDepositEquivalentBonds $1.class

我对这个文件名的问题是我上传的文件夹包含我通过Linux服务器通过Linux服务器编译的所有类,这就失败了.

private def updateDepositEquivalentBonds(currency: Currency) {

    val depositEquivalentBonds = gottwareDataSource.space.readAllWithCurrency(classOf[DepositEquivalentBondImpl],currency)
    for (depositEquivalentBond <- depositEquivalentBonds) depositEquivalentBond.updateFromDeposit(gottwareDataSource.space)
    if (depositEquivalentBonds.length > 0) {
      gottwareDataSource.space.writeMultiple(depositEquivalentBonds,Lease.FOREVER,UpdateModifiers.UPDATE_OR_WRITE | UpdateModifiers.NO_RETURN_VALUE)
      gottwareDataSource.space.writeMultiple(AskBidSpread.newInstances(depositEquivalentBonds.toArray[SecurityImpl]),UpdateModifiers.UPDATE_OR_WRITE | UpdateModifiers
        .NO_RETURN_VALUE)
}
  }

令人惊讶的是,这是产生长文件名的代码.我可以在编译器上做些什么来防止这种情况发生吗?

解决方法

在scala编译器调用上设置max-classfile-name参数以缩短文件名.

在POM中,要获取不超过144个字符(Crypt FS大小限制)的文件名,配置看起来像

<plugin>
     <groupId>org.scala-tools</groupId>
     <artifactId>maven-scala-plugin</artifactId>
     <configuration>
         <scalaVersion>2.9.2</scalaVersion>
         <args>
              <arg>-Xmax-classfile-name</arg>
              <arg>144</arg>
         </args>
     </configuration>
 </plugin>

编译器源设置参考link(将过时)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读