MavenRunner command line option

Good morning

What is the way to set a command line option when using MavenRunner  + MavenRunnerSettings + MavenRunnerParameters

I know how to run a "dependency:resolve" with MavenRunner, but how to send the option -U,--update-snapshots ?

Is that possible or not ?


Thank you,
Best regards

Bernard

0
3 comments

Good morning,

A partial anwser to the question is that via the Settings you can have SNAPSHOT updated

See   ' Maven > Always Update Snapshots' checkbox

 

But the question is still opened, Is there an option that could be set via MavenRunnerSettings

Best regards

Bernard

 

 

0

Hello,

Finally I get rid of MavenRunner for  forceUpdateProjects from MavenProjectsManager

I means something like :

MavenProjectsManager mavenProjectsManager = MavenProjectsManager.getInstance(project);
MavenProject mavenProject = mavenProjectsManager.findContainingProject(project.getProjectFile());
mavenProjectsManager.forceUpdateProjects(mavenProjects);

This works great, but the question is :

How to wait for the end of execution of method forceUpdateProjects(mavenProjects) ?  I talk about the functionnality provided by the onComplete callback available via  MavenRunner.run(... , Runnable onComplete)

 

Regards

 

 

 

 

 

0

 

Finally whith the help of this discussion list I found the existence of  MavenImportListener
So the following piece of code seems to do the trick :

MessageBusConnection connection = project.getMessageBus().connect(project);
connection.subscribe(MavenImportListener.TOPIC, new MavenImportListener() {
@Override
public void importFinished(@NotNull Collection<MavenProject> importedProjects,

@NotNull List<Module> newModules) {

// my logic here
connection.disconnect();
}


0

Please sign in to leave a comment.