Bitbucket和Azure中的构建失败

时间:2019-02-24 11:52:45

标签: azure bitbucket

使用此消息显示Java Maven,我的构建在Azure和Bitbucket中失败

  

无法执行目标   org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile

但是 它在詹金斯以及当地的传球。 请看看我的pom.xml。 还请检查我的yml文件

# This is a sample build configuration for Java (Maven).
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: maven:3.3.9

pipelines:
  default:
    - step:
        caches:
          - maven
        script: # Modify the commands below to build your repository.
          - mvn  -B verify  # -B batch mode makes Maven less verbose


    enter code here
    <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>WebDriverTest1</groupId>
      <artifactId>WebDriverTest1</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <!-- https://mvnrepository.com/artifact/org.testng/testng -->
      <dependencies>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
        <scope>compile</scope>
    </dependency>
    <dependency>                
                <groupId>org.seleniumhq.selenium</groupId>                              
                <artifactId>selenium-java</artifactId>                              
                <version>2.45.0</version>                               
            </dependency>
            <dependency>
        <groupId>io.rest-assured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>3.0.0</version>

    </dependency>
            <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>
     <dependency>               
                 <groupId>junit</groupId>                               
                 <artifactId>junit</artifactId>                             
                 <version>4.12</version>                                

            </dependency>   
            <dependency>                
                 <groupId>com.intuit.karate</groupId>                               
                 <artifactId>karate-junit4</artifactId>                             
                 <version>0.6.1</version>                               

            </dependency>   
                <dependency>                
                 <groupId>com.intuit.karate</groupId>                               
                 <artifactId>karate-apache</artifactId>                             
                 <version>0.6.1</version>                               

            </dependency>   
            <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.5</version>
    </dependency>   
             <dependency>               
                 <groupId>io.cucumber</groupId>                             
                 <artifactId>cucumber-junit</artifactId>                                
                 <version>2.3.1</version>                               

            </dependency>   
    </dependencies>
    <build>
        <pluginManagement>
            <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
            </configuration>
          </plugin>
        </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.21.0</version>
              <inherited>true</inherited>
              <configuration>
              <includes>
                <include>SystemTest.java</include>
              </includes>
            </configuration>
              </plugin>
              </plugins>
                <defaultGoal>install</defaultGoal>
         </build>
    <properties>
        <java.version>1.8.0_171</java.version>
    </properties>

    </project>

1 个答案:

答案 0 :(得分:0)

我遇到了错误: 无法执行目标org.apache.maven.plugins:maven-compiler-plugin 发生这种情况是因为maven无法下载所有依赖项: 无法在org.apache.maven.plugins:maven-compiler-plugin上收集依赖项

对我来说,Azure中的解决方案是编辑Maven任务,在我取消选择的高级部分中 “验证内置的Maven提要”。