Cov txheej txheem:

Kuv yuav ua li cas thiaj ua tau cov lus piav qhia hauv IntelliJ?
Kuv yuav ua li cas thiaj ua tau cov lus piav qhia hauv IntelliJ?

Video: Kuv yuav ua li cas thiaj ua tau cov lus piav qhia hauv IntelliJ?

Video: Kuv yuav ua li cas thiaj ua tau cov lus piav qhia hauv IntelliJ?
Video: Xav rov ntsib koj ib zaug dua. 8/8/2018 2024, Kaum ib hlis
Anonim

Rau configure annotation ua hauv IntelliJ IDEA, siv dialog Preferences > Project Settings > Compiler > Cov txheej txheem piav qhia . Tau txais annotation processors los ntawm qhov project classpath thiab qhia cov ntaub ntawv tso tawm. Tom qab koj ua qhov no, cov chav kawm yuav raug tsim tawm ntawm txhua qhov project tsim.

Ib yam li ntawd, annotation ua IntelliJ yog dab tsi?

IntelliJ IDEA tso cai rau koj mus: Tau txais annotation processors txoj cai los ntawm qhov project classpath, lossis los ntawm qhov chaw teev tseg. Kho cov txheej txheem modules uas yuav tsum tau them los ntawm kev annotation ntawm ib qho profile.

Tsis tas li ntawd, kuv yuav ua li cas thiaj ua tau Lombok? Koj tuaj yeem tshawb xyuas qhov teeb tsa Lombok nrog dab noj hnub thiab IntelliJ, ib tsab xov xwm blog ntawm baeldung.

Ntxiv Lombok IntelliJ plugin ntxiv lombok txhawb rau IntelliJ:

  1. Mus rau Cov Ntaub Ntawv> Chaw> Plugins.
  2. Nyem rau ntawm Browse repositories
  3. Nrhiav Lombok Plugin.
  4. Nyem rau nruab plugin.
  5. Pib dua IntelliJ IDEA.

Hais txog qhov no, kuv yuav ua li cas debug tus annotation processor?

Debugging tus annotation processor nrog IntelliJ IDEA thiab Gradle

  1. chaw nres nkoj = 5005: nias Ctrl + Ua haujlwm + A thiab xaiv Kho kom raug Custom VM Options hauv cov npe ntawm kev ua kom ntxiv qhov kev cai VM xaiv ces rov pib dua IDE.
  2. Tsim ib qho chaw debug configuration nrog default parameters: Khiav -> Kho kom raug Configurations
  3. Teeb cov ntsiab lus.

Kuv yuav ua li cas thiaj pab tau annotations nyob rau hauv dab noj hnub?

3 Teb

  1. Txoj nyem rau ntawm qhov project thiab xaiv Properties.
  2. Qhib Java Compiler -> Annotation Processing. Kos "Enable annotation processing".
  3. Qhib Java Compiler -> Annotation Processing -> Factory Path. Kos "Enable project specific settings". Ntxiv koj cov ntaub ntawv JAR rau hauv daim ntawv.
  4. Ntxuav thiab tsim qhov project.

Pom zoo: