所以我有一個包含像這樣運行PARAMS一些TestNG的SuiteXML文件: -我的POM有什麼問題? 「解決expression..detected遞歸表達週期」
<!--SERVER AND TARGET PARAMS-->
<parameter name="environment" value="${environment}"/>
<parameter name="port" value="${port}"/>
和我的POM看起來就像這樣:
<?xml version="1.0" encoding="UTF-8"?>
HTTP:/ /maven.apache.org/xsd/maven-4.0.0.xsd「> 4.0.0
<groupId>co.uk.multicom.test.project</groupId>
<artifactId>fab-handler-automation</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<sl4j.version>1.7.7</sl4j.version>
<suiteFile>${suiteFile}</suiteFile>
<environment>${environment}</environment>
<port>${port}</port>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<systemProperties>
<property>
<name>javax.xml.parsers.SAXParserFactory</name>
<value>org.apache.xerces.jaxp.SAXParserFactoryImpl</value>
</property>
<property>
<name>user.language</name>
<value>en</value>
</property>
</systemProperties>
<!--<testFailureIgnore>true</testFailureIgnore>-->
<suiteXmlFiles>
<suiteXmlFile>${suiteFile}</suiteXmlFile>
</suiteXmlFiles>
<systemPropertyVariables>
<environment>${environment}</environment>
<port>${port}</port>
</systemPropertyVariables>
<properties>
<property>
<name>parallel</name>
<value>methods</value>
</property>
<property>
<name>threadCount</name>
<value>1</value>
</property>
<property>
<name>dataproviderthreadcount</name>
<value>1</value>
</property>
</properties>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.jayway.restassured/rest-assured -->
<dependency>
<groupId>com.jayway.restassured</groupId>
<artifactId>rest-assured</artifactId>
<version>2.9.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.6</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.9.10</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>htmlunit-driver</artifactId>
<version>2.21</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.jexcelapi</groupId>
<artifactId>jxl</artifactId>
<version>2.6.12</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!-- pom.xml -->
<dependency>
<groupId>com.aventstack</groupId>
<artifactId>extentreports</artifactId>
<version>3.0.0</version>
</dependency>
</dependencies>
我的錯誤是:
[ERROR] Resolving expression: '${environment}': Detected the following recursive expression cycle in 'environment': [environment] -> [Help 2]
[ERROR] Resolving expression: '${port}': Detected the following recursive expression cycle in 'port': [port] -> [Help 2]
我是不是傻嗎?也許,我畢竟只是一名測試者,而且腦子非常小。任何人都可以幫我解決問題嗎?我的POM看起來很滑嗎?
它不會將我需要的罐子下載到本地.m2,直到我可以修復它 - 我試圖吹走.m2,並做mvn安裝等....沒有快樂。
這是有道理的,謝謝 - 我將這些作爲詹金斯的開關傳遞,所以如果我未能通過本地,則會發生錯誤。因爲我在家用電腦上進行本地調試,實際上我現在可以將它們評論出來。如果你看到POM結構更普遍的問題,任何幫助非常感謝 – Steerpike