当前位置:网站首页>POM configuration provided and test

POM configuration provided and test

2022-06-24 07:43:00 Chen Bucheng I

One .provided: Scope... Has been provided

provided Illustrates the dependency from JDK Or the container provides . For example, if you develop a web application , May be compiling classpath Need to be available in Servlet API To compile a servlet, But you don't want to be packing WAR Including this Servlet API; this Servlet API JAR By your application server or servlet Containers provide . Dependency of provided scope in compilation classpath ( Not runtime ) You can use . They are not transitive and will not be packaged .

<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
<scope>provided</scope>
</dependency>

Two .test: Test range

test Range dependence You don't need... At normal compile and run times , They are only available during test compilation and test run phases . Not published with project .

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
原网站

版权声明
本文为[Chen Bucheng I]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/06/20210628191924058V.html