【问题标题】:Relocate "gwt-unitCache" directory重新定位“gwt-unitCache”目录
【发布时间】:2020-10-30 20:39:47
【问题描述】:

GWT 将生成一个带有一些缓存文件的gwt-unitCache 目录。经过几天的工作,该目录可能会产生超过 1GB 的缓存文件。我担心生成这些文件可能会损坏我的 SSD 硬盘。

我创建了一个 2GB 的 ramdisk 来存储临时文件。我的问题是是否可以重新定位gwt-unitCache 目录?

【问题讨论】:

  • 您可以使用 -Dgwt.persistentunitcache=false 临时禁用持久单元缓存

标签: gwt smartgwt


【解决方案1】:

'<sysproperty key="gwt.persistentunitcachedir" value="cache_dir"/>'添加到build.xml中的gwtc任务

我尝试使用 ${env.TEMP} 而不是指向物理路径,但看到一些 java 的随机 IO 问题。

--或--

'<sysproperty key="gwt.persistentunitcache" value="false"/>'添加到build.xml中的gwtc任务

禁用创建任何缓存文件,这有点慢

【讨论】:

    【解决方案2】:

    如果您使用 maven 项目,您可以像这样更改位置:

    <plugin>
     <groupId>org.codehaus.mojo</groupId>
     <artifactId>gwt-maven-plugin</artifactId>
    
     <configuration>
       <persistentunitcachedir>yourlocation</persistentunitcachedir>
     </configuration>
    </plugin>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-03
      • 1970-01-01
      • 2016-02-19
      • 1970-01-01
      • 1970-01-01
      • 2014-10-25
      • 1970-01-01
      相关资源
      最近更新 更多