1
我在Ubuntu上安裝了7za。從命令行工作的:從maven-exec調用7za失敗
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
沒有太多的工作在這裏,有什麼建議嗎?
我真的不知道,但不應該在'單曲在同一順序在命令行的例子嗎?另外我沒有看到'a',這是命令行中的第一個參數。 –
janos
你是對的,它現在可以工作,如果你喜歡,將它轉換爲答案。 – u123