我的控制台代码就是打的war包
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.suning.framework</groupId> <artifactId>snf-parent</artifactId> <!-- <version>3.0.8-SNAPSHOT</version> --> <version>4.0.6</version> </parent> <groupId>com.suning.rdrs</groupId> <artifactId>rdrs_admin</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>RDRS_ADMIN_SYSTEM</name> <url>http://maven.apache.org</url> <properties> <!--maven properties --> <maven.test.skip>false</maven.test.skip> <downloadSources>true</downloadSources> <!-- compiler settings properties --> <java_source_version>1.8</java_source_version> <java_target_version>1.8</java_target_version> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <file_encoding>UTF-8</file_encoding> <spring-version>4.3.9.RELEASE</spring-version> <jacoco.version>0.7.7.201606060606</jacoco.version> <rdrs-share.version>2.2.0.08-SNAPSHOT</rdrs-share.version> </properties> <dependencies> ... </dependencies> <profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <filters> <filter>vars/vars.dev.properties</filter> </filters> </build> </profile> <profile> <id>sit</id> <build> <filters> <filter>vars/vars.sit.properties</filter> </filters> </build> </profile> <profile> <id>pre</id> <build> <filters> <filter>vars/vars.pre.properties</filter> </filters> </build> </profile> <profile> <id>prod</id> <build> <filters> <filter>vars/vars.prod.properties</filter> </filters> </build> </profile> <profile> <id>pst</id> <build> <filters> <filter>vars/vars.pst.properties</filter> </filters> </build> </profile> <profile> <id>poca</id> <build> <filters> <filter>vars/vars.poca.properties</filter> </filters> </build> </profile> <profile> <id>xgpre</id> <build> <filters> <filter>vars/vars.xgpre.properties</filter> </filters> </build> </profile> <profile> <id>sit2</id> <build> <filters> <filter>vars/vars.sit2.properties</filter> </filters> </build> </profile> <profile> <id>preyg</id> <build> <filters> <filter>vars/vars.xgpreyg.properties</filter> </filters> </build> </profile> </profiles> <build> <finalName>rdrs-admin</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <configuration> <useDefaultDelimiters>false</useDefaultDelimiters> <delimiters> <delimiter>$[*]</delimiter> </delimiters> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.8</source> <target>1.8</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <outputFileNameMapping>@{artifactId}@-@{baseVersion}@.@{extension}@</outputFileNameMapping> </configuration> </plugin> </plugins> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>true</filtering> <includes> <include>**/*.*</include> </includes> </resource> <resource> <directory>${basedir}/src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build> </project>