<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-84  評論-56  文章-0  trackbacks-0

    Intellij IconHere's how you can run maven built web applications directly from within Intellij IDEA 8. Once you run this way, you completely eliminate the code, build, deploy, restart cycle just when you want to make a change... you can even change classes on the fly (hot swapping).

    I pretty much only run in debug mode now. Debugging is really nice because the dependent source files are linked up and downloaded automagically by maven on the fly and class changes via hot swapping really makes you productive. The archetype selection in the project creation wizard came with version 8 but the rest of the guide will work with versions 6 and 7 as well. I used the appfuse-basic-spring archetype as the web application but any web app built with maven should work in a pretty similar way.

    Create Maven Module

    First, we need a project. There's nothing special to note here with the exception of the name field. The name field cannot contain a space. If it does, Intellij doesn't start up tomcat properly and you get this ClassNotFoundException on logging/properties.

    Create new project

    Choose Maven Archetype

    You can type in what you want to for your particular project here. Then click Finish.

    Choose Archetype

    Build Project with Maven

    Next you need to build the project to make the output directories.

    Run Maven Package

    Click Edit Configurations

    There's a button on the toolbar or you can find it by going to Run --> Edit Configurations. After you click the plus sign and pick local tomcat server you'll see this

    Run/Debug Configurations

    Pick Application Server

    If you've already configured an application server for Intellij, you can just choose it in the dropdown menu. Otherwise you'll need to configure one. After you click Configure... you'll see this screen:

    Create Local Tomcat Server

    If you haven't installed Tomcat locally you'll of course need to do that. Then click the plus sign and pick the tomcat home and Intellij will figure out the rest.

    After you hit ok, you'll be back to the Run/Debug Configurations menu. Now you can choose the server from the dropdown and the Startup page: should be filled in with whatever port your Tomcat server has been configured to use.

    After Tomcat Server Config

    Click on Deployment Tab

    This is where you choose the deployment source and application context for the web facet within the application. First click on the Web Facet: Web module in the middle pane and check the Deploy Web Facet 'Web' checkbox.

    Click Deployment Tab

    Click the Configure... button.

    Configure the Deployment Source

    Uncheck the Create web facet war file and choose Create web facet exploded directory instead.

    Java EE Build Settings Default

    Click the ellipses (...) button to choose the exploded directory:

    Select Web Facet Exploded Directory

    Choose the location under the target folder where maven built the war. It is going to be named using artifactId-version that you chose when you created the project in the first place. This information is stored in the pom.xml file so you can change it whenever you want. If you do change it go back to the Build Project with Maven step after you have done so.

    Click Ok. Then Click Ok to close the Deployment Source window.

    Finish Deployment Tab

    Now you can select the Deployment Source and set your application context.

    Finish Web Facet Deployment

    Click Ok.

    Run/Debug the Application

    You should see the server startup successfully

    Click the Run Button

    Login to the Application

    See Login Page

    Login to the application

    Hot Swapping

    If you've started up in debug mode (highly recommended), change a class in the class path and make the project (Apple+F9) or compile the specific class you've changed (Apple+Shift+F9). You should be presented with this popup:

    Redeploy Application Popup

    Make sure you click No on this dialog box. If you click yes, hot swapping won't work. I usually check Do not show this dialog in the future as well.

    That's it! Now when you change classes and JSPs you can just compile and they will be hot swapped with resources on the running server. 

    posted on 2008-12-10 16:38 憶風 閱讀(619) 評論(0)  編輯  收藏 所屬分類: IDE
    主站蜘蛛池模板: 国产精品入口麻豆免费观看| 亚洲乳大丰满中文字幕| 亚洲午夜精品第一区二区8050| 国产精品V亚洲精品V日韩精品| 亚洲丁香婷婷综合久久| 欧洲美熟女乱又伦免费视频| 亚洲一区爱区精品无码| 精品国产免费人成网站| 日韩av无码成人无码免费| 亚洲最大av无码网址| a一级毛片免费高清在线| 无限动漫网在线观看免费| 亚洲乱码在线观看| 日本免费人成黄页网观看视频| 亚洲av福利无码无一区二区| 亚洲av永久无码天堂网| 91禁漫免费进入| 亚洲va乱码一区二区三区| 免费看美女被靠到爽| 猫咪免费观看人成网站在线| 免费可以看黄的视频s色| 亚洲日韩AV一区二区三区中文| 久久综合给合久久国产免费| 亚洲激情校园春色| 看全色黄大色大片免费久久| 新最免费影视大全在线播放| 亚洲成AV人片在线观看无| 亚洲网站免费观看| 亚洲黄色一级毛片| 九九精品成人免费国产片| 亚洲伊人久久大香线蕉影院| 亚洲免费精彩视频在线观看| 亚洲婷婷五月综合狠狠爱| 免费人成黄页在线观看日本| 亚洲乱码一二三四区乱码| 亚洲成A人片在线观看无码3D| 中文字幕无码免费久久| 亚洲欧洲无码一区二区三区| jlzzjlzz亚洲乱熟在线播放| 99热精品在线免费观看| 蜜芽亚洲av无码一区二区三区|