Force intellij to regenerate .iml files for a maven project with multiple modules - maven

I'm working with a maven project composed of multiple modules. Currently apart from the parent module, all the other modules don't have a .iml file. This cause problems each time I close and reopen intellij as
I have to reimport (with maven) the whole Project for intellij to work properly again. Otherwise I don't have any code completion, Intellij can't resolve dependancies and so on.
I tried to reimport each submodules as well as reimporting the whole project from scratch but it didn't make Intellij to regenerate the .iml files.
Is there a way to force Intellij to regenerate .iml files ?
I'm working with intellij idea: 2019.2.3 (Ultimate Edition)
Build #IU-192.6817.14, built on September 24, 2019
Intellij Maven import settings

Had the same issue and was not able to find any way for IntelliJ to regenerate the files. It seems to be due to such files being added on .gitignore - seems IntelliJ won't create it then, at least in some use cases.
However, *.iml files are really simple and it it easy enough to copy from some working module and edit it if needed. For my case, just copying and renaming correctly was enough.
Deleting and recreating the workspace would've probably also worked.

Related

Generate mule_export.properties with Maven

I'm trying to set up IntelliJ to deploy Mule project that depends on a domain project, but the result builded by Maven does not have META-INF directory and mule_export.properties in it. However, the same build within AnyPoint Studio does produce these artifacts, which make the deployment successful.
Does anyone know how can I force Maven to create these? Either through Maven plugin or IntelliJ associations, as it seems that associations within IDE are the reason this is being produced by AnyPoint Studio.
I'm not sure why do you need the mule_export.properties. It seems to be only generated by Anypoint Studio when exporting a project. However I don't think it is used at all to deploy an application. Probably you are having a different problem. Usually that happens by differences between Maven dependencies and Studio build path.
What is the exact error you are having at deployment?

Azure Build Pipeline: Building solution dependencies fails - can't find packages but building csproj dependency files independently works fine

I have a solution with a bunch of different api's in it which reference different dependencies we built in a utilities folder.
In Azure Devops, when I go to build the solution it complains that it can't find the dependencies of those dependencies and fails. Those dependencies are pointing to the same dependencies of the solution which are a few folders up; so the dependency HintPath is ../../packages as opposed to the solution's dependency HintPath of ./packages
When I build the csproj files independent of the solution (i.e. not building them as a dependency of the solution) they build just fine and find the packages folder with no issue. Nuget Restore reports no issues and we have checked in the packages to source control so there should not be anything missing. Even if there was, Nuget would restore them if they were missing.
So I'm thinking: When I build the solution and it tries to build the dependencies down below, it's trying to access the packages starting at the solution directory and then going up from there (master/../../packages/ instead of utilities/../../packages/). That folder does not exist which would cause it to fail and makes sense as to why the individual builds of the dependencies works.
Has anyone come across this issue before in Azure Dev Ops or has any idea how to fix this?
We could edit the hint paths to point to ./ for the dependencies which has worked but we have a local build we still use for production that doesn't function like that and would break. We're trying to keep these in sync.
Please let me know if you have any ideas.
Thanks
Azure Build Pipeline: Building solution dependencies fails - can't find packages but building csproj dependency files independently works fine
To resolve this issue, you could try to install dependencies of those dependencies to the solution. That because NuGet team deprecated solution level packages in NuGet 3.0:
https://github.com/NuGet/Home/issues/522
So, we need make sure the all the used packages for the solution in the default packages folder ./packages instead of the different packages folder.
If above not help you, you could share your project structure in your question.
Hope this helps.
The solution that worked for me was changing the way NuGet packages were stored in the solution. Instead of using packages.config, there's an option in Visual Studio to use PackageReference which is a new way of referencing packages for NuGet. After switching most of our projects to the new way of using NuGet it was able to run and build.

Module Not in Gradle View [duplicate]

I've a big problem with Android Studio.
I have a project that depends on two other projects (as libs).
I followed the guide Problems importing project into Android Studio regarding ActionBarSherlock for import external modules.
I opened "Project Structure", imported the module, but after that I can't see it in the Modules area.
The Modules area contains only the root module, seems it is not refreshed (this is strange). So if I try to add the module as a Dependency, Android Studio doesn't find any module!
Then, if I try to re-import the module, it says that the module/project is already registered!!
Maybe I'm missing something, but I don't know what....! I have this problem both on Windows and MacOSX.
Thanks in advance,
Federico
Look around in your .idea directory for mentions of the problematic project. I had the same problem and resolved it by deleting the entry from .idea/sbt.xml.
In ij go to menu: View -> Tool Windows-> Gradle
Right click on the problematic module and click Refresh External Project, You should see the module in project explorer.
I had a similar problem with ABS and other library imports. The 'Project Structure' interface just wouldn't show the modules. On trying to import the modules, it would prompt, "The project is already registered". Seems to be an IntelliJ/Android Studio issue. Invalidate Caches option didn't help.
Reimporting the project after some cleanup did work for me.
As a precaution, take a backup of your project and store it safely
Ensure that your project builds via gradle command-line and you have all required dependencies specified in respective build.gradle files. Try building with: gradle clean && gradle build
Close the project in Android Studio (or close Android Studio)
Delete .iml files and .idea folders from all modules and the main project
Start Android Studio and reimport the project (Import project from external model > Gradle)
you should remove the project from respective gradle/sbt/maven/ant tab (used to be on right vertical line of Android Studio/Intellij IDEA)
See this answer: https://stackoverflow.com/a/30442195/907576
My issue was fixed when I restart IDEA.

Netbeans project specific settings resetting

I am having a problem with my project specific settings resetting while I am working.
I am trying to configure my project to use the IDE wide formatting configurations, but after a small while the settings for the project are reset to use the default project specific settings.
I assume this is related to automatic build in the background doing something that is removing the project configuration file but I haven't found out anything more related to that.
Other points to note:
The project is huge
The project is maven configured
I am the only one working in netbeans that I am aware of
The Project has a parent maven project which I also have open in the IDE
The Project is in a Git repository which I believe I have set up to ignore Netbeans config files.

debugging dependent projects in visual studio

Sorry about the newbie question but I could not find an answer anywhere: I have a Visual Studio 2010 project (C#) with several dependencies on other projects in the same solution. When I debug the project and try to step into code in one of the dependencies, it steps over instead. Also, it seems that it is using a previous, installed version of the dependency instead of using the one in the solution.
How can I make it use the one in the solution and allow step-into?
Figured it out.
The dependencies' compiled versions were installed in the GAC - needed to take them out first.
Needed to turn on Tools->Options->Debugging->General->Enable Just My Code.
Needed to set Copy Local to True for each dependency in the target project.
Like everyone here pointed out, needed to re-build all dependencies first, in Debug mode.
Thanks everyone for your help!
When you add the projects as references, add them using the "projects" tab (of the "add references" dialog) instead of adding them as binary DLLs.
A project's output is only copied to the referencing project's bin folder if the dependent project is build. If the project is used in more than one solution, it may have been compiled previously but it won't update projects in the open solution. If the source is unchanged relative to the binary files, then the project is not compiled and the bin folder is not updated. Use Rebuild or Clean after opening the solution to ensure the projects are in sync.
Also check in Configuration Manager that all the projects have a Build checked.

Resources