Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support sub-module maven launchers in multi-module sibling-located projects #1523

Open
RichMacDonald opened this issue Aug 24, 2023 · 0 comments

Comments

@RichMacDonald
Copy link

From discussion at #1487, maven launchers seem to be only supported when rooted in the parent module. Launchers in the parent module that reference sub-modules are supported. Launchers in the sub-modules that reference other modules are not supported.

Note: I work with sibling-structure multi-modules only. I am not familiar with the more conventional situation where sub-modules are child folders of the parent module.

The attachment, maven_repo_example.zip, contains three eclipse projects. They should be unzipped "as is", i.e., as sibling folders, then imported into eclipse. The "maven_parent" project is the parent module. "child_1" and "child_2" are sub-module projects.

Run the "maven_parent/parent-compile-success.launch". It performs a "mvn compile" rooted in the maven_parent folder. "Resolve Workspace artifacts" is selected. The operation should succeed.

Run the "child_2/child-compile-failure.launch". It performs a "mvn compile" rooted in the child_2 folder."Resolve Workspace artifacts" is selected. The operation should fail with the following error:

Could not resolve dependencies for project com.groupid.child_2:child_2:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: com.groupid.child_1:child_1:jar:0.0.1-SNAPSHOT (absent): Could not find artifact com.groupid.child_1:child_1:jar:0.0.1-SNAPSHOT

Since a sub-module references its parent, and the parent references all sub-modules, all sibling modules should be locatable in principle. It is desirable that launchers rooted in the sub-module should be able to reference sibling modules.

This is particularly significant because this is how eclipse creates and stores its launchers. If a developer wants to run "mvn test" in a child-module, eclipse will store that launcher in the child-module and it will not work. Only when the same launcher is moved to the parent module (and the child module referenced0 will it work.

maven_repo_example.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant