maven modify runtime configuration

tomcat maven comes with version 6 is, for example, we want to use tomcat7, jdk1.8, we will be changed by configuration.
Changed as follows

<build>
<plugins>
  <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
      <port>8888</port>
    </configuration>
  </plugin>
  <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <compilerArgs>
                <!-- 配置了xlint后,可以将警告信息,详细到某个类的某行代码 -->
                <arg>-Xlint:unchecked</arg>
        </compilerArgs>
        <target>1.8</target>
        <source>1.8</source>
        <encoding>UTF-8</encoding>
      </configuration>
    </plugin>
</plugins>
</build>

tomcat8 maven plug-in

<plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat8-maven-plugin</artifactId>
    <version>3.0-r1655215</version>
    <configuration>
        <!-- 可以灵活配置工程路径 -->
        <path>/demo</path>
        <!-- 可以灵活配置端口号 -->
        <port>8080</port>
    </configuration>
</plugin>

Guess you like

Origin www.cnblogs.com/jichi/p/11626689.html