【发布时间】:2018-10-26 15:01:36
【问题描述】:
为什么 maven 坚持在我的 eclipse 项目中将我的 Dynamic Web Module 更改为 3.1?我希望它保持 4.0。有没有办法告诉 maven 我想要 Servlet spec 4.0?到目前为止,Maven 文档还没有为我提供答案。
这是我的 pom 的一部分:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <inherited>true</inherited> <configuration> <source>10</source> <target>10</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.2.1</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin>
Servlet 罐子:
<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>4.0.1</version> <scope>provided</scope> </dependency>
Eclipse 项目设置:
m2e 错误:
我在 Java 10 和 tomcat 9 中使用 Eclipse 氧气。我尝试关闭并重新打开我的项目,进行一些小的更改,然后 Maven 更新我的项目,删除 maven 配置错误以查看它们是否在更新后返回(它们回来)和其他类似的试错类型的东西。到目前为止,没有任何效果。
【问题讨论】:
标签: java eclipse maven m2eclipse servlet-4