2017-07-14 77 views
0

我想使用TestNG配置Maven項目獲得Browserstack自動化報告內詹金斯建立以下官方手冊https://www.browserstack.com/automate/jenkins編譯錯誤收集內部詹金斯browserstack報告

完整的日誌在這裏https://codeshare.io/2KgwqX

但我得到的錯誤:

[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project xxx: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: multiple points -> [Help 1] 

我的POM文件看起來像

<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> 
<groupId>com.xxx</groupId> 
<artifactId>xxx</artifactId> 
<version>4.0.0</version> 
<packaging>jar</packaging> 

<properties> 
    <jdk.source.version>1.8.0_131</jdk.source.version> 
    <jdk.target.version>1.8.0_131</jdk.target.version> 
</properties> 

<repositories> 
    <repository> 
     <id>sonatype-nexus-snapshots</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots</url> 
    </repository> 
</repositories> 

<pluginRepositories> 
    <pluginRepository> 
     <id>sonatype-nexus-snapshots</id> 
     <url>https://oss.sonatype.org/content/repositories/snapshots</url> 
    </pluginRepository> 
</pluginRepositories> 

<dependencies> 
    <dependency> 
     <groupId>com.browserstack</groupId> 
     <artifactId>automate-testassist</artifactId> 
     <version>0.7.2-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>org.testng</groupId> 
     <artifactId>testng</artifactId> 
     <version>6.11</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.mail</groupId> 
     <artifactId>mail</artifactId> 
     <version>1.5.0-b01</version> 
    </dependency> 
    <dependency> 
     <groupId>org.seleniumhq.selenium</groupId> 
     <artifactId>selenium-java</artifactId> 
     <version>3.4.0</version> 
    </dependency> 
    <dependency> 
     <groupId>com.google.code.gson</groupId> 
     <artifactId>gson</artifactId> 
     <version>2.8.1</version> 
    </dependency> 
    <dependency> 
     <groupId>com.dev9</groupId> 
     <artifactId>webdriver-utils</artifactId> 
     <version>1.6</version> 
    </dependency> 
    <dependency> 
     <groupId>com.codeborne</groupId> 
     <artifactId>selenide</artifactId> 
     <version>4.5.1</version> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-api</artifactId> 
     <version>1.7.22</version> 
    </dependency> 
    <dependency> 
     <groupId>org.slf4j</groupId> 
     <artifactId>slf4j-simple</artifactId> 
     <version>1.7.22</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-api</artifactId> 
     <version>2.8.2</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.logging.log4j</groupId> 
     <artifactId>log4j-core</artifactId> 
     <version>2.8.2</version> 
    </dependency> 
    <dependency> 
     <groupId>com.fasterxml.jackson.core</groupId> 
     <artifactId>jackson-databind</artifactId> 
     <version>2.9.0.pr4</version> 
    </dependency> 
</dependencies> 
<build> 
    <resources> 
     <resource> 
      <directory>src/main/resources</directory> 
      <filtering>true</filtering> 
     </resource> 
    </resources> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-resources-plugin</artifactId> 
      <version>2.7</version> 
      <configuration> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-surefire-plugin</artifactId> 
      <version>2.18.1</version> 
      <configuration> 
       <suiteXmlFiles> 
        <suiteXmlFile>${suitexml.file}</suiteXmlFile> 
       </suiteXmlFiles> 
       <systemPropertyVariables> 
        <profileId>${profileId}</profileId> 
        <config>${config}</config> 
       </systemPropertyVariables> 
      </configuration> 
     </plugin> 
     <plugin> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.3</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 

     <plugin> 
      <groupId>com.browserstack</groupId> 
      <artifactId>automate-maven-plugin</artifactId> 
      <version>0.7.2-SNAPSHOT</version> 
      <configuration> 
       <source>${jdk.source.version}</source> 
       <target>${jdk.target.version}</target> 
       <complianceLevel>${jdk.source.version}</complianceLevel> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>test-compile</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 


    </plugins> 
</build> 
<!-- profiles --> 
<profiles> 
    <!--profile> 
     <id>allow-snapshots</id> 
     <activation> 
      <activeByDefault>true</activeByDefault> 
     </activation> 
     <repositories> 
      <repository> 
       <id>snapshots-repo</id> 
       <url>https://oss.sonatype.org/content/repositories/snapshots</url> 
       <releases> 
        <enabled>false</enabled> 
       </releases> 
       <snapshots> 
        <enabled>true</enabled> 
       </snapshots> 
      </repository> 
     </repositories> 
    </profile--> 
    <profile> 
     <activation> 
      <activeByDefault>true</activeByDefault> 
     </activation> 
     <id>local</id> 
     <properties> 
      <profileId>local</profileId> 
      <suitexml.file>src/test/resources/testng.local.xml</suitexml.file> 
      <dataCollector>s16</dataCollector> 
      <scriptFile>xxx</scriptFile> 
      <pjID>xxx</pjID> 
      <environment></environment> 
      <config>local.conf.json</config> 
     </properties> 
    </profile> 
    <profile> 
     <id>dev</id> 
     <properties> 
      <profileId>dev</profileId> 
      <dataCollector>s16</dataCollector> 
      <scriptFile>xxx</scriptFile> 
      <pjID>xxx</pjID> 
      <suitexml.file>src/test/resources/testng.xml</suitexml.file> 
      <environment></environment> 
      <config>parallel.conf.json</config> 
     </properties> 
    </profile> 
    <profile> 
     <id>staging</id> 
     <properties> 
      <profileId>staging</profileId> 
      <activeByDefault>true</activeByDefault> 
      <dataCollector>s16</dataCollector> 
      <scriptFile>xxx</scriptFile> 
      <pjID>xxx</pjID> 
      <suitexml.file>src/test/resources/testng.xml</suitexml.file> 
      <environment></environment> 
      <config>parallel.conf.json</config> 
     </properties> 
    </profile> 
    <profile> 
     <id>live</id> 
     <properties> 
      <profileId>live</profileId> 
      <dataCollector>s16</dataCollector> 
      <scriptFile>xxx</scriptFile> 
      <pjID>xxx</pjID> 
      <suitexml.file>src/test/resources/testng.xml</suitexml.file> 
      <environment></environment> 
      <config>parallel.conf.json</config> 
     </properties> 
    </profile> 
</profiles> 

全輸出

/usr/lib/jvm/java-8-openjdk-amd64/bin/java -Dmaven.multiModuleProjectDirectory=/home/xxx/repos/selenium-tests/xxx-tests -Dmaven.home=/home/xxx/.local/share/JetBrains/Toolbox/apps/xxx/ch-0/172.3317.53/plugins/maven/lib/maven3 -Dclassworlds.conf=/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/plugins/maven/lib/maven3/bin/m2.conf -javaagent:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/lib/idea_rt.jar=34649:/home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/bin -Dfile.encoding=UTF-8 -classpath /home/xxx/.local/share/JetBrains/Toolbox/apps/IDEA-U/ch-0/172.3317.53/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.2 clean test -Plocal 
[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building xxx 4.0.0 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ xxx --- 
[INFO] Deleting /home/xxx/repos/selenium-tests/xxx-tests/target 
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ xxx --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 2 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ xx --- 
[INFO] Changes detected - recompiling the module! 
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! 
[INFO] Compiling 9 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/classes 
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java uses unchecked or unsafe operations. 
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/main/java/webdriver/WebDriverFactory.java: Recompile with -Xlint:unchecked for details. 
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ xxx --- 
[INFO] Using 'UTF-8' encoding to copy filtered resources. 
[INFO] Copying 4 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ xxx --- 
[INFO] Changes detected - recompiling the module! 
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent! 
[INFO] Compiling 13 source files to /home/xxx/repos/selenium-tests/xxx-tests/target/test-classes 
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Some input files use unchecked or unsafe operations. 
[INFO] /home/xxx/repos/selenium-tests/xxx-tests/src/test/java/com/xxx/TestNgTestBase.java: Recompile with -Xlint:unchecked for details. 
[INFO] 
[INFO] --- automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) @ xxx --- 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 2.969 s 
[INFO] Finished at: 2017-07-14T16:47:29+02:00 
[INFO] Final Memory: 30M/471M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile (default) on project xxx: Execution default of goal com.browserstack:automate-maven-plugin:0.7.2-SNAPSHOT:test-compile failed: multiple points -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 

Process finished with exit code 1 

回答

0

的問題只是在Java版本字符串,我已經更改爲

<properties> 
    <jdk.source.version>1.8</jdk.source.version> 
    <jdk.target.version>1.8</jdk.target.version> 
</properties>