简体   繁体   English

如何禁用sql-maven-plugin文件复制到temp文件夹?

[英]How disable sql-maven-plugin file copy to temp folder?

Here is a piece of plugin configuration: 这是插件配置的一部分:

<configuration>
    <srcFiles>
        <srcFile>src${file.separator}integration-test${file.separator}resources${file.separator}sql${file.separator}schema.sql</srcFile>
    </srcFiles>
</configuration>

Everything works , but I see in log: 一切正常 ,但我在日志中看到:

[INFO] --- sql-maven-plugin:1.5:execute (create-tables) @ smsfinance-server ---
[INFO] Executing file: C:\Users\User\AppData\Local\Temp\schema.915861870sql

Is there a way to disable copying? 有禁用复制的方法吗?

No, this is not possible at the moment. 不可以,目前尚不可能。

Reading from the source code of version 1.5, the SQL Maven Plugin is copying the sources files to a temporary directory to handle filtering, even when filtering is disabled. 版本1.5 的源代码读取,SQL Maven插件将源文件复制到临时目录以处理过滤,即使禁用了过滤也是如此。 Filtering is enabled with the attribute enableFiltering . 使用属性enableFiltering启用过滤。

You could create an issue at their GitHub page to disable copying of the file when filtering is disabled (which is the default). 您可以在其GitHub页面上创建一个问题以在禁用过滤功能时禁用文件的复制(这是默认设置)。

Workaround 解决方法

For cases when sql files is placed on ssd disk, you can specify tmp dir on ssd - just add -Djava.io.tmpdir=/ssd-drive/tmp to maven command line. 对于将sql文件放在ssd磁盘上的情况,可以在ssd上指定tmp -Djava.io.tmpdir=/ssd-drive/tmp只需将-Djava.io.tmpdir=/ssd-drive/tmp到maven命令行即可。 It does not disable copying, but spead up sql execution process. 禁止复制, spead了SQL的执行过程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM