0

Hello I am working on a Maven project that requires me to enable "Resolve Workspace Artifacts" at the time of Maven Build operation. Without which I get build failure as certain dependencies are not resolved.
From this link I understand what "Resolve Workspace Artifacts" does. To give background: I am starting fresh, with nothing in my local m2 repo. I am cloning a project from Git Lab and while the "mvn clean install" is being run I enable "Resovle Workspace Artifacts".
This is a multi-module maven project.

I want to understand...
1. If this OK (Maven project defined such that it requires us to enable "Resolve Workspace Artifacts")?
2. Could this issue have arised due to incorrect/bad design of Maven project dependencies?
3. If left as it is will there be any issues if I plan towards CI-CD phase?

This is a Spring Boot web project

  • The question is: Does projects which needs the workspace resolution use other projects which are imported as eclipse projects which are project which are not part of the multi module ? – khmarbaise Nov 07 '19 at 11:44
  • My projects does not depend on eclipse projects but it is dependent on few of my project itself (multi mode project). The multi mode project is the final product. – mrunalini pujar Nov 08 '19 at 04:59
  • It sounds if your projects should be combined into a multi module build to have them under one umbrella. This makes it easier to import and develop on such project and it will be versionized within a single git repository... – khmarbaise Nov 08 '19 at 19:21

1 Answers1

1
  1. Ideally it should be avoided, but it helps and may be faster if you are concurrently developing multiple projects that are in your workspace, but for whatever reason can't already be installed in a resolvable repo. But really you could just run mvn install on those dependencies to at least get them into your local repo. Though I can see how that might be a 'step too many' when you're just messing around with the code and want to iterate quickly (on the other hand why would you do a full maven build then).

  2. Perhaps for some reason you haven't pushed/installed another one of your own projects, but that the one with the issue is depending on. Without it being in the local or remote publicly resolvable repo, there is no way for maven to resolve it without "Resolve Workspace Artifacts". But yes, it could be an issue with your dependency tree - difficult to assess without your pom.

  3. No issue as long as the CI/CD server can fetch the missing dependencies.

If the missing dependencies are hosted in a private repository, the likely solution is to add a <repository> entry in your pom.

Thomas Timbul
  • 1,634
  • 6
  • 14
  • thanks for the response. Is the "Resolve Workspace Artifacts" a feature in IDE or Do we have equivalent feature in pure maven commands? My guess is maven does not have this feature. If this feature is not available in maven then my guess would be that in CI/CD phase we might face issues – mrunalini pujar Nov 08 '19 at 05:56
  • No, Maven itself does not have this feature, it is a feature of the Eclipse m2 plugin. The CI/CD server won't even have a concept of your local workspace. – Thomas Timbul Nov 08 '19 at 11:07