Solved

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

Posted on 2008-10-22
3
1,987 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
3 Comments
 

Accepted Solution

by:
Matt_Bu earned 125 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now