This plugin executes run configurations automatically when closing a project or IDE - the mirror feature of IntelliJ's built-in "Startup Tasks".
- Shutdown Tasks Plugin for JetBrains IDE family
- Run any configured run/debug configuration when closing your project
- Tasks are executed in the order you define
- IDE waits for each task to complete
- Configurable timeout per task (1-300 seconds)
- Visual progress dialog with real-time status
- Task output may be visible in Run tool window
- Cancel anytime during execution
- Intuitive configuration panel in Settings β Tools β Shutdown Tasks
- Visual task list with configuration icons
- Add/Edit/Remove and Reorder tasks easily
- Open Settings/Preferences β Plugins
- Search for "Shutdown Tasks"
- Click Install
- Restart IDE
- Download the latest release from Releases
- Open Settings/Preferences β Plugins
- Click βοΈ β Install Plugin from Disk...
- Select the downloaded
.zipfile - Restart IDE
git clone https://github.com/gdw96/shutdown-tasks.git
cd shutdown-tasks
./gradlew buildPlugin-
Open Settings
File β Settings(Windows/Linux)IntelliJ IDEA β Preferences(macOS)- Or press
Ctrl+Alt+S/β+,
-
Navigate to Shutdown Tasks
Tools β Shutdown Tasks
-
Add Tasks
- Click the + button
- Select a run configuration
- Click OK
-
Remove Tasks
- Select a run configuration
- Click the - button
-
Edit Tasks
- Select a run configuration
- Click the π button
-
Reorder Tasks (Optional)
- Select a run configuration
- Use β² / βΌ buttons to change execution order
-
Set Timeout
- Default: 5 seconds per task
- Range: 1-300 seconds
β οΈ Important: The IDE will wait for the total duration of the timeout for each task where it is impossible to monitor execution.
-
Apply Changes
- Click Apply or OK
#!/bin/bash
echo "Stopping development server..."
# Your server stop command here
echo "Server stopped"
exitConfiguration:
- Type: Shell Script
- Script:
stop-server.sh - Interpreter path:
/bin/bash - Execute in the terminal: Unchecked
β οΈ Importantβ οΈ
- Cleanup temporary files after each session
- Stop background services (databases, servers, containers)
- Archive logs or debug information
- Commit/Stash/Push changes automatically
- Trigger builds on project close
- Update documentation automatically
- Close connections to remote servers
- Release file locks or temporary resources
- Stop Docker containers or VMs
- Cleanup memory-intensive processes
Shutdown Tasks configuration is stored in .idea/workspace.xml.
Project Closing (File β Close Project):
- β Tasks executed with the progress dialog visible
- β You can see and cancel execution
- β The IDE waits for tasks until the timeout expires.
IDE Closing (File β Exit or close window):
- β Tasks executed automatically (projects close triggers them)
β οΈ No progress dialog shown (IDE closes immediately)β οΈ Tasks run in background during shutdown- π‘ Tip: Use "Close Project" first if you want to monitor tasks
Recommendation:
- Use
File β Close Projectto see progress
Due to IntelliJ Platform limitations, the plugin cannot reliably detect when a task completes. Or your task may take longer than the timeout.
Therefore:
- Tasks are launched and may be visible in the Run tool window
- The progress dialog waits for the configured timeout
- After timeout, the IDE continues closing
- Tasks execute in sequential order (one after another)
- Failed tasks don't prevent subsequent tasks from running
- Task output may be visible in the Run tool window
- Errors are logged to
idea.log
- β Keep tasks short - Users expect quick shutdown
- β Test your tasks before adding to shutdown
- β Set realistic timeouts - slightly longer than task duration
- β Handle errors gracefully in your scripts
β οΈ Avoid interactive tasks - No user input during shutdown
Problem: Tasks configured but nothing happens on project close.
Solutions:
- Check if tasks are enabled in Settings
- Verify run configurations still exist
β οΈ Please verify that the βShell Scriptβ (or other) tasks do not have the βRun in the terminalβ option selected.- Check
idea.logfor errors (Help β Show Log in Explorer/Finder)
Problem: Task configured but appears to do nothing.
Solutions:
- Test the run configuration manually first
- Check task output in Run tool window
- Make sure that the actions are carried out; the task may not display anything but still works.
- Verify script paths and permissions
- Add error handling to your scripts
Problem: Want to see what tasks are doing.
Solutions:
β οΈ Please verify that the βShell Scriptβ (or other) tasks do not have the βRun in the terminalβ option selected.- Check Run tool window tabs for each task's output
- Β―β \β _β (β γβ )β _β /β Β―
- IntelliJ IDEA 2025.2+ or compatible IDE
- JDK 21+
- Gradle 8.14+
# Build plugin
./gradlew buildPlugin
# Run in development IDE
./gradlew runIde
# Run tests
./gradlew testshutdown-tasks/
βββ src/main/kotlin/dev/gdw/shutdowntasks/
β βββ listeners/
β β βββ ShutdownTasksProjectCloseListener.kt # Project close listener
β βββ settings/
β β βββ ShutdownTasksState.kt # State persistence
β βββ ui/
β β βββ RunnerAndConfigurationSettingsListCellRenderer.kt # UI renderer
β β βββ RunnerAndConfigurationSettingsSelectionDialog.kt # Task selection dialog
β β βββ ShutdownTasksConfigurable.kt # Settings UI
β βββ utils/
β β βββ RunnerAndConfigurationSettingsUtils.kt # RunnerAndConfigurationSettings Utility
β β βββ ShutdownTasksRunner.kt # Tasks executor
β βββ ShutdownTasksBundle.kt # Intl
βββ src/main/resources/
β βββ META-INF/
β β βββ plugin.xml # Plugin descriptor
β β βββ pluginIcon.svg # Plugin icon
β βββ messages/ # Translation files
β βββ ShutdownTasksBundle.properties
β βββ ShutdownTasksBundle_fr.properties
βββ build.gradle.kts # Build configuration
βββ README.md
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- π Bug Reports: GitHub Issues
- π‘ Feature Requests: GitHub Issues
- Inspired by IntelliJ IDEA's built-in "Startup Tasks" feature
- Built with IntelliJ Platform Plugin SDK
Made with β€οΈ by GDW




