3

I have 2 maven projects in my workspace. They are not a multi-module project, but two separate ones. In one project, I reference the other as a dependency. I have workspace resolution turned on, but it tries to go out to the repository to find it. I've tried deleting an reimporting both projects with no luck, and I'm using the latest version of m2eclipse (0.12.1). I am under the impression that this should work, but does not - any thoughts why?

Edit: The relevant sections of the poms looks like

Project A

<project>
 <groupId>my.company</groupId>
 <artifactId>project</artifactId>
 <version>1.0-SNAPSHOT</version>
 <name>my project</name>
</project>

Project B

<dependencies>
  <dependency>
    <groupId>my.company</groupId>
    <artifactId>project</artifactId>
    <version>1.0-SNAPSHOT</version>
  </dependency>
</dependencies>

enter image description here

Jeff Storey
  • 56,312
  • 72
  • 233
  • 406

3 Answers3

1

If a project is configured to resolve dependencies from the workspace, these artifacts do not need to be present in your local repository. Assume that project-a and project-b are both in the same MyEclipse workspace, and that project-a depends on project-b . If workspace resolution is disabled, the Maven build for project-a will only succeed if project-b ‘s artifact is present in the local repository. If workspace resolution is enabled, Maven will resolve the dependency via the MyEclipse workspace.

Enabling the workspace resolution is convenient if you are working on several projects at the same time in the same workspace that have compile dependencies among each other and you don’t want to mvn install one project in order for your changes to be visible to the other project.

Hope this helps. Let us know if you have any questions.

–Swapna MyEclipse Support

0

Looks like you have an old version of m2eclipse - as Guillaume Polet mentioned, the latest version of the m2eclipse plugin is 1.0 something.

The easiest way to get the latest version is to open the eclipse marketplace, search for 'Maven' and install the 'Maven Integration plugin' (and possibly the WTP plugin as well, since you seem to be using that).

Robert Johnson
  • 632
  • 6
  • 25
0

In Eclipse 2022-09 using m2e 2.0.5 this is the Checkbox "Resolve Workspace artifacts" in maven run dialog.

B_St
  • 180
  • 2
  • 9