1.git下载源码。jpress个工程的所有子项目都继承parent的pom。结构比较清晰。
2.设定Tomcat
3.在eclipse里import->Maven->Existing Maven Projects,之后会生成多个工程。
jpress的代码不需要动,只要设置starter-tomcat这个工程。做为启动工程,(只有在Starter-tomcat工程下面才有WEB-INF/web.xml。Tomcat里添加context的时候会自动识别出这个工程。
一般通过Maven运行maven install来生成war包,然后再配置到tomcat下运行,这种方式应该可以通过java的远程调试的方式在eclipse里调试程序(这个没有尝试)。
这里我使用的是另外一种方式。
查看starter-tomcat的pom就能知道maven在打包war的时候,其实是吧jpress-web,jpress-template,module-page,module-article的4个工程里的webapp下的资源文件(html画面)都复制到output目录里的。
所以,要直接在eclipse里直接运行tomcat的方式运行jpress的话,也必须把上面四个子工程的资源文件复制在starter-tomcat一起才行。
首先在starter-tomcat工程的properties的java build path的source里把4个工程的webapp添加到starter-tomcat里。
注意:添加link source后,默认的output目录是starter-tomcat/src/main/webapp/WEB-INF/classes。
要分别把添加的四个子工程的link source里的output改成starter-tomcat/src/main/webapp。
(这里有个小问题,添加link source之后,好像会把原来starter-tomcat/src/main/webapp清空,导致
starter-tomcat/src/main/webapp/WEB-INF/web.xml也丢失,所以这里事先要把web.xml备份好)
2019-5-17 comment:
在starter-tomcat工程里添加link source之后,把其他工程的webapp目录下的资源会复制到starter-tomcat
工程下的src/main/webapp目录下,starter-tomcat原本的webapp目录就会从工程里消失,不能使用了,
所以starter-tomcat工程下的webapp里最好不要放其他文件。而且如果从多个其他工程link source把资源复制到starter-tomcat工程下的webapp里的话,要确保其他工程的webapp不会有文件冲突。
还有一个关键的配置Deployment Assembly。里面的配置是把资产配置到tomcat/webapp下面去的。
前面build path里添加的link source 会自动出现在deployment assembly里,但是路径还是在WEB-INF/classes下,要改成/。或者直接删除(因为Build Path配置了之后,jpress-web等4个子工程的资源会
复制到starter-tomcat的webapp下,然后deployment assembly里本身就配置了/src/main/webapp复制到/)
deployment assembly里也能看到所有子工程都打包成jar复制到WEB-INF/lib下了。
可以到tomcat的webapps目录下去看publish后的starter-tomcat目录的内容。
在eclipse下启动tomcat,就能通过localhost:8080/starter-tomcat/访问jpress了。
(数据库的创建)
修改starter-tomcat/src/main/resource/jboot-simple.properties里的数据库连接串。
这里可能有人会觉得不需要build path里添加link source,直接在deployment assembly里add相关的资源
发布到tomcat/webapps下不是更简单?
这里也没有仔细研究,但是在deployment assembly里add new assembly directive的时候,
project type是添加子工程编译成jar部署到tomcat的WEB-INF/lib目录下可以找到子工程的jar,但是jar里
只有java编译的classes,没有html等其他资源。所有需要通过别的途径把html等资源部署到tomcat里才行。
folder type只能添加starter-tomcat工程下的目录,所以jpress-web等子工程下的webapp目录的资源是没法通过foler type形式添加的。所以唯一的办法就是先在starter-tomcat的build path里添加link source.。
相关推荐
开发环境搭建本内容你将获得docker-compose 脚本开发环境搭建访问链接此只为开发过程环境连接,便于分配给其它开发人员,此适合于为小团队文档而非个人开发
开箱即用,利用vuepress快速搭建自己的类element-ui的组件文档
MC Press © 2003 Written for beginners with no knowledge of Java, this tutorial walks through the process of creating graphical business applications with Java development tooling (JDT) feature and ...
MC Press © 2003 Written for beginners with no knowledge of Java, this tutorial walks through the process of creating graphical business applications with Java development tooling (JDT) feature and ...
VuePress博客该目录是应用程序的简要示例,可以使用ZEIT Now和零配置进行部署。自行部署使用ZEIT Now部署您自己的VuePress项目。 _Live示例: ://gudong.im我们如何创建此示例要开始使用通过ZEIT Now部署的VuePress...
本项目是基于Vuepress框架 Vuepress-theme-hope主题搭建的一个个人学习笔记文档站点,项目内记
Python基于VuePress搭建的个人笔记静态站点源码.zip
word press
PRESS
press实现个人博客,基本没有js代码,懂点markdown就可以实现博客搭建
presley press
PressUG V6.1 汽车模设计插件(REV015)_20171114
Paste the Update Site URL into the field named "Work with:" and press Enter. Pressing Enter should cause Eclipse to update list of available plugins and components. Choose the component listed under ...
此bat文件解决小米miui链接电脑进入fastboot模式时出现press any key to shutdown的问题,以管理员身份运行即可
上手搭建 你可以跟着文档上的例子自己玩一玩,不过由于VuePress的文档也是用VuePress来实现的,所以我取巧直接拿VuePress仓库中的docs目录拿来玩耍。 1.首先安装VuePress到全局 npm install -g vuepress 2.然后把Vue...
使用Flexsearch库将全文搜索功能添加到您的VuePress网站
主要介绍了如何使用VuePress搭建一个类型element ui文档,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
让你在Vuepress中可以直接使用Font Awesome的图标
vuepress的Material Design主题