Launching run configuration outside Eclipse IDE
Asked Answered
O

3

18

I have a run configuration defined for my Eclipse RCP application which is saved to a .launch file. Is there a way to use this launch configuration outside the Eclipse IDE? i.e, it would be nice to be able to launch the application from the command line for continuous integration purposes.

Occam answered 14/3, 2011 at 21:22 Comment(0)
P
9

You can get the command line Eclipse uses:

  1. Run your program in Eclipse
  2. Go to the "Debug" view
  3. Right-click on the process (probably the second item in the tree) and select "Properties"
  4. Copy shell command and delete the agentlib flag to run in bash. Unfortunately, you need to do this whenever you change the configuration.
Pine answered 26/6, 2013 at 22:51 Comment(3)
I don't think this answers the question at all. He asked if the launch configuration can be launched via command line i.e. in a batch file.Hazlip
You can get the command line used by Eclipse to launch the application with these steps. There is still the problem of having to update your script whenever your configuration changes, but it works.Pine
Sorry my bad, I understood your answer incorrectly.Hazlip
G
1

Yes, you could create and export a product configuration based on your launch-configuration:

  1. Create new Product Configuration (File -> New -> Other)
  2. Name the file (e.g. myrcp.product)
  3. Select "Use a launch configuration" on the first page of the wizard

The product editor should open automatically. In the Exporting section you should be able to export your product using the "Eclipse Product export wizard".

Resource: Eclipse FAQ - How can I deploy my RCP app

Have a look at this PDE Build tutorial. It explains how to build and test (or run) your product using Ant.

Grandiose answered 22/4, 2011 at 12:27 Comment(2)
I was asking about how to run a launch configuration outside of Eclipse, i.e. headless environment. Note that creating a product configuration based on a launch configuration only works for launch configurations for 'Eclipse applications'.Occam
@Occam I don't think I understood you correctly. you wrote "I have a run configuration defined for my Eclipse RCP application". However, if you are searching for a way to call your launch configuration programmatically, then this question might be a duplicate of How to run Eclipse launch configurations programmatically?Grandiose
R
0

It is possible to do that with a little workaround. You can find your configuration at workspace\.metadata\.plugins\org.eclipse.debug.core\.launches.
So, open it in text editor and find an attribute containing goals, e.g. clean install -DskipTests=true.
Then, go to the root of your project and execute that by the CMD:

mvn clean install -DskipTests=true

This should be similar for other goals.

Rosinarosinante answered 28/3, 2019 at 7:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.