How to share a maven project as a traditional Web project

Source: Internet
Author: User

There are many advantages of MAVEN, some of which are prominent such as

1. The existence of a code base

2. Dependency Management

3. Automatically find the corresponding Javadoc and SRC

4. Numerous plug-in support

Of course there are deficiencies, such as

1. There is redundancy in the LIB packet structure of the code base

2. All Lib found is always >= expected

3. There are also 10% Javadoc and SRC not found

4. Plug-in execution parameters are cumbersome

Now consider this: If team members are not using a traditional Web project on MAVEN,SVN

Is it not possible to check out directly for a MAVEN project or to submit directly, if you insist on using it?

Our idea is this:Maven project--Traditional Web project ->SVN

In turn is the:svn-> traditional Web project->maven project

First build a Web project, add MAVEN support

Using traditional structures

Now we need to map SRC and webroot as they are, and then get all the Lib

A plugin is used here:

Ability to automatically synchronize changes to the source folder to the destination folder

Once the required dependencies are all ready, change the Pom.xml

<plugin>        <Artifactid>Maven-war-plugin</Artifactid>        <version>2.2</version>        <Configuration>          <warsourcedirectory>${basedir}/webroot</warsourcedirectory>          <version>3.0</version>          <Failonmissingwebxml>False</Failonmissingwebxml>           <warsourcedirectory></warsourcedirectory> Packaging source is set to empty, because only need to get all lib, never need to really pack        </Configuration>      </plugin>

Run war:exploded packaged as a folder structure because the source is empty and results in only Lib

Last step, synchronize Lib

Done!!

How to share a maven project as a traditional Web project

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.