Inter-module dependencies in External System integrations

I'm working on an External System integration. I have some questions about importing multi-module projects.

Edit: I have simplified the question

Imagine I have a project A and a project B. The user has linked both of these projects explicitly. I would like to create a dependency between them, say because project B represents artifact foo:bar:1.0.0 and project A has a dependency on that artifact. The maven integration will detect this case and create a module dependency rather than a library, which is really useful for editing. My leiningen integration does this too, but it pre-dates the External System API and doesn't use it either.
 
In this case, I can't see a way to do this, because resolveProjectInfo() will be called twice, once for each linked project. When it's called I have no access to wider project context, so when project A is resolved there's no way to know that there's a project B representing that artifact.

 

2
3 comments
Avatar
Vladislav Soroka

There is an experimental support of the dependency substitution from separate linked project modules. It is disabled by default. You can try it using the `external.system.substitute.library.dependencies` registry key.

The extension point here is `com.intellij.openapi.externalSystem.service.project.ExternalProjectsWorkspaceImpl.Contributor`.

Currently the `org.jetbrains.idea.maven.importing.MavenWorkspaceContributor` and `org.jetbrains.plugins.gradle.service.project.GradleWorkspaceContributor` used for <gradle> <=> <gradle> and <gradle> <=> <maven> module library dependencies substitution.

0

Thanks Vladislav. I played around with it after enabling the registry key, but I couldn't get it to work. It works well with Maven as expected, but I couldn't get Gradle to substitute the deps either for a Gradle module or a Maven one.

Do you have an idea about when this might be fully developed and available? This basically blocks me from using the External System API as it stands.

1
Avatar
Vladislav Soroka

There is no exact ETA about the feature. It depends on the community interest and feedback like yours.

Could you share your sample IDE project with maven/gradle modules with not working substitutions?

2

Please sign in to leave a comment.