使用IBM Rational Application Developer 8开发Portlet - Maven集成
来源:互联网 发布:淘宝上买号怎么领取 编辑:程序博客网 时间:2024/04/30 16:07
本文介绍如何设置在IBM Rational Application Developer (RAD) 8中集成Maven以进行Portlet的开发。
第1步 - 安装IBM Rational Application Developer V8.0.4
参见 - 使用IBM Rational Application Developer 8开发Portlet - 开发环境
第2步 - 安装 m2eclipse-wtp release 1.0.100
1) 在RAD中选择菜单 Window - Preferences - Install/Update - Available Software Sites, 选择以下站点,
* http://download.eclipse.org/eclipse/updates/3.6
* http://download.eclipse.org/webtools/repository/helios
2) 在RAD中选择菜单Help -> Install New Software, 增加以下站点:
http://download.jboss.org/jbosstools/updates/m2eclipse-wtp
选择以下组件:
* Maven Integration for Eclipse
* Maven Integration for WTP
* Maven Integration for Eclipse Extras - m2e connector for maven archiver pom properties
第3步 - 安装 m2e connectors以连接software configuration management (SCM)
我使用SVN, 首先从http://subclipse.tigris.org/update_1.6.x安装Subclipse V1.6.X,然后在RAD中选择菜单Window - Preferences - Maven - Discovery, 点击Open Catalog以安装m2e-subclipse connector.
第4步 - 设置Java EE and Maven preference
1)在RAD中选择菜单Window - Preferences - Java EE - Project, 清除"Add project to an EAR"选择框.
2)在RAD中选择菜单Window - Preferences - Maven - WTP integration, 清"Generate application.xml under the build directory"选择框.
第5步 - 在RAD workspace中创建或导入Maven项目
使用RAD "Checkout Maven projects from SCM"或"Import Existing Maven Projects"向导在RAD workspace中导入Maven项目.
我一般在Maven项目中包含三个模块: core, webapp和ear. 当RAD导入该Maven项目时, m2eclipse-wtp会根据maven模块的类型生成相应的Eclipse项目和设置文件。
第6步 - 设置EAR项目属性
只有在设置了相关的EAR项目属性之后,才可以在RAD中使用debug/run on server和WAS deployment descriptor编辑等功能
1)鼠标右键EAR项目并选择Properties - Project Facets, 选择"Websphere Application(Co-existence)"和"Websphere Application(Extended)"选择框, 并选择相应的WAS server版本
2)鼠标右键EAR项目并选择Properties - Targeted Runtimes, 选择"Websphere Portal"选择框.
以上就是集成Maven和RAD的基本步骤。
问题和解决方法
问题 - 右击EAR项目的弹出菜单中没有Open WebSphere Application Deployment选项
解决方法 - 在ear模块的POM文件中, 设置maven-ear-plugin/configuration/version值为5或以上.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>2.6</version> <configuration> <!-- generate application.xml version 5, to enable RAD to edit WAS deployment descriptor --> <version>5</version> <modules> <webModule> <groupId>${project.groupId}</groupId> <artifactId>demo-webapp</artifactId> <contextRoot>MavenDemoPortlet</contextRoot> </webModule> </modules> </configuration></plugin>问题 - 右击EAR项目并点击Open WebSphere Application Deployment报错Could not open the editor: An unexpected exception was thrown.
解决方法 - 打开ear项目的settings/org.eclipse.wst.common.component文件, 检查wb-module的deploy-name属性值是否和Eclipse项目名相同. 如果不同的话,使用以下方法之一来修改.
方法1)在ear模块的POM文件中, 添加build/finalName属性, 其值为ear模块的artifactId,
<build> <!-- same as the artifactId, which is the RAD project name, and also the deploy-name defined in settings/org.eclipse.wst.common.component --> <finalName>demo-ear</finalName> ...</build>方法2) 在项目导入时, 使用Advanced setting, 在Name template中选择[artifactId]-[version].
问题 - Portlet Run/Debug on Server报错EJPPG0024I: Web application with context root XXX is deployed in the application server but not registered with portal.
解决方法 - 检查webapp项目settings/org.eclipse.wst.common.component文件, 检查wb-module的context-root属性是否和ear maven-ear-plugin的contextRoot相同, 如果不同的话, 可以修改ear POM,也可以通过在webapp模块的POM文件中定义m2eclipse.wtp.contextRoot或build/finalName属性以修改settings/org.eclipse.wst.common.component文件、
<properties> <!-- this must be same as the contextRoot defined in the ear module--> <m2eclipse.wtp.contextRoot>MavenDemoPortlet</m2eclipse.wtp.contextRoot></properties>
- 使用IBM Rational Application Developer 8开发Portlet - Maven集成
- 使用IBM Rational Application Developer 8开发Portlet - 开发环境
- 使用 Rational Application Developer 6.0 和 WebSphere Portal Server 5.1开发 JSF portlet
- 在Rational Application Developer中开发简单Portlet(一)
- 在Rational Application Developer中开发简单Portlet(二)
- 在Rational Application Developer中开发简单Portlet
- 在 IBM Rational Application Developer 中如何使用 JavaServer Faces 组件和 Ajax
- 超越软件开发建模: 使用 IBM Rational Rose 和 IBM Rational Rose XDE Modeler/Developer 创建绘图法
- 用 IBM Rational Application Developer V7.5 中的 JPA、Ajax 与 Dojo 工具开发 Web 2.0 应用程序
- 使用 Rational Application Developer V7.0 开发 JAX-WS Web 服务
- IBM portlet API 开发
- 使用 Rational Application Developer V7 中的 J2C Ant 脚本
- 使用 Rational Application Developer V7 改进 Web 应用
- What's new in IBM Rational Application Developer V7.5 Portal Toolkit
- 将软件开发过程与IBM Rational工具集成在一起
- IBM Rational RequisitePro集成简介
- 使用 WebSphere Studio Application Developer 集成版,版本 4.1 开发 Java 消息服务应用程序
- 使用 IBM Rational PurifyPlus
- Restart!记录工作生活的点点滴滴。
- 第三方开源类库搜集总结—IOS开发
- C++函数模板问题
- win7 定时关机
- 浅析ObjectiveC 深浅拷贝学习
- 使用IBM Rational Application Developer 8开发Portlet - Maven集成
- poj 3070(矩阵的快速幂)
- 恢复firefox关闭时保存标签页的提示。
- 在被窝里看书系列之《Windows PE 权威指南学习》笔记 第一章
- ubuntu12.04 中EMACS安装过程中关于crt*.o定位的问题
- 在被窝里看书系列之《Windows PE 权威指南学习》笔记 第二章
- sublime 看着太爽了!
- 代码优化如做游戏一样有趣
- JAVA 哈希表类 HashTable