= Compiling using ​IntelliJ IDEA = [[PageOutline(2-4,Table of Contents)]] This describes how to develop and [wiki:DevelopersGuide/Compiling compile] JOSM using [https://www.jetbrains.com/idea/ IntelliJ IDEA]. == Requirements == - JOSM's [[Source code]] - IntelliJ itself https://www.jetbrains.com/idea/ - IvyIDEA plugin https://plugins.jetbrains.com/plugin/3612-ivyidea - Note: Running with coverage requires an out-of-tree patch. See [comment:4:ticket:22615 #22615]. == Guide == - Add project from existing source - If it doesn't work or stalling: press `Ctrl+Shift+A` and type in the search box `project from existing sources`. It will give you all the configuration option, as in earlier IntelliJ versions (≤2019.3). See IntelliJ [[https://www.jetbrains.com/help/idea/2020.2/import-project-or-module-wizard.html#import-project|documentation]] for more info. - Project Settings / Project: [[BR]][[Image(79651115-9491d080-81b1-11ea-9a48-99de65830f53.png, 400)]] - Project Settings / Modules: [[BR]][[Image(79651289-a1aebf80-81b1-11ea-99ba-36bce549824a.png, 400)]] - Project Settings / Modules: add+configure IvyIDEA [[BR]][[Image(79651643-bc813400-81b1-11ea-9f8e-c2eeb68b160c.png, 400)]] [[Image(79651825-ca36b980-81b1-11ea-9a8d-77f98fcdce8f.png, 400)]] - Tools / Ivy / Resolve for All Modules: [[BR]][[Image(79653664-534df080-81b2-11ea-84bf-0bf5dbc54319.png, 400)]] - Configure Ant: [[BR]][[Image(79652490-fb16ee80-81b1-11ea-844a-97628baa5075.png, 400)]] - Run the following Ant tasks: [[BR]][[Image(79653168-2f8aaa80-81b2-11ea-9aee-26bfdc6fbd02.png, 400)]] - Run `org.openstreetmap.josm.gui.MainApplication`: [[BR]][[Image(79653367-3d403000-81b2-11ea-968a-5760289826c8.png, 400)]] == Additional settings == This section describes helpful additional settings for IntelliJ IDEA. === Run individual tests without Ant === Some test classes which use Mockito need extra steps to run them in the IDE: 1. Run the `test-init` Ant target 1. Create a run configuration 1. In the run config, add `-javaagent:test/lib/jmockit.jar` JVM parameter === Link ticket references in commit messages === Make ticket references in the code of the form `ticket 1234` or `#1234` clickable as a link to the Trac ticket. 1. Open the `File | Settings | Version Control | Issue Navigation` settings page. [[BR]] [[Image(ticket-integration (1).png, 400)]] 2. Add a new `Issue Navigation` item, with: - `Issue ID`: `(ticket\s*|#)(\d+)` - `Issue link`: `https://josm.openstreetmap.de/ticket/$2` [[BR]] [[Image(ticket-integration (2).png, 400)]] === Search open issues === [[Image(intellij-task-search.png, 400)]] → Tools → Tasks & Contexts → Open Task