Goland connection server/virtual machine remote compilation development

Create SSH connection

SSH is used to establish a connection with a remote server

Settings -> Tools -> SSH Configurations
Add a new ssh connection, Host is the ip address, Username is the username, and the authentication method is password verification
After filling in everything, you can click Test Connection to test whether the connection is successful
Insert image description here

CreateDeployment

Deployment is used to build path mapping between local and remote servers

Settings -> Build,Execution,Deployment -> Deployment
Add a new Deployment, select SFTP for Type, and select the SSH connection just configured for SSH. The root directory and URL are as shown in the figure. As shown
Insert image description here
select Mappings to set path mapping. Local path is the local directory of the project, and Deployed path is the directory on the remote server
Insert image description here
Upload local files to the server< /span>
Insert image description here
Set the file to be uploaded to the server every time it is saved, and the server file will be deleted simultaneously when the local file is deleted
Insert image description here

Compile using server environment

Sometimes our local environment is inconsistent with the server, causing the project to fail to run locally. After configuring the above steps, it can be modified to compile on the server.

In Run/Debug Configurations, set Run on to the server for ssh connection and check Build on remote target.
Insert image description here

Supongo que te gusta

Origin blog.csdn.net/shn111/article/details/134118330
Recomendado
Clasificación