IDEA stepped from entry to the pit (1)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/weixin_45505313/article/details/102528352

1. The multi-module program error "Module must not contain source root"

1.1 Description of the problem

When you create a multi-module project in IDEA, often in restructuring projects (such as new or remove modules) reported the following error when, leading to compile the project or identify the source file failed. This is because when the module created some should not belong to the sub-modules file is also created out, IDEA will it recorded in the module configuration xml and iml file , after which despite sub-module coherent file is deleted, but the module configuration file has not been updated, resulting in the occurrence of the problem.
Here Insert Picture Description

1.2 solution

  1. One solution is to search on the Web Click Project Settings in moduls, the right side of the active document interface module structure, resource files and other directories list, delete any directory that is not a sub-project, Measured not solve the problem

  2. IDEA organization module of the folder to save .idea folder under the file entry , handover into the folder found in the following documents. These files are generated by IEDEA little impact on the project source code, it can be deleted directly solve the problem

     staff   160 10 12 10:44 modules/
     staff  1003 10 12 10:26 modules.xml
     staff   688 10 12 10:26 test.iml
    

2. lombok plug-find symbol variable error

2.1 Description of the problem

Build.gradle file in the project configuration lombok dependent on the form , and rely on the list also does introduce depend on, but when the code is compiled using IDEA quoted find symbol variable error

 dependencies {
        compile("org.projectlombok:lombok:1.16.18") {
            force = true
        }
 }

Here Insert Picture Description

2.2 solution

  1. First, ensure that IDEA has been downloaded lombok plug-ins, after checking whether the annotation process to enable IDEA
    Here Insert Picture Description
    Here Insert Picture Description

  2. If none of the above questions, then you should consider a version of the problem gradle. In the high-version environment gradle (4.10.x and above), the Lombok configuration changes, notes will no longer be in the compile classpath process, it is necessary to manually add annotation processor path. Therefore, the final corresponding dependent follows:

     dependencies {
         annotationProcessor 'org.projectlombok:lombok:1.16.18'
         compileOnly 'org.projectlombok:lombok:1.16.18'
         testAnnotationProcessor 'org.projectlombok:lombok:1.16.18'
         testCompileOnly 'org.projectlombok:lombok:1.16.18'
    }
    

3. Shell Configuration environment variable, but the code is not read IDEA

3.1 Description of the problem

RPC framework needs to rely registry URL to service discovery and registration request is forwarded, but use the command in a terminal export SERVICE_DNS_URL = http: // xxxx After setting environment variables, RPC framework does not get normal configuration environment variable, but the use of The default configuration, resulting in calls to other service fails when the local development

3.2 solution

IDEA point in the navigation bar to open a running instance of editing options, click on the Edit Configurations ... to enter the editing interface running configuration, select the target instance, modify the configuration of the running instance, you can add environment variables, VM parameters manually, etc.

IDEA navigation bar:
IDEA navigation

Run the configuration editor interface:Here Insert Picture Description

Guess you like

Origin blog.csdn.net/weixin_45505313/article/details/102528352