Open project that has multiple processors in headless mode

Answered

Hello,

I am trying to evaluate my plugin on 10 projects in headless mode. One of the projects is JUnit and it has the default platform processor as well as the Eclipse and Maven processors. When I use ProjectUtil.openOrImport(), it tries to show dialog asking whether to use the Eclipse or Maven processor which throws an exception because it's in headless mode.

I tried deleting the .project and .classpath files in the project before trying to load it so it would only use the Maven processor but it still find these files. Is there a way to set the processor before trying to load the project, or do you have any suggestions as to where I should look to try to solve this issue?

Thanks,

Max

4 comments
Comment actions Permalink

Do I understand correctly that you want to specify a specific ProjectOpenProcessor _always_ (or have ability to choose one programmatically)?

0
Comment actions Permalink

Yes, I'm either looking for the option to choose one programmatically (this would be preferred) or to specify a specific ProjectOpenProcessor before attempting to open the project (or any option that lets me get around the incorrect state exception that pops up when multiple ProjectOpenProcessors are found).

0
Comment actions Permalink

There is currently no dedicated API to allow programmatic choice.

You can use this strategy instead
ProjectManagerEx.getInstanceEx().openProject(file, options.withRunConfigurators());

1
Comment actions Permalink

Hi Yann,

This was incredibly helpful. Thank you for the help!

Max

0

Please sign in to leave a comment.