将插件保留在项目和配置文件中的区别 [英] difference between keeping a plugin inside a project and inside a profile

查看:140
本文介绍了将插件保留在项目和配置文件中的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以在下面解释其功能吗?

A)实际上下面的代码对我有用,但是我不明白为什么我们需要在下面使用 maven-war-plugin

<warSourceDirectory>src/main/webapp</warSourceDirectory>
                    <webXml>src/main/webapp/WEB-INF/web.xml</webXml>

B)将插件保留在项目中和配置文件中之间有什么区别? (例如 maven-surefire-plugin )哪种方法更好(假设我必须在pom.xml中使用<profile>标记)

解决方案

A部分

warSourceDirectory是静态Web文件,jsp,图像,WEB-INF等的目录.默认值为好",因此您无需更改此参数.

webXml-是 web.xml 文件(部署说明)的位置.使用Spring Boot,您根本不需要web.xml.将参数 failOnMissingWebXml 设置为false. /p>

B部分

项目内部定义的插件始终由该项目使用.仅在启用配置文件时才使用配置文件中定义的插件-因此该插件不是默认插件.

Can anyone please explain the functionality for below?

A) Actually below code is working for me, BUT I didnt understood why we need to use below for maven-war-plugin

<warSourceDirectory>src/main/webapp</warSourceDirectory>
                    <webXml>src/main/webapp/WEB-INF/web.xml</webXml>

B) whats the difference between keeping a plugin inside a project and inside a profile? ( say maven-surefire-plugin ) which way is better (assume I MUST use <profile> tag in my pom.xml)

解决方案

Part A

warSourceDirectory is directory for static web files, jsp, images, WEB-INF etc. The default value is good, so you dont need to change this parameter.

webXml - is location of web.xml file, deployment description. With spring boot you dont need web.xml at all. Set parameter failOnMissingWebXml to false.

Part B

Plugin defined inside a project are used by this project always. Plugin defined in profile are used only when you enable profile - so this plugin is not default.

这篇关于将插件保留在项目和配置文件中的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆