简体   繁体   中英

How can I run a batch job when start Jboss in eclipse?

I use JBoss AS 5.0 with eclipse 3.6. I start Jboss inside eclipse, the problems is, eclipse start jboss by direclty calling run.jar, and I need to do some assembling job(file copying etc.) each time when I start the server, there's not where I can put this operation when I click the start button, are there any ways to run some pre-proccessing tasks before calling the main method of run.jar?

AFAIK, currently there is no way to attach a script to execute before running JBoss (assuming you use JBoss AS Tools ).

However, you can indirectly achieve it using below steps:

  1. Write a script that does the assembling (let's call it auto-assemble.bat )
  2. Select your project > menubar: Project > Properties
  3. Select Builders in the left pane
  4. Click New... button on the right pane
  5. Select Program > OK
  6. Give appropriate Name
  7. Browse and select the auto-assemble.bat file > Apply > OK and close the dialog

From now on whenever you want to assemble the EAR simply do the following:

  1. Make some changes to your code (optional)
  2. Do Project > Clean (optional if you do step 1)
  3. Do Project > Build Project (if Build Automatically is not enabled)
  4. Run the JBoss

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM