user2636208
user2636208

Reputation: 121

Intellij: Setting Remote host Mappings: Local path is out of project

I am using Intellij IDea ultimate 15.

I want to compile/test/deploy on a remote host. So this is what I did: 1. File -> New -> Project -> Empty Project -> Specify project name/location

  1. Preferences -> Deployment -> add host(Test SFTP connection successfully)
  2. Modify mappings: set the Local path to the same as project location

Then it complains:

Local Path '[my local path]' is out of project

The path is the project location that I set to, it exists, and I have the right permission. So don't know why it complains.

Thanks for your time!

Upvotes: 11

Views: 10199

Answers (10)

Nate
Nate

Reputation: 1273

I'm currently on PyCharm 2021.3 and ran into this issue.

Arno's solution is the closest, but perhaps outdated. In the current interface/GUI the steps are:

  1. Open Preferences
  2. Go to Project: <YOUR_PROJ_NAME>, then Project Structure
  3. Click the Add Content Root
  4. Navigate to your project's root directory and Open it

That should be it. It seems insane that you would need to do this, since you already did this when you opened the project. But, this is the solution.

Upvotes: 0

feng1o
feng1o

Reputation: 41

make sure

"the local path:" ()

is sub dir of your goland IDE current opened project dir.

if you opened a project, but config the local path with a new dir, this error occur

Upvotes: 0

Zuko
Zuko

Reputation: 367

I used PHP Storm since 2013 and now still using then i were faced this issue many many times.

The problem is in your ".idea" directory. There're corupted "modules.xml" and "projectname.iml".

Solution: copy these files from other project, or just delete the .idea directory.

Please note after you copied from other project you need to rename current project, reconfig langagues & frameworks settings. It's stand-alone depend every project, it's does not have same contents normally

Upvotes: 0

Snidhi Dev
Snidhi Dev

Reputation: 1

In my case, with pycharm 2019.2 on Linux, the situation was that the project was opened in pycharm via a link (shortcut) in my home directory.

In Deployment Mapping, specifying the actual path (with the link path resolved) of a sub-directory within the project resulted in this error("Local path is out of project").

Supplying the unresolved path following the link(as used to open the project) resolved the issue.

The problem, it appears, is that the IDE simply checks if the local path specified in Deployment Mapping has the project root path as it's prefix (as a string; without the links/shortcuts being resolved to their actual paths).

By the way, the Deployment option in the context menu for the project sub-folder also remained disabled (greyed out) until this issue got resolved.

Upvotes: 0

Billy
Billy

Reputation: 751

I have just come across this problem. And I resolved it with restart the Intellij-IDE. And it works.....

Upvotes: 1

tychen
tychen

Reputation: 49

I just had the same problem: Preferences --> Directories --> choose your project directory from the Directory list --> in the Mark as pane, click +Add Content Root. Worked for me.

Upvotes: 0

Nikolay Ivanov
Nikolay Ivanov

Reputation: 431

Check if the folder you want to exclude is not excluded from the project under Settings->Directories

Upvotes: 5

Alph Soldner-Raue
Alph Soldner-Raue

Reputation: 41

Configure your Projectdeployments and save this. Pay attention to correct paths! Then open "Directories" in the "Settings". Mark the baseline of your project as "Resource root" (required) and the other folders (as example - adjust to the project) as Sources. Apply and the problem is solved.

Upvotes: 3

Arno Nimbus
Arno Nimbus

Reputation: 11

In Project Settings (via File -> Project Structure) assign your local project path as a new module path. On apply your subdirectories will be included in the Project Structure.

Upvotes: 1

BelgishChoko
BelgishChoko

Reputation: 393

I have just now done hit this problem myself, and came up with a solution. The problem is that in an empty project, if you open the project tree, you will see that there are no directories in your project.

If you open a "static web page" project, for example, you will notice that the directory is now a part of your project.

try doing the same thing, but in a "static web" project and the error will not occur any more

Upvotes: 7

Related Questions