Intellij not connecting to settings.xml file
Answered
Hi Team ,
I have my maven projects in Intellij . When i am doing maven build using command prompt i can see the build successfull. But when i try to run individual java class it is not working because intellij is saying as 'Access is denied ' for settings.xml.
I can also check in the intellij project structure that Libraries is missing.
If some can sugggests . I tried with all possible options but it didnt worked !!
Thanks in advance !!
Please sign in to leave a comment.
Try configuring a different location for the settings file: Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | User settings file.
If the issue persists, please share the error screenshot and the logs via Help | Collect Logs and Diagnostic Data at https://uploads.jetbrains.com.
Hi Serge Baranov ,
Thanks for the reply.
I have tried changing the location of settings.xml file and even tried with changing permissions on the folders too. But it is not working. I have attached the logs and screenshot @ below ID :
Upload ID : 2021_03_11_Eo7sM8ZsNB2Y1KSs
On the contrary more strange is that when i tries maven commands in terminal it is working well.
But in the intellij as shown in screenshot it can't connect to settings.xml and cannot load libraries.
Thanks !!!
Do you actually have C:\Users\<user>\.m2\settings.xml file on the disk?
Does it help if you backup and delete it?
HI Serge ,
Yes i do have settings.xml file in the specified location.
I tried deleting and putting the file back to its locations but it also didn't worked !!!
Please try with antivirus and firewall disabled or make sure that IDE settings directories IDE installation home, IDE executable are excluded from the scan.
Try restarting the PC.
Hey Andrey ,
I tried with disabling firewall and antivirus . Still it is getting the same access denied error !!!
Even trying with settings.xml in different drive (D) is also throwing the same access error.
There are two possible causes:
1. Either this is a permission issue: the file is not accessible for reading for the user who runs the IDE;
2. Or some process on your OS is locking the IDE Maven process which is trying to read the file.
1 - double check the file and the directory have read permissions for the user who runs the IDE
2 - find which process is locking the file. For this you can launch Process Explorer and examine if there are any processes that lock this file, see How to Identify which Windows Process is Locking a File or Folder for the steps.
Hi Andrey ,
I checked in the process explorer for both settings.xml file and the intellij too but i dont found any process locking.
I would request if we can have webex session or teams call.
I am really stuck because of that despite of trying installing and uninstalling intellij and jdk couple of times but nothing really helped out !!!
Hello,
Have you tried to run IDE as administrator? Do you use the same maven in IDE and Command Line?
What AV software do you use?
Yes i have tried to run Intellij as administrator . Also i am having the single maven installation on my machine !!!
Any more suggestions team !!!
Please attach screenshot from "File | Settings | Build, Execution, Deployment | Build Tools | Maven". What AV software do you use?
I am using just the Windows security feature.
Also please find below the screenshot requested !!
According to the settings default "settings.xml" file from drive C should be used. Did you overwrite it somewhere (in error message it looks for xml file on drive D)? Also please try to set maven home path to path that is used in command line.
Yeah the settings.xml file is configured as below
I was trying with different paths to check for it of access error.
Also the maven_home is also configured in system variables.
Please share the screenshots showing the permissions of the settings.xml file including the Advanced section like these:
Is kpn.com the correct owner of the file? Does the user you are running IntelliJ IDEA from has access to this file according to the displayed permissions?
Owner of the file is sharm532 ( that is my user)
Also I am running intellij using the same user !!!
What antivirus vendor/version do you use?
I am just using windows 10 pro security virus and threat protection !!
Do you get any errors in IntelliJ IDEA if you completely delete this file? Note that it's optional and Maven can work without it.
What's the error with this file removed?
If I remove the settings.xml file completely and retstarting the intellij , then intellij is connecting to maven repositories and not my organizantion artifcatory ( as defined in settings.xml)
Hence eventually my Intellij is failing with an dependencies missing error
Please try the following with settings.xml file removed. Open Terminal tool window in IntelliJ IDEA and type this command to create a new empty settings.xml file (assuming cmd.exe is your shell):
Then open this file and copy/paste the contents of your original settings.xml file.
Do you still get the Access Denied error after the steps above?
Hey Serge
I re-created the file using the same way from intellij.
Everything works fine.
I was really struggly with that nuissance since last 1 month
Thanks a lot , really appreciated !!!
It would be interesting to see the same Advanced permissions of this file now after it was created via IntelliJ IDEA to find out what's different.
Strangely it is still showing the owner on my user id (sharm532)
Really weird, probably some bug/corrupted permissions in the NTFS security descriptors. Maybe chkdsk could also fix it.