[英]How can i pass command line option to phantomjs maven plugin
我在我的Java項目中使用phantomjs-maven-plugin。 我試圖用我的pom.xml將命令行選項傳遞給phantomjs(在插件docs中進行了描述:
<plugin>
<groupId>com.github.klieber</groupId>
<artifactId>phantomjs-maven-plugin</artifactId>
<version>0.7</version>
<executions>
<execution>
<phase>integration-test</phase>
<goals>
<goal>install</goal>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<version>2.1.1</version>
<checkSystemPath>true</checkSystemPath>
<commandLineOptions>--ssl-protocol=any --ignore-ssl-errors</commandLineOptions>
<script>assets/test.js</script>
<arguments>
<argument>${liberty.https.server.port}</argument>
</arguments>
</configuration>
</plugin>
通常,我試圖做的是這樣的:
phantomjs --ssl-protocol=any --ignore-ssl-errors test.js
但經過數小時的搜尋后,目前沒有運氣。
當我管理我的Maven任務時,出現以下錯誤:
[INFO] Executing phantomjs command
Invalid values for 'ssl-protocol' option.
我想我在此命令行選項中有一些語法問題。
謝謝你的幫助!
最終,我發現我在此處所做的配置錯誤。 只需將<commandLineOptions>
移到<execution>
區域內的配置部分。 最終看起來像這樣:
<execution>
<phase>integration-test</phase>
<goals>
<goal>install</goal>
<goal>exec</goal>
</goals>
<configuration>
<commandLineOptions>--ssl-protocol=any --ignore-ssl-errors=true</commandLineOptions>
</configuration>
</execution>
我將其從下面的主要配置部分中刪除了。
我設法弄清楚了之前的工作是將命令行參數傳遞給test.js腳本的執行和phantom.js的執行。
我希望它將為像我這樣迷路的人服務:)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.