先说下,我用的是uportal3.1.2版本,SVN上的项目是以ant和maven为基础的,包括初始化,构建,部署等等。
可是我没找到运行,或是以debug方式运行的target。
就算是部署到tomcat上,也要手动去tomcat目录下启动服务,跟IDE是完全脱离的,这样就带来个问题,我如何调试程序?
源码对于IDE来说只是一个普通的Java工程,所以不会帮你部署,所以最好的方式就是将源码构建成WEB项目的结构,uportal里面有这种命令吗?
如果没有,那请问,您是如何进行二次开发,debug的呢?小弟比较没有经验,还请大家帮助
可是我没找到运行,或是以debug方式运行的target。
就算是部署到tomcat上,也要手动去tomcat目录下启动服务,跟IDE是完全脱离的,这样就带来个问题,我如何调试程序?
源码对于IDE来说只是一个普通的Java工程,所以不会帮你部署,所以最好的方式就是将源码构建成WEB项目的结构,uportal里面有这种命令吗?
如果没有,那请问,您是如何进行二次开发,debug的呢?小弟比较没有经验,还请大家帮助
<war warfile="webapp.war" webxml="./WEB-INF/web.xml">
<fileset dir="." includes="**/*.css" />
<fileset dir="." includes="**/*.html" />
<fileset dir="." includes="**/*.jsp" />
<fileset dir="." includes="**/*.class" excludes="**/WEB-INF/classes/**/*.class"/>
<fileset dir="." includes="**/*.jar" excludes="**/WEB-INF/lib/**/*.jar"/>
<fileset dir="." includes="**/WEB-INF/classes/**/*.java"/>
<fileset dir="." includes="**/*.gif" />
<fileset dir="." includes="**/*.GIF" />
<fileset dir="." includes="**/*.png" />
<fileset dir="." includes="**/*.jrxml" />
<classes dir="./WEB-INF/classes/">
<include name="**/*.class" />
</classes>
<lib dir="./WEB-INF/lib/">
<include name="*.jar" />
</lib>
</war>
</target>
<target name="deploy-ear" depends="checkForTomcat" description="Deploy uPortal and dependent libraries and portlets to the servlet container">
<uportal-ant-tasks-macro>
<typedef resource="org/jasig/portal/ant/antlib.xml" uri="urn:up-util-ant">
<classpath refid="uportal-ant-tasks-full.classpath" />
</typedef> <uportal-ear-macro>
<echo message=" extractWars=${extractWars}" />
<echo message="removeExisting=${removeExisting}" />
<echo message=" cleanShared=${cleanShared}" />
<if>
<equals arg1="${cleanShared}" arg2="true" />
<then>
<antcall target="clean-shared" />
</then>
</if> <up:tomcatEarDeploy ear="${uportal-ear.artifact}" catalinaBase="${server.base}" webAppsDir="${server.webapps}" extractWars="${extractWars}" removeExistingDirectories="${removeExisting}" />
</uportal-ear-macro>
</uportal-ant-tasks-macro>
</target>
我的Eclipse用的是j2ee 3.5版本的ant或者maven有好的支持断点调试的插件吗
<target name="deploy-ear" depends="checkForTomcat" description="Deploy uPortal and dependent libraries and portlets to the servlet container">
<uportal-ant-tasks-macro>
<typedef resource="org/jasig/portal/ant/antlib.xml" uri="urn:up-util-ant">
<classpath refid="uportal-ant-tasks-full.classpath" />
</typedef> <uportal-ear-macro>
<echo message=" extractWars=${extractWars}" />
<echo message="removeExisting=${removeExisting}" />
<echo message=" cleanShared=${cleanShared}" />
<if>
<equals arg1="${cleanShared}" arg2="true" />
<then>
<antcall target="clean-shared" />
</then>
</if> <up:tomcatEarDeploy ear="${uportal-ear.artifact}" catalinaBase="${server.base}" webAppsDir="${server.webapps}" extractWars="${extractWars}" removeExistingDirectories="${removeExisting}" />
</uportal-ear-macro>
</uportal-ant-tasks-macro>
</target>
我的Eclipse用的是j2ee 3.5版本的ant或者maven有好的支持断点调试的插件吗
建立web动态项目,导入启动server,然后debug on server。
现在问题是这样,uportal这个开源项目使用maven构建成了一个打包方式为pom的工程,像你说的这样就等于我重构了整个uportal,代价太大,耶鲁不可能发布个无法在Eclipse下面运行的版本,可是就算是用maven运行的话,我在所有pom.xml里面也没找到jetty插件,我又在想是不是用ant呢 如果,可以把uportal构建成web形式的,那当然好,不过这是不太现实的,除非你已经成功这么做出来了
1,导入后先配置build.properties文件,设定tomcat和maven目录位置
2,eclipse装好tomcat插件
3,windows系统需要修改L:\apache-tomcat-6.0.20\bin下的catalina.bat文件加上set CATALINA_OPTS=-server -XX:MaxPermSize=300m -Xmx256m用来设置内存,防止内存溢出,linux系统需要修改L:\apache-tomcat-6.0.20\bin下的catalina.sh文件加上set CATALINA_OPTS='-server -XX:MaxPermSize=300m -Xmx256m'用来设置内存,注意前者设定值时不需要引号,后者需要。
4,然后使用ant执行build.xml中的initportal,再启动hsql数据库,再在eclipse中启动tomcat即可
参考文献:http://www.unicon.net/node/1215