azure - 在 Bitbucket 和 Azure 中构建失败
问题描述
我的构建在 Azure 和 Bitbucket 中使用 Java Maven 失败并显示此消息
未能执行目标 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>
解决方案
我遇到了错误:无法执行目标 org.apache.maven.plugins:maven-compiler-plugin 并且发生这种情况是因为 maven 无法下载所有依赖项:无法在 org.apache.maven.plugins:maven 收集依赖项-编译器插件
对我来说,Azure 中的解决方案是编辑 maven 任务,在高级部分我取消选择了 'Authenticate built-in Maven feeds' 。
推荐阅读
- flutter - 如何将添加 SSL .cert 添加到 chopper 客户端?
- python - 我想自动化从 PDF 提取数据到 excel 的手动过程
- c# - ASP.NET Core & Swagger:生成多个输出
- swift - 如何正确回退指针(Swift & native)?
- python - python中向量的值显示为nan值
- c# - 按特定属性比较两个列表
- windows - 使用 dll API 通过 hDC 绘制到 QPixmap 非常慢
- spring-boot - DTO 和实体映射
- python-3.x - 从 svs 幻灯片读取补丁的问题
- java - 有没有办法在Java列表中提取列表的类型参数?