Hello,
I’ve just started using CircleCi and spent about 3 hours trying solve this problem.
Context:
I have one maven project with several modules inside. There is core module and other modules depend on it.
Problem:
When running man clean install on parent project only the core module is built successfully. Maven cannot resolve dependency to built core module even though I can see jar in cached .m2 directory:
[ERROR] Failed to execute goal on project webapp: Could not resolve dependencies for project org.automate:webapp:jar:1.1.0: Could not find artifact org.automate:core:jar:1.0.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
How should I configure it in config file to allow maven see a dependency that has been built?
Here is my config file
version: 2
jobs:
build:
working_directory: ~/tmp
docker:
- image: circleci/openjdk:8-jdk-browsers
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "pom.xml" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: mvn clean install
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "pom.xml" }}