Using MAVEN to manage Server Management system (II)

Source: Internet
Author: User

Create a Web project with Maven I won't say much here, I won't find it online.

Starting today to build a network of open source server management system-Blue Rim 2.0, the project function is very simple, mainly the authority management this piece, the framework technology springmvc+springsecurity3.x+mybaits3.x, the project on the official website also has the display, Provide commercial version, this belongs to sell their own products, but now online many good open source projects are missing the corresponding documents, said is open source, but do not share the project business and project logic, build process and technical framework, many people get the source code is not know how to use, often encounter deployment problems, I am not spraying those who share the code, just a little complaint, open source should be like a foreign country to share the API.

No way, in the ordinary program team, oneself is also to improve their own technology, so take open source project to practice practiced hand, what the wrong place, please understand.

Built a project with MAVEN, Groupid--and Com.gloryscience,artifact Id-->servermanager.

build this project I am ready to use MAVEN multi-module, about the benefits of MAVEN multi-module and how to create multi-module in Maven, we can Baidu, these basic things or do it yourself to try it better.

Under Servermanager , create a maven module submodule named Server-web.

Current project structure

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/8A/DA/wKiom1g9PLbgOckEAAANNeifj1s386.png "title=" Qq20161129163020.png "alt=" Wkiom1g9plbgockeaaanneifj1s386.png "/>

We are now starting to build the environment in Server-web to integrate the required frameworks.

First create the WebApp folder under the default/servermanager/server-web/src/main, and create the Web-inf folder below and create the Web project prerequisite file, XML, which is currently in the project tree:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8A/D6/wKioL1g9PWjimcKLAAAdmC63aSA225.png "title=" Qq20161129163336.png "alt=" Wkiol1g9pwjimcklaaadmc63asa225.png "/>

File contents in parent Pom.xml

<project xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" >< Modelversion>4.0.0</modelversion> <groupId>com.gloryscience</groupId> <artifactId> servermanager</artifactid> <version>2.0</version> <packaging>pom</packaging> <na Me>servermanager</name> <description> Server Management Systems </description><modules><module> Server-web</module></modules></project>

Web. XML content:

<?xml version= "1.0" encoding= "UTF-8"? ><web-app version= "2.5" xmlns= "Http://java.sun.com/xml/ns/javaee" Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee http ://java.sun.com/xml/ns/javaee/web-app_2_5.xsd "><welcome-file-list><welcome-file>login.jsp</ Welcome-file> </welcome-file-list> </web-app>

We first configure the default home page to deploy the MAVEN project to Tomcat, because the MAVEN project is being built, so we have to follow these steps to turn the MAVEN project into a Web project:


1. Right-click on the project name, select Properties, select Project Facets in the tree on the left, and tap convert to faceted on the right.

650) this.width=650; "Src=" http://img.blog.csdn.net/20130905110602515?watermark/2/text/ ahr0cdovl2jsb2cuy3nkbi5uzxqvbtc1mta3ntmwng==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/ Southeast "style=" border:0px none;margin:2px 0px;height:auto; "/>

2. on the popup window, tick the dynamic Web Module, select 2.5 for the version number, (3 with TOMCAT7 support only). Click Apply-->ok

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8A/E2/wKiom1g-Ms-Qczu9AAFn6RmQwlo430.png "title=" A57770b9-1cc5-472d-9d1a-08ce78b1d971.png "alt=" Wkiom1g-ms-qczu9aafn6rmqwlo430.png "/>

< Span style= "font-family: ' Microsoft Jas Black ', ' Microsoft Yahei '; font-size:14px;" >3. set deployment Assembly. Right-click on the project, select Properties, select deployment Assembly, in the right window will webcontent deleted.

650) this.width=650; src= http://s1.51cto.com/wyfs02/M00/8A/E2/ Wkiom1g-nsvb1otvaaektsk0vnm873.png "title=" 15934714-2d9c-4a91-9846-28f51e440d5b.png "alt=" Wkiom1g-nsvb1otvaaektsk0vnm873.png "/>4 in Deployment Assembly Click Add  , pop up the following window, click Folder, select Server-web-src-->main-->webapp, click Done.

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/8A/DE/wKioL1g-NdHCU4AbAACraE5U-KY230.png "title=" Qq20161130101324.png "alt=" Wkiol1g-ndhcu4abaacrae5u-ky230.png "/>

The rest of the deployment to Tomcat is OK.

login.jsp

<%@ page language= "java"  contenttype= "Text/html; charset=utf-8"      pageencoding= "UTF-8"%><! doctype html public  "-//w3c//dtd html 4.01 transitional//en"   "HTTP// Www.w3.org/TR/html4/loose.dtd ">

JS, CSS, images file see attachment.

After startup, enter the local address to see the direct login page

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/8A/E2/wKiom1g-NnmAK-PbAAVxoRg0RsQ484.png "title=" Qq20161130101610.png "alt=" Wkiom1g-nnmak-pbaavxorg0rsq484.png "/> The initial web environment has been built.


This article is from the "attack on the Program Ape" blog, please be sure to keep this source http://zangyanan.blog.51cto.com/11610700/1878014

Using MAVEN to manage Server Management system (II)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.