Using Maven+tomcat to build the spring framework

Source: Internet
Author: User

1. Maven plugin can be installed via Eclipse's online download, in Directory config/setting.xml config file, local variable set MAVEN warehouse address Point your eclipse's MAVEN configuration to the Maven setting.xml configuration file. A new MAVEN project produces a Pom file that provides several places where you need to make your own changes

  <groupId>spring</groupId>  <artifactId>spring-mybatis</artifactId>  <version >0.0.1-SNAPSHOT</version>  <packaging>war</packaging> <!--here to modify MAVEN packaging--  

There are several ways in which MAVEN is packaged: War packages, jar packages, ear packages, and the way that Tomcat deploys war packages, which are used here.

<build>       <directory>target</directory><!--This is the path to the packaged file. The default is the root directory of the project.     -<finalName>spring-mybatis</finalName><!--generated target filenames--    <plugins>        < plugin>          <groupId>org.apache.maven.plugins</groupId>          <artifactId> maven-compiler-plugin</artifactid>          <version>3.5</version>          <configuration>            <source>1.6</source> <!--java Compilation version--            <target>1.6</target>          </ configuration>        </plugin>    </plugins>       

2, MAVEN website to provide the download jar package: http://mvnrepository.com/

Simply search for the corresponding jar package name, add the corresponding maven tag to the dependencies tag in the Pom file and save it, and the MAVEN package will be downloaded to the local repository automatically.

3, packaging methods are two, one is integrated in Eclipse, through the run AS-MVN isntall packaging, there is a need to configure environment variables, CD to the corresponding project root directory, through the cmd window execution: mvn install compile, mvn clean cleanup package.

4, to the official website to download the corresponding Tomcat server: Put a good war package into the app directory to start the server is OK, Tomcat support browser Management deployment package, the default port is 8080. The admin interface needs to configure the initial user name password, in the User.xml configuration file as follows:

<role rolename= "Manager-gui"/>    <user username= "Tomcat" password= "S3cret" roles= "Manager-gui"/>

Simple MAVEN Engineering configuration is complete (spring builds are updated later).

Using Maven+tomcat to build the spring framework

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.