安装好maven插件之后的配置
eclipse maven工程打包和clean命令:
1.执行maven clean 前:
2.执行maven clean 后:
3.执行maven install命令前:
4.执行maven install 命令后:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.malt</groupId> <artifactId>mavenWebApp</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</packaging> <dependencies> ... </dependencies> <build> <plugins> <!-- 执行maven install 将指定目录下程序打成war,并将lib文件拉取到--> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webappDirectory>${basedir}/src/main/webapp</webappDirectory> </configuration> </plugin> <!-- 编译--> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <!-- 执行maven clean 时,默认清空哪个文件夹--> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-clean-plugin</artifactId> <version>2.6.1</version> <configuration> <filesets> <fileset> <directory>${basedir}/src/main/webapp/WEB-INF/lib</directory> <followSymlinks>false</followSymlinks> <useDefaultExcludes>true</useDefaultExcludes> </fileset> <fileset> <directory>${basedir}/src/main/webapp/WEB-INF/classes</directory> </fileset> </filesets> </configuration> </plugin> </plugins> </build> </project>