我把7za装在了ubuntu上。在命令行中,这样做是可行的:
7za a -tzip -pMY_SECRET -mem=AES256 secure.zip /home/user/tmp/test.txt在一个maven项目中,我试图从maven-exec插件中调用它:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>encrypt-zip</id>
<goals>
<goal>exec</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<executable>7za</executable>
<!-- <executable>/usr/bin/7za</executable> -->
<arguments>
<argument>-tzip</argument>
<argument>-pMY_SECRET</argument>
<argument>-mem=AES256</argument>
<argument>/home/user/tmp/test.txt</argument>
<argument>secure.zip</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>但是这个错误失败了:
7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU)
Error:
Incorrect command line这里没什么可做的,有什么建议吗?
发布于 2013-10-12 22:41:31
<argument>标记与示例命令行不完全匹配,因此缺少a。
如果你像这样重写的话,它也许会起作用:
<argument>a</argument>
<argument>-tzip</argument>
<argument>-pMY_SECRET</argument>
<argument>-mem=AES256</argument>
<argument>secure.zip</argument>
<argument>/home/user/tmp/test.txt</argument>https://stackoverflow.com/questions/19339772
复制相似问题