?
Solved

How to schedule pre- or post-build actions for a java project in eclipse

Posted on 2008-10-22
3
Medium Priority
?
2,281 Views
Last Modified: 2013-12-15
I need to know how to schedule pre- or post-build actions for a java project in eclipse. I need to launch a script for creating custom configuration files and directories. Ideally, the script should ask a parameter to the developer or (even better) read a environment variable.
0
Comment
Question by:fhoster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
Matt_Bu earned 500 total points
ID: 22840170
Right-click on the project and select --> build path --> Configure build path...
Select the Builders option from the left list.
From there you have several options depending on your configuration and plugins.

I think base eclipse in a java project has at least Ant builder and program.  I have had the most joy using ant builders because I haven't found anything I had to do that I couldn't do with ant but you can do another java program, a shell script, etc.

I'll explain the ant method in more detail:
From the Builders option select the new button on the right.  Then select the Ant Builder and choose the ant build.xml file containing the targets you want to run which should already have been created and stored somewhere in the workspace (I always create them in the project I'm working on but they can be in another project.  

Then you have tons of options and configurations available such as refreshing the workspace after the build, what types of builds to run (the order that the builders appear in the list is the order they will run) and which targets in the ant file to run, use the built-in JRE or an external one, classpath options, allocate console to view the results of the build action, etc.

You have access to several built-in variables when running ant scripts inside the IDE and you can create new ones or reference properties files in the configuration.
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question