简体   繁体   English

在WAS 8中通过Jenkins构建和部署Maven项目

[英]Build and deploy a maven project via Jenkins in WAS 8

I have a Maven 3 project. 我有一个Maven 3项目。 There are two main EJB modules let say A and B and one super POM. 有两个主要的EJB模块,比如说A和B,以及一个超级POM。 The current build process generates a .zip files which consists of two .ear files ie A.ear and B.ear files. 当前的生成过程将生成一个.zip文件,该文件由两个.ear文件组成,即A.ear和B.ear文件。 This ZIP folder is then manually deployed to Websphere. 然后将此ZIP文件夹手动部署到Websphere。 We are using was 8.0. 我们使用的是8.0。 There are multiple profiles like test, dev, local. 有多个配置文件,如test,dev,local。 We mention the profile name in mvn (using -P) for which we want to generate a build. 我们在mvn(使用-P)中提到了要为其生成构建的配置文件名称。

Now, our build and deployment process should be done via jenkins. 现在,我们的构建和部署过程应该通过jenkins完成。 The jenkins is hosted in some server. 詹金斯人托管在某些服务器中。 I am able to generate the build ie .zip file successfully in the jenkins default workspace. 我可以在jenkins默认工作区中成功生成build.zip文件。 However, i dont know the next step of deploying it to the websphere server. 但是,我不知道将其部署到Websphere服务器的下一步。 I am completely new to websphere as well as to the project. 我对Websphere以及该项目都是陌生的。 Please let me know what steps needs to be followed to deploy it in was 8.0. 请让我知道在8.0中进行部署需要遵循什么步骤。 Do i need to write any build scripts? 我需要编写任何构建脚本吗? If any further setting information is required in order to answer this question then let me know i will find out and will post it. 如果需要任何其他设置信息来回答这个问题,请告诉我,我将找出答案并将其发布。

I know its an old thread, but I have spent alot of time trying to figure out the same problem so here I am providing the solution which worked for me and might help someone in need. 我知道它是一个旧线程,但是我花了很多时间试图找出相同的问题,因此在这里,我提供了对我有用的解决方案,可能会帮助有需要的人。

Install WebSphere Deployer Plugin 安装WebSphere Deployer插件

  • Go to : Manage Jenkins -> Go to Plugin Manager -> Available -> Websphere Deployer -> Install it. 转到:管理Jenkins->转到插件管理器->可用-> Websphere Deployer->安装它。 在此处输入图片说明
  • The WebSphere Deployer Plugin needs additional libraries. WebSphere Deployer插件需要其他库。 For WebSphere Application Server 8.5.5 (used in this example) this libraries are the 对于WebSphere Application Server 8.5.5(在本示例中使用),该库是

com.ibm.ws.admin.client_8.5.0.jar

com.ibm.ws.orb_8.5.0.jar

  • Both files are located in: 这两个文件都位于:
 <WebSphere-Installation>/runtimes/ 

Copy the JARs to 将JAR复制到

 <Jenkins-Installation-Path>/plugins/websphere-deployer/WEB-INF/lib 
  • Restart Jenkins. 重新启动詹金斯。
  • Invoke Post-build Actions -> Select Deploy to IBM Websphere Application Server 调用构建后操作->选择“部署到IBM Websphere Application Server” 在此处输入图片说明

  • Go to WebSphere Deployment -> Input details as per below: 转到WebSphere部署->输入详细信息,如下所示:

EAR/WAR Path: jobDescription/**/folder1/**/folder2/*.ear

Deployment Targets: WebSphere:cell=[ReplaceWithCellName],node=[ReplaceWithNodeName],server=[ReplaceWithServer]

  • Save the config and Proceed to build 保存配置并继续进行构建

NOTE: Other things in WAS config you might need to set as per your requirement. 注意:WAS配置中的其他内容可能需要根据您的要求进行设置。

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

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