0
votes

Running the following command mvn -U clean install is there a way to check -U from within my custom Mojo?

I checked available items in AbstractMojo.getPluginContext() but didn't find anything for command line.

1
Why do you need that? - khmarbaise

1 Answers

0
votes

Technically it is possible get the information via the MavenSession:

@Parameter(defaultValue = "${session}", readonly = true)
private MavenSession session;


public void execute() {
  ...
  if (session.getRequest().isNoSnapshotUpdates()) {
   ...
  }
}

But I would ask why do you need such information within a plugin?