我是靠谱客的博主 满意狗,这篇文章主要介绍Maven工程打包时动态设置war包目录,现在分享给大家,希望可以做个参考。

pom.xml中加入插件并设置属性;

 <build>
        <plugins>

            <plugin>    
                <groupId>org.apache.maven.plugins</groupId>    
                <artifactId>maven-dependency-plugin</artifactId>    
                <version>2.8</version>    
                <executions>    
                    <execution>    
                        <id>copy-war</id>    
                        <phase>package</phase>    
                        <goals>    
                            <goal>copy</goal>    
                        </goals>    
                        <configuration>    
                            <artifactItems>    
                                <artifactItem>    
                                    <groupId>${project.groupId}</groupId>    
                                    <artifactId>${project.artifactId}</artifactId>    
                                    <version>${project.version}</version>    
                                    <type>${project.packaging}</type>    
                                </artifactItem>    
                            </artifactItems>    
                            <!--指定war包保存地址-->  
                            <outputDirectory>F:serverapache-tomcat-8.0.42webapps</outputDirectory>
                            <includeArtifactIds>false</includeArtifactIds>

                        </configuration>    
                    </execution>    
                </executions>
            </plugin>



        </plugins>
    </build>

最后

以上就是满意狗最近收集整理的关于Maven工程打包时动态设置war包目录的全部内容,更多相关Maven工程打包时动态设置war包目录内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(103)

评论列表共有 0 条评论

立即
投稿
返回
顶部