Closed radek-svanda-elder closed 3 years ago
I am also running into this issue with our multi-module project. I don't want 'dependency:go-offline' to be forced with no way to turn it off.
Investigating
A PR has been opened to resolve this issue. Please feel free to leave a review.
@KyleTryon Thanks for looking into this issue.
I guess the proposal in #6 will let me use mentioned go-offline-maven-plugin
as they suggest in their example for Gitlab.
That is good enough for me.
any update on this?
How about autodetecting whether the (root) pom contains modules, and skip the whole offline approach?
The issue here is that maven does not correctly detect that some of the dependencies reference other modules that are part of the project.
Luckily, this issue has already been fixed in the Maven dependency plugin version 3.1.2.
CircleCI users keep running into this issue because the maven-dependency plugin defaults to version 2.8 since it is defined in the super pom.
To solve this, I propose using a fixed version of the maven dependency plugin in the maven orb. I have made the following PR for it: #17
As a temporary workaround, you can also put this in your pom to pin the plugin version:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
Orb Version 1.0.0
Describe the bug
Fetching dependencies in commands/with_cache.yml will fail for multi-module maven project because the maven goal
dependency:go-offline
does not work well with modules.With the attached project, the step Install dependenies will end with
To Reproduce
Use this job with project attached
And see the logs.
Expected behavior
There are several solutions for this, depending on your project priorities:
de.qaware.maven:go-offline-maven-plugin:resolve-dependencies
, see https://github.com/qaware/go-offline-maven-plugindependency:go-offline
withcompile
task. This may be a limitation for some buildsdependency:go-offline
completely because definedsteps
are executed beforesave_cache
and they will download dependencies anywayAdditional context
There is a possible workaround using
maven_command: mvn compile
Attachments
project.zip