Skip to content

Latest commit

 

History

History
118 lines (91 loc) · 4.99 KB

intellij.md

File metadata and controls

118 lines (91 loc) · 4.99 KB

Configuration IntelliJ IDEA

📓 IntelliJ IDEA Reference Card by JetBrains

Config personnelle

  • Appearence & Behavior > Appearence
    • Small labels in editor tabs
  • Appearence & Behavior > System Settings > HTTP proxy
    • Cocher Auto-detect proxy settings
  • Editor > General
    • Other : Cocher "Show quick documentation on mouse move"
  • Editor > General > Auto Imports
    • Cocher Java > Optimize imports on the fly
  • Editor > General > Editor Tabs
    • Mark modified tabs with asterik
    • Tab Limit 20 au lieu de 10
  • Editor > Code Style
    • Hard Wrap at : 180 au lieu de 120
  • Editor > Code Style > Java
    • Onglet Import : Class count to use import with * : 250 au lieu de 5 (pour empêcher l'utilisation de ce type d'import)
    • Onglet Import : Names count to use static import with * : 200 au lieu de 3 (pour empêcher l'utilisation de ce type d'import)
    • Onglet Wrapping and Braces section Keep when reformatting : décocher uncheck Line breaks
  • Editor > File Encodings
    • Properties Files : sélectionner ISO-8859-1
  • Editor > Inspections
    • Cocher Java > Serialization issues → Serializable
  • Editor > Natural Languages
    • Grazie est désormais inclu nativement
    • Ajouter le français
  • Build, Execution, Deployment > Compiler > Annotation Processors
    • Cocher Enable annotation processing (pour Lombok par exemple)
  • Roue crantée de la vue project
    • Décocher "Autoscroll to Source" (Empêcher l'ouverture automatique des fichiers dès la sélection)
    • Cocher "Autoscoll from source" (activer le suivi dans la vu explorateur)

🔗 Share settings through a settings repository

Settings Sync

  • Configurer le proxy
  • puis Settings Sync > "Enable Settings Sync..."

Config outils

Configurer le SDK

  • À chaque projet : File > Project Structure > Project Settings > Project > Project SDK.
  • Pour tous les projets : File > Other settings > Structure for New Projects > Project Settings > Project > Project SDK.

Configurer Maven

  • File > Settings > Build, Execution, Deployment > Build Tools > Maven.
  • À chaque projet : File > Project Settings > Build, Execution, Deployment > Build Tools > Maven.
  • Pour tous les projets : File > Other settings > Settings for New Projects > Build, Execution, Deployment > Build Tools > Maven.

Plugins

Junit 5

Ajouter junit-platform-launcher correspondant à la version de JUnit 5 utilisée :

<!-- Junit5 -->
<dependency>
  <groupId>org.junit.jupiter</groupId>
  <artifactId>junit-jupiter-api</artifactId>
  <version>5.4.2</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.junit.platform</groupId>
  <artifactId>junit-platform-launcher</artifactId>
  <version>1.4.2</version>
  <scope>test</scope>
</dependency>

💡 ou vérifier que la connexion réseau (proxy, ..) est OK pour que l'IDE puisse télécharger le nécessaire (jar, ...).

Correspondances Eclipse

 Fonction Raccourci Eclipse Raccourci IntelliJ
Générer System.out.println syso  sout
Structure CTRL+O  CTRL+F12
 Accès à une classe  CTRL+SHIFT+T  CTRL+N
 Accès à un fichier  CTRL+SHIFT+R  CTRL+SHIFT+N
Organiser les imports  CTRL+SHIFT+O CTRL+ALT+O
 Renommer ALT+SHIFT+R  SHIFT+F6

FAQ

Running unit test: Could not find or load main class ${surefireArgLine} / Impossible de trouver la classe @{jacocoUTArgLine}

Décocher argLine dans File > Settings > Build, Execution, Deployment > Build Tools > Maven > Running Tests

Maven+Download Source: Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.1;

Fixed 2021.1

Sinon Build Tools > Maven > Importing > JDK for Importer => sélectionner le même que le projet

java.lang.ClassNotFoundException: kotlinx.coroutines.debug.AgentPremain en DEBUG

Désactiver l'agent "Kotlin Coroutine" (via settings > Build, Exec, Develop.. > Debugger