[ 
https://issues.apache.org/jira/browse/MNG-8608?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937401#comment-17937401
 ] 

Christoph Läubrich commented on MNG-8608:
-----------------------------------------

I think one can maybe do some guess work, but it requires jps installed (what 
is only part of JDK as far as I know) and of course requires that no internal 
change. Also as mentioned it would be good if maven itself could use that 
feature so it then has to be implemented twice (once in maven and once in the 
ide), so having this inside maven runtime would be better. maybe one can even 
reuse what is used to prevent different processes accessing the same local 
repo...

> Provide a way to find running maven processes similar to jps command
> --------------------------------------------------------------------
>
>                 Key: MNG-8608
>                 URL: https://issues.apache.org/jira/browse/MNG-8608
>             Project: Maven
>          Issue Type: New Feature
>            Reporter: Christoph Läubrich
>            Priority: Major
>
> 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:
> {code}mvn -ps{code}
> and get a list of maven processes running on the system, it should include:
> # the process id
> # the workdirectory
> # the session execution root directory
> # 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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to