Real Programmers don't need comments—the code is obvious.
Home FAQs How can I execute JDeodorant in headless mode?
How can I execute JDeodorant in headless mode? PDF Print E-mail

Please refer to the jdeodorant-commandline project


In order to execute JDeodorant in headless mode you should apply the following steps:

1. Install the latest version of JDeodorant in your Eclipse.

2. Download this Eclipse application and import it as an existing project into workspace. The project name is "eclipse.commandline".

By default the project executes JDeodorant on every open project in the workspace specified as argument and prints the results in the console.

UPDATE: The new version of the headless plug-in creates Eclipse Java projects for the folders that do not contain a .project file by finding the source folders and libraries nested inside the root folder and its sub-folders. If the root folder contains a pom.xml file, then the project is created using Maven.
The installation instructions for Maven can be found here.

If you want to change the default functionality, you simply have to add your code in class eclipse.commandline.Application

3. Right-click on the eclipse.commandline project and select "Run As" -> "Run Configurations..."

4. Click on "Eclipse Application" and then on the "New launch configuration" button. Give a name to the newly created launch configuration (e.g., eclipse.commandline as shown in the screenshot below).

5. In the "Main" tab

a) In the "Workspace Data" setup the workspace "Location" to point to the workspace containing the projects that you want to analyze in headless mode. This must be a workspace directory created by Eclipse.

b) In the "Program to Run" select to "Run an application" and from the drop-down list select "eclipse.commandline.application" as shown in the screenshot below.


6. In the "Arguments" tab specify the "Program arguments" as -consoleLog -console -nosplash and "VM arguments" as -Xms128m -Xmx2048m -XX:PermSize=128m (you can increase the Xmx value, if more memory is available).


7. In the "Plug-ins" tab select "eclipse.commandline (1.0.0.qualifier)" and click on "Add Required Plug-ins" button. This must select 75 plug-ins from the "Target Platform" group.


8. Apply the changes in order to save the new Launch Configuration.

9. Click Run to test whether the headless plug-in works properly. If you are getting BundleExceptions, go back to the "Plug-ins" tab and select Launch with: "all workspace and enabled target plug-ins". Apply the changes and Run again the headless plug-in.

Further steps to execute from command line:

1. First, you have to build the "eclipse.commandline" headless plug-in. Double-click on the plugin.xml file placed under the "eclipse.commandline" project. This will open the plug-in configuration page. Select the Overview tab and click on the Export Wizard link.

2. In the wizard, select "eclipse.commandline (1.0.0.qualifier)" and press Finish. This will generate the headless plug-in in your workspace/plugins directory as "eclipse.commandline_1.0.0.YYYYMMDDHHMM.jar".

3. Copy the generated jar file to the "plugins" directory inside your Eclipse installation folder.

4. From the command line change directory to your Eclipse installation folder and execute the following command:
eclipse -data "C:\Users\tsantalis\runtime-EclipseApplication" -Xms128m -Xmx2048m -XX:PermSize=128m -consoleLog -console -nosplash -application eclipse.commandline.application
where the -data argument corresponds to an Eclipse workspace path

RocketTheme Joomla Templates