eclipse java工程改造為java web工程
前言:
公司有許多Java工程(其實(shí)是web功能的),我用eclipse ide工具,可是web工程才能加入server tomcat中發(fā)布,作為開(kāi)發(fā),我當(dāng)然最關(guān)心的是可以debug,沒(méi)有debug的日子真是折磨人啊,感覺(jué)每天都是被代碼虐,這個(gè)時(shí)候總是讓人產(chǎn)生“我不適合做開(kāi)發(fā)”、“我智商是不是有問(wèn)題”……等錯(cuò)覺(jué),所以今天在新導(dǎo)入一個(gè)java工程的時(shí)候,順便研究了一下怎么將一個(gè)java工程改為javaWeb工程。
下面記錄了一下。
1.在eclipse中新建一個(gè)web工程,將.project文件打開(kāi)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
<? xml version = "1.0" encoding = "UTF-8" ?> < projectDescription > < name >sds</ name > < comment ></ comment > < projects > </ projects > < buildSpec > < buildCommand > < name >org.eclipse.wst.jsdt.core.javascriptValidator</ name > < arguments > </ arguments > </ buildCommand > < buildCommand > < name >org.eclipse.jdt.core.javabuilder</ name > < arguments > </ arguments > </ buildCommand > < buildCommand > < name >org.eclipse.wst.common.project.facet.core.builder</ name > < arguments > </ arguments > </ buildCommand > < buildCommand > < name >org.eclipse.wst.validation.validationbuilder</ name > < arguments > </ arguments > </ buildCommand > </ buildSpec > < natures > < nature >org.eclipse.jem.workbench.JavaEMFNature</ nature > < nature >org.eclipse.wst.common.modulecore.ModuleCoreNature</ nature > < nature >org.eclipse.wst.common.project.facet.core.nature</ nature > < nature >org.eclipse.jdt.core.javanature</ nature > < nature >org.eclipse.wst.jsdt.core.jsNature</ nature > </ natures > </ project Description> |
對(duì)比java工程和web新工程下面兩個(gè)文件的內(nèi)容,將不一樣的地方進(jìn)行修改。
1.將.settings文件夾下面的文件進(jìn)行對(duì)比,將不一樣的拷貝進(jìn)去,并將每個(gè)文件打開(kāi)對(duì)比,修改正確
1
2
|
org.eclipse.wst.common.component org.eclipse.wst.common.project.facet.core.xml |
主要是這兩個(gè)文件中的內(nèi)容,要對(duì)比修改。
3. 修改完之后刷新原來(lái)java工程,工程就會(huì)有web標(biāo)志了,這時(shí)候我們?cè)偌尤雜erver web容器就可以了,debug 可以了,這是多么令人愉快的模式啊,Go
感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
原文鏈接:http://blog.csdn.net/jiyingying_up/article/details/50856759