Java Maven更新项目在工作区中出现多个错误
我正在尝试创建一个简单的MVC项目。我正在使用JBossDeveloper studio(版本:10.0.0.GA)和Red Hat JBOSS EAP 7.0,m2e eclipse插件,Java版本:1.8.091。在通过选择架构师类型创建了一个简单的项目之后,我进行了必要的spring配置。附上下面的代码。然后我给了maven更新项目。这导致了多个错误。我参考了其他堆栈溢出解决方案来解决它们。但什么都帮不了我。有人能帮我解决这些问题吗 错误: 1) 无法将project facet动态Web模块的版本更改为3.0。补充 2) JavaServerFaces2.2需要动态Web模块2.5或更新版本。补充 pom.xmlJava Maven更新项目在工作区中出现多个错误,java,xml,eclipse,spring,maven,Java,Xml,Eclipse,Spring,Maven,我正在尝试创建一个简单的MVC项目。我正在使用JBossDeveloper studio(版本:10.0.0.GA)和Red Hat JBOSS EAP 7.0,m2e eclipse插件,Java版本:1.8.091。在通过选择架构师类型创建了一个简单的项目之后,我进行了必要的spring配置。附上下面的代码。然后我给了maven更新项目。这导致了多个错误。我参考了其他堆栈溢出解决方案来解决它们。但什么都帮不了我。有人能帮我解决这些问题吗 错误: 1) 无法将project facet动态We
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>au.com.mercury</groupId>
<artifactId>Replenishment</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>Replenishment Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<!-- spring-context which provides core functionality -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<!-- The spring-aop module provides an AOP Alliance-compliant aspect-oriented
programming implementation allowing you to define -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<!-- The spring-webmvc module (also known as the Web-Servlet module) contains
Spring’s model-view-controller (MVC) and REST Web Services implementation
for web applications -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
<!-- The spring-web module provides basic web-oriented integration features
such as multipart file upload functionality and the initialization of the
IoC container using Servlet listeners and a web-oriented application context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.6.RELEASE</version>
</dependency>
</dependencies>
<build>
<finalName>Replenishment</finalName>
</build>
</project>
4.0.0
au.com.mercury
在添加maven build插件和maven编译器插件以及相应版本的Java后,错误得到解决
<build>
<finalName>Replenishment</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>
补货
org.apache.maven.plugins
maven编译器插件
3.1
1.8
1.8
org.apache.maven.plugins
maven战争插件
2.6
您忘了告诉我们错误是什么。理解问题所需信息的非现场链接使问题对未来的读者毫无用处。嗨,吉姆,我在底部附上了图片链接。错误和项目方面您是否阅读了我的全部评论?关键信息的非现场链接与主题无关。问题必须完整且自包含,错误必须是复制/粘贴的文本,而不是图像。抱歉,Jim,我已更新了错误详细信息。1)无法将project facet Dynamic Web Module的版本更改为3.0。补充2)JavaServerFaces2.2需要动态Web模块2.5或更新版本。补货
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Red Hat JBoss EAP 7.0 Runtime"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="jst.web" version="3.0"/>
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="java" version="1.8"/>
<installed facet="jst.jaxrs" version="2.0"/>
<installed facet="jst.jsf" version="2.2"/>
</faceted-project>
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class SampleController {
@RequestMapping("/welcome")
public ModelAndView helloWorld() {
String message = "<br><div style='text-align:center;'>"
+ "<h3>********** Hello World, Spring MVC Tutorial</h3>This message is coming from CrunchifyHelloWorld.java **********</div><br><br>";
return new ModelAndView("welcome", "message", message);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="au.com.woolworths.mercury.controller" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
<build>
<finalName>Replenishment</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</build>