我正试图将我的 springboot
教程项目与 CircleCi 集成。
我的项目在 Github 存储库的子目录中,但是我从 CircleCi 得到了以下错误:
需要一个项目来执行目标,但此目录中没有 POM (/home/circleci/recipe)。请验证您是否从正确的目录调用了 Maven。
我无法弄清楚如何告诉 Circle-Ci 我的项目在子目录中。 我尝试了几种方法,包括尝试在“recipe”内部使用 cd
命令,但都不起作用或者感觉不对。
这是我的项目结构:
Spring-tutorials
|
+-- projectA
|
+-- recipe
| | +--pom.xml
这是我的config.yml
文件
# Java Maven CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/recipe
environment:
# Customize the JVM maximum heap limit
MAVEN_OPTS: -Xmx3200m
steps:
- checkout
- run: cd recipe/; ls -la; pwd;
# Download and cache dependencies
- restore_cache:
keys:
- recipe-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- recipe-
- run: cd recipe; mvn dependency:go-offline
- save_cache:
paths:
- ~/recipe/.m2
key: recipe-{{ checksum "pom.xml" }}
# run tests!
- run: mvn integration-test
指定步骤运行的目录。
而checkout是从Git仓库签出源代码。 - Kevin Amiranoffworking_directory: ~/spring-tutorial/recipe
会创建两个目录,导致检出失败,因为recipe
已经存在。 - simpleuser