Scala close file name

I have a problem due to the file name length that compilers give to one of my closures inside the Scala class using Scala 2.9.2

CurrencyInitializer $$ anonfun $ com $ Gottex $ gottware $ server $ startup $ Initializers $ currency $ currencyInitializer $$ updateDepositEquivalentBonds $ 1.class

The problem with this file name is that I am loading a folder containing all my compiled classes through a Linux server via SSH gui, and this fails.

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]), Lease.FOREVER, UpdateModifiers.UPDATE_OR_WRITE | UpdateModifiers .NO_RETURN_VALUE) } } 

Surprisingly, this is code that creates a long file name. Is there something I can do for the compiler to prevent this from happening?

+4
source share
1 answer

Set the max-classfile-name parameter in the scala compiler call to shorten the file names.

In POM, to get file names of no more than 144 characters (Crypt FS size limit), the configuration looks like

  <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 to the source of the compilation source link (will become obsolete)

+4
source

All Articles