[MNG-8608] Provide a way to find running maven processes similar to jps command
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Christoph Läubrich](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=laeubi)** opened **[MNG-8608](https://issues.apache.org/jira/browse/MNG-8608?redirect=false)** and commented
Java provides a [jps command](https://docs.oracle.com/en/java/javase/11/tools/jps.html) to list all running java processes.
It would be useful to have such capability for maven as well, as an example I like to call:
```
mvn -ps
```
and get a list of maven processes running on the system, it should include:
1. the process id
2. the workdirectory
3. the session execution root directory
4. the maven version
How this is achieved, could be platform specific like it is for jps, and it might not discover all maven processes but only those for the current user.
**+Why is this useful needed:+**
* Currently a maven build do not perform any way of locking so one can easily run two maven processes working on the same project tree
* But due to how maven works this can only end in disaster (e.g. one process clean what the other has build) or at best result in some strange state if two maven processes run in parallel
* Currently there is no way for an IDE to prevent interference with running maven processes that work on the same file tree
Because of this maven should detect other processes running in the same file-tree and either wait or refuse execution.
---
No further details from [MNG-8608](https://issues.apache.org/jira/browse/MNG-8608?redirect=false)
Contributor guide
Research direction
Start by reviewing Maven core's process and command-line entry points, then compare the requested `mvn -ps` behavior with the referenced Java `jps` command. The issue does not identify implementation files or tests; done would require an agreed design for listing process id, workdirectory, execution root, and Maven version, plus a decision on same-tree build interference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100