Maven Combat-Two war package calls

Source: Internet
Author: User

Prerequisites


1, why to use two War a call to a package?

        because weMavenitems perWarThe package is a line, the front desk withEasyui, and each line has to be referencedEasyuirelated toJS,CSS, and there are some other styles. In order to pull out these repetitive things, I hit aWarbag, put these things in.

2. Why not use Jar where's the bag?

hit a common jar Package, the resources into the, but can not be quoted. Time was urgent and no other solution was tried. The final War package is implemented.

Realize

1 , where you need to reference the resource Web layer joins the following dependencies:

<!--for Unified control version--><easyui.version>0.0.1-snapshot</easyui.version><dependency><groupid >com.tgb</groupid><artifactid>itoo-easyui</artifactid><version>${easyui.version} </version>    <type>war</type></dependency>

type type is War form, representing the time to pack the appropriate resources into the present Web project, which exists in the following form,

Rather than a War the form of the package is presented.

2 , in their own JSP page Add Reference

<% @include file= "/common.jsp"%>

with include label.


        So we put web war jsp file, but if we need to reference the class file inside, then we need to refer to the war inside pom file add a default value as follows:

<build><plugins><plugin><artifactId>maven-war-plugin</artifactId>< configuration><attachclasses>true</attachclasses></configuration></plugin></ Plugins></build>

Summarize:

by playing into a war package, so that our repetitive things are greatly reduced, fully embodies the characteristics of encapsulation, reusability. We always make progress in the constant abstraction, and the project is getting better.


Maven Combat-Two war package calls

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.