Solved

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

Posted on 2008-10-22
3
2,214 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 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

717 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