javaeclipsemavenrun-configurationlaunch-configuration

How to create a generic launch configuration with Eclipse?


I have a run configuration in my eclipse. In my project we have two branches : DEV and STABLE. I would like to create one run configuration for building my project whatever branch it is on.

For now, when I set Base directory with one of those two variables : ${project_path}, ${build_project}, I face this error :

Base directory doesn't exist or can't be read.

This works : ${workspace_loc:/my-project-dev-branch} but is tied to a particular branch. I must duplicate this configuration for building the stable branch.


Solution

  • I'm not sure I follow how your branches are represented within the workspace, but

    Based on your description you want to be using ${project_loc} instead.

    Nota: The project MUST be selected in the perspective project before launching the run configuration. Otherwise, you will get a message like in the screenshot below :

    picture of Alert box popup with the text 'Launching MY RUN CONFIGURATION' has encountered a problem.  Variable references empty selection: ${project_loc}'