How do I keep monitoring that a user has successfully run his Java project once?
Answered
I want to monitor every time a user successfully runs a Java project, and every successful run has to be monitored to get me to make some response
Please sign in to leave a comment.
Hi,
Please try implementing
com.intellij.execution.ExecutionListener
(processTerminated()
) and subscribe tocom.intellij.execution.ExecutionManager#EXECUTION_TOPIC
.In the implementation, you should:
executorId
is the one you are interested in (Run, Debug, etc.)executionEnvironment.getRunProfile()
is of the type you want to monitor, e.g.,com.intellij.execution.application.ApplicationConfiguration
For information about listeners, see:
I'm sorry, I'm going to implement this feature on the basis of intellij2020, the method you said doesn't seem to be very compatible, is there any way to implement my needs on intellij2020
Hi,
What is not compatible? Please always provide the details in your questions.
Hi,in the intellij2020 project, I want to use ExecutionEvent, but it gives an error that the class cannot be found and cannot be imported, so I can't use this method.
And this is the version of ExecutionListener I use.
I don’t understand the issue at all.
The
ExecutionListener
interface looks like on your second screenshot and hasn’t changed since 2016. Where did you get the one withExecutionEvent
as the parameter?