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