Jér*_*nge 2 java servlets maven
我正面临着这里描述的问题.我找到了一个依赖jsp-api.jar,实际上来自对Joda-Time的依赖:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-jsptags</artifactId>
<version>1.0.1</version>
<exclusions>
<exclusion>
<artifactId>jsp-api</artifactId>
<groupId>javax.servlet</groupId>
</exclusion>
</exclusions>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我试图排除它(见上文),但应用程序将无法编译.我怎样才能确保jsp-api没有发货.war?
不要排除此库,而是使用provided范围显式添加到依赖项:
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time-jsptags</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<artifactId>jsp-api</artifactId>
<groupId>javax.servlet</groupId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)