我有Drone的本地实例正在运行,我正在尝试构建一些非常简单的Maven项目。它们完全正常,遵循所有惯例。
我正在使用最新的Drone docker镜像(截至今天),并在Rancher环境中设置代理和服务器。本地Gogs实例是Git仓库。
当Drone运行构建时,Maven无法编译测试类,因为它无法找到已编译的源类。它发生在两个不同的项目上,使用以下方法编译没有问题:
只有Drone构建失败了。我很难过。任何人的想法?
这是.drone.yml
pipeline:
build:
image: maven:3.5.0-alpine
commands:
- mvn -B clean package
以下是一些示例输出:
[INFO] Compiling 8 source files to /drone/src/192.168.1.116:10080/timw/springboot-docker-clean/compare/458b3364de013c475723da83162368bacf6ba239...fd89653daf594250d11f8cba004939b7a95199f6/target/classes
109s
836
[INFO]
110s
837
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ springboot-docker-clean ---
110s
838
[INFO] Using 'UTF-8' encoding to copy filtered resources.
110s
839
[INFO] skip non existing resourceDirectory /drone/src/192.168.1.116:10080/timw/springboot-docker-clean/compare/458b3364de013c475723da83162368bacf6ba239...fd89653daf594250d11f8cba004939b7a95199f6/src/test/resources
110s
840
[INFO]
110s
841
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ springboot-docker-clean ---
110s
842
[INFO] Changes detected - recompiling the module!
110s
843
[INFO] Compiling 7 source files to /drone/src/192.168.1.116:10080/timw/springboot-docker-clean/compare/458b3364de013c475723da83162368bacf6ba239...fd89653daf594250d11f8cba004939b7a95199f6/target/test-classes
110s
844
[INFO] -------------------------------------------------------------
112s
845
[ERROR] COMPILATION ERROR :
112s
846
[INFO] -------------------------------------------------------------
112s
847
[ERROR] /drone/src/192.168.1.116:10080/timw/springboot-docker-clean/compare/458b3364de013c475723da83162368bacf6ba239...fd89653daf594250d11f8cba004939b7a95199f6/src/test/java/org/timw/docker/DockerJavaClientTest.java:[31,13] cannot find symbol
112s
848
symbol: class DockerJavaClient
112s
849
location: class org.timw.docker.DockerJavaClientTest
答案 0 :(得分:1)
问题是无人机在工作空间路径中使用您的存储库URL。在您的示例中,存储库URL包含端口名称(冒号),当maven尝试读取文件时,它似乎会导致问题。
/drone/src/192.168.1.116:10080
您可以使用以下语法手动覆盖yaml中的工作空间路径:
workspace:
path: src/timw/springboot-docker-clean
pipeline:
build:
image: maven:3.5.0-alpine
commands:
- mvn -B clean package