Jenkins 构建过程常见错误
1.找不到分支
ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job. Finished: FAILURE
分析:Jenkins默认是 */master;如果你的主分支是 main,请改为 */main 或者你也可以指定其他存在的分支名,比如 */dev
重新构建成功!检查jenkins 工作目录:
cd /var/lib/jenkins/workspace/
2. Maven 本地仓库地址,没有写权限:
[WARNING] Failed to create tracking file parent '/usr/local/share/repo/org/apiguardian/apiguardian-api/1.1.0/apiguardian-api-1.1.0.pom.lastUpdated' java.nio.file.AccessDeniedException: /usr/local/share/repo/org/apiguardian/apiguardian-api/1.1.0
找到自己配置的本地仓库地址,加上写读权限
3. 非交互shell 环境变量无法正确获取:
4. 推送jar包 路径配错,一直推送不过去: