Issue while trying to import multiple gradle modules

Answered

 Hello,

We have several gradle projects with the same structure. configuration, service tests as main folders and in tests we have component, integration and performance.

We want to import them in 1 big IntelliJ project to make search and replace and the overview of the used packages easier. The integration with git works marvellous, the different repository roots are all recognised and if we need to push things from different repositories it all works easy with just one commit message to type instead of several. The update of these repos works great as well.

The problem is the recognition of the gradle plugin. It seems that the submodules under the tests folder are interpreted in several ways although the structure of each project is the same. so far we found 3different behaviours. I removed the project names of the screenshot as it is confidential. but please read the red markings as "my-project"

1. The modules are integrated as normal modules called component and integration
 2. The modules are recognised and with the prefix of the module above

3. The submodules are not recognised as such

 

the behaviour that we would wish for is that the submodules are recognised and prefixed with the supermodule and the project name.

EXAMPLE:

my-project
|--- service
|--- tests
         |--- component
         |--- integration

would end up with modules:
* my-project-service
* my-project-tests
* my-project-tests-component
* my-project-tests-integration

we tried to change the names manually and add the missing modules, but that didn't work and as soon as we refreshed the gradle configuration everything was gone agian.

Is there a way to acchieve these structure?

1
23 comments
Avatar
Vladislav Soroka

What IntelliJ version do you use?

0
Avatar
Permanently deleted user

We are using intelliJ 2016.3 but for the multi-project trial we also downloaded the latest version 2017.1

with 2016.3 it didn't work out at all, but with 2017.1 it worked much better, although there are still the issues described above

0
Avatar
Vladislav Soroka

I see, there is still an issue with module names deduplication. However you can try incubating feature of 2017.1.

Steps to setup:

  1. Start IntelliJ 2017.1, enable the project.qualified.module.names property.
    The property is set in registry, e.g. open Registry (Control + Shift + A for Registry), check project.qualified.module.names option, close registry and restart.
  2. Create a new empty IntelliJ project somewhere on your disk (File => New => Project... => Empty Project).
    Note: it's important to use IntelliJ project without other modules
  3. Attach gradle project to the IDE project using module wizard
    (File => New => Module from Existing sources... => Import Module => Gradle)
  4. Repeat step 3 for each of your Gradle multiproject

Does it help?

0
Avatar
Permanently deleted user

I tried the steps after enabling the property but I think the behaviour is even worse now. More like the behaviour of 2016.3

Is there a fix planned for this? It is a very very handy function for us but not really usable at the moment.

As I wrote in my post the chaining of the names in the modules would be best as you can group them easier and if you sort by name every modules that belong together are listed together

0
Avatar
Vladislav Soroka

Hm, the project.qualified.module.names option should normally work for projects like you described.

Could you share the sample to reproduce issues with this option enabled?

0
Avatar
Permanently deleted user

I tried to remove all personalized things in our project, but it is too much effort. basically it has weird behaviour when having duplicate names for the submodules in a project.

0
Avatar
Permanently deleted user

hello, any update on this? You said "I see, there is still an issue with module names deduplication."

Will that be fixed in the next update? Is there any ticket I can monitor?

 

0
Avatar
Vladislav Soroka

I would like to fix related issues using the project.qualified.module.names. I created the sample project based on your description and it works fine.

If that option doesn't work for you, please share the project sample to reproduce it, see my answer at https://youtrack.jetbrains.com/issue/IDEA-159811#comment=27-2121817 

0
Avatar
Permanently deleted user

Thanks, I will try to make a sa,ple project on the weekend. Could you maybe give me the sample project you made where it works? Then I have something to compare.

Thanks

0
Avatar
Permanently deleted user

Hi,

we tried to import your sample project and we have the same behaviour with it as with our project (please see picture)

Could it be that there are some preferences set in a wrong way for it to work?

0
Avatar
Vladislav Soroka

Could you attach dedupTest/.idea/modules.xml file?

0
Avatar
Permanently deleted user
0
Avatar
Vladislav Soroka

You didn't enable the project.qualified.module.names property. To enable it, please follow steps described at https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000171584/comments/115000212964 

0
Avatar
Permanently deleted user

Hello, I did enable the property as shown below:

0
Avatar
Vladislav Soroka

The modules.xml looks like it was created with disabled option.

could you try the following: download my sample once again and open it as an IntelliJ project, ensure the option is enabled and refresh projects using Gradle tool window. Does it help?

0
Avatar
Permanently deleted user

I tried this approach, but it didn't help. I unzipped the project and initialized a git repo in there. then I opened it with intelliJ and committed the changes after that opening. then I clicked refresh and committed everything again, so you can see how the files change during the process.

You can find the project including the git data here: https://drive.google.com/open?id=0B2rQ9dwngWAVLUlNRXJvaW5Tek0

0
Avatar
Permanently deleted user

Edit: I completely removed IntelliJ and all the folder described here: https://www.jetbrains.com/help/idea/2017.1/directories-used-by-intellij-idea-to-store-settings-caches-plugins-and-logs.html

After installing intelliJ2017.1.2 again and setting the property I reimported the project. But there is no change.

0
Avatar
Vladislav Soroka

Sorry for the inconvenience the feature is in incubation stage. May I ask you to try the IDEA 2017.2 EAP? It should be available soon.

0
Avatar
Permanently deleted user

Did my project with the change log help recreating the problem?

Do you have a date when 2017.2 EAP will be released?

0
Avatar
Permanently deleted user

Hi, in 2017.2 EAP the issue seems to be resolved. On the other hand this version is unusable as it gets stuck after importing 3 modules. When will this version be released?

0

> This page lists pre-release builds of IntelliJ IDEA 2017.2, the update we're releasing in Summer of 2017.

0

Please sign in to leave a comment.