简体   繁体   English

在Eclipse中启动Jboss时如何运行批处理作业?

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

I use JBoss AS 5.0 with eclipse 3.6. 我在Eclipse 3.6中使用JBoss AS 5.0。 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? 我在eclipse中启动Jboss,问题是,eclipse通过直接调用run.jar来启动jboss,每次启动服务器时我都需要做一些组装工作(文件复制等),没有地方可以进行此操作当我单击开始按钮时,在调用run.jar的主要方法之前,是否有任何方法可以运行一些预处理任务?

AFAIK, currently there is no way to attach a script to execute before running JBoss (assuming you use JBoss AS Tools ). AFAIK,当前无法在运行JBoss之前附加脚本来执行(假设您使用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 ) 编写一个脚本进行组装(我们称其为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 单击右侧窗格上的“ New...按钮
  5. Select Program > OK 选择程序>确定
  6. Give appropriate Name 提供适当的名称
  7. Browse and select the auto-assemble.bat file > Apply > OK and close the dialog 浏览并选择auto-assemble.bat文件>应用>确定,然后关闭对话框

From now on whenever you want to assemble the EAR simply do the following: 从现在开始,只要您要组装EAR,只需执行以下操作:

  1. Make some changes to your code (optional) 对您的代码进行一些更改(可选)
  2. Do Project > Clean (optional if you do step 1) 执行项目>清洁(如果执行步骤1,则为可选)
  3. Do Project > Build Project (if Build Automatically is not enabled) 执行项目>构建项目(如果未启用自动构建)
  4. Run the JBoss 运行JBoss

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Eclipse中,如何添加工具栏按钮来运行批处理文件? - In Eclipse, how can I add a toolbar button to run a batch file? 当我在Eclipse中运行hadoop作业时发生异常 - Exception when I run a hadoop job in Eclipse 将Spring Batch与Spring Boot结合使用时,如何始终为每次运行启动新的作业实例? - How to always start a new job instance for each run when using spring batch with spring boot? 如何更改 di job CRON 表达式以便每周运行两次 Spring Batch 作业? - How can I change di job CRON expression in order to run my Spring Batch job twice a week? 我可以将用户包加载到 eclipse 中以在启动时运行吗? - can I load user packages into eclipse to run at start up and how? 当我运行春季批处理作业时,chunkListener不会运行 - chunkListener don't run when I run spring batch job 运行 exe 时 Eclipse 不启动? - Eclipse does not start when I run the exe? 我如何将jboss与eclipse集成以运行调试过程 - how do i integrate jboss with eclipse to run debug process 如何自动执行涉及 Eclipse Ant 构建、运行配置和批处理文件的一系列操作? - How can I automate a sequence of actions involving Eclipse Ant builds, Run configuration and a batch file? 在Eclipse上运行时如何禁用缩进? - How can disable indent when I run on eclipse?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM