• 关于Web项目的pom文件处理


    pom文件的方式需要修改的是

    <packaging>war</packaging>

        <profiles>
            <profile>
                <id>command</id>
                <build>
                    <directory>build</directory>
                </build>
            </profile>
        </profiles>
    
    <build>
            <finalName>Service</finalName>
    
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.7</source>
                        <target>1.7</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
    
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <configuration>
                        <archive>
                            <addMavenDescriptor>false</addMavenDescriptor>
                        </archive>
                        <webResources>
                            <resource>
                                <directory>profiles/${profile.id}</directory>
                                <targetPath>/</targetPath>
                                <filtering>true</filtering>
                            </resource>
                        </webResources>
                        <warSourceDirectory>${basedir}/WebRoot</warSourceDirectory>
                        <!-- <warSourceExcludes>
                            css/**,images/**,js/**,wap/css/**,wap/images/**,wap/js/**
                        </warSourceExcludes> -->
                        <webXml>${basedir}/WebRoot/WEB-INF/web.xml</webXml>
                        <ignoreWebxml>false</ignoreWebxml>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
    
            </plugins>
        </build>

    这里需要将那个web.xml拷贝到相应的目录下

    该插件有待后续研究

  • 相关阅读:
    《软件需求十步走》读书笔记二
    《软件需求十步走》读书笔记一
    FJUTOJ-周赛2016-12-16
    FJUTOJ-周赛2016-11-25
    网络爬虫
    树链剖分讲解
    HDU 5266 pog loves szh III
    HDU 3518 Boring counting
    HDU 5929 Basic Data Structure
    HDU 1055 Color a Tree
  • 原文地址:https://www.cnblogs.com/atomicbomb/p/6855072.html
Copyright © 2020-2023  润新知