Jenkins에서 Butbucket의 수은 브랜치를 복제하는 Maven 프로젝트를 만들었으므로 Selenium TestNG 스크립트를 실행할 수 있습니다. 깨끗한 빌드를 갖기 위해 작업 공간을 지우려고 시도했지만 이전과 동일한 오류가 발생했습니다. 또한 pom.xml 파일에 대한 jenkins 작업 공간의 각 모듈을 확인했으며 모두 존재합니다. 콘솔에서 오류 보고서 이미지를 클릭하십시오. Jenkins와 Eclipse가 동일한 프로젝트 폴더에있을 때 내 종속성의 pom.xml 파일을 찾을 수없는 이유를 이해할 수 없습니다.
Pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>PSWebTestFramework</artifactId>
<groupId>com.guidewire.pstesting</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>pswtf-test-tp-pc</artifactId>
<dependencies>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.21</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
</dependency>
<dependency>
<groupId>com.guidewire.pstesting</groupId>
<artifactId>pswtf-application-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.guidewire.pstesting</groupId>
<artifactId>pswtf-test-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.guidewire.pstesting</groupId>
<artifactId>pswtf-test-tp-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.guidewire.pstesting</groupId>
<artifactId>pswtf-application-tp-pc</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.guidewire.pstesting</groupId>
<artifactId>pswtf-application-ootb-pc</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<defaultGoal>test</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.18.1</version>
<configuration>
<excludes>META-INF/*.SF</excludes>
<excludes>META-INF/*.DSA</excludes>
<excludes>META-INF/*.RSA</excludes>
<argLine>-Dorg.uncommons.reportng.escape-output=false</argLine> <!-- get html in reports rather than string -->
<properties>
<property>
<name>usedefaultlisteners</name>
<value>false</value> <!-- disabling default listeners is optional -->
</property>
<property>
<name>listener</name>
<value>org.uncommons.reportng.HTMLReporter, org.uncommons.reportng.JUnitXMLReporter, org.testng.reporters.XMLReporter</value>
</property>
</properties>
<additionalClasspathElements>
<additionalClasspathElement>${basedir}/src/test/conf</additionalClasspathElement>
<additionalClasspathElement>${basedir}/src/test/testdata</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
업데이트 : 아래 솔루션을 기반으로 내 작업 구성을 변경하고 아래 이미지에 따라 실패 대신 성공을 얻을 수있었습니다.
첨부 한 스크린 샷의 오류는 아티팩트 ID "pswtf-test-tp-pc"가 로컬 Maven 저장소에서 종속성을 찾을 수 없음을 의미합니다.
Maven <modules>
태그를 사용하여 상위 POM에서 모든 프로젝트를 빌드하십시오 . 아티팩트 ID가 PSWebTestFramework 인 상위 폴더의 pom.xml에 추가합니다. 이 부모 pom을 먼저 실행 한 다음 프로젝트에서 실행하십시오-pswtf-test-tp-pc
<modules>
<module>pswtf-application-core</module>
<module>pswtf-test-core</module>
<module>pswtf-test-tp-core</module>
<module>pswtf-application-tp-pc</module>
</modules>
이것은 각 모듈을 빌드하고 로컬 maven repo에 설치해야합니다.
추신- mvn clean install
명령을 사용하여 로컬 저장소에 종속성을 설치하십시오.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다