Maven Java EE配置标记与Java服务器面对1.2 [英] Maven Java EE Configuration Marker with Java Server Faces 1.2

查看:378
本文介绍了Maven Java EE配置标记与Java服务器面对1.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Eclipse中有一个奇怪的配置问题与Maven。虽然我可以构建项目并将其部署到tomcat而没有任何错误,但标记选项卡仍然显示以下消息:

  [ - ] Maven Java EE配置问题
(x)无法安装JavaServer Faces 1.2:一个或多个约束未满足。
(x)JavaServer Faces 1.2需要Dynamic Web Module 2.5或更新版本。我实际上使用了动态Web模块2.4,这将是消息的源头。

我需要将其更改为至少2.5以使用JSF。问题是,我甚至没有使用JSF。



所以,可能其中一个项目的依赖关系需要它。我运行以下命令来找出我的项目的依赖关系树:

  mvn依赖:tree -DoutputFile =< i> /path/to/outputFile/dependencies.txt</i> 

和惊喜!没有提到JSF 1.2。



编辑忘记添加我的电脑设置:



操作系统:Ubuntu 12.10



Eclipse:4.2 SR1



Java:jdk1.5.0_22和jdk1.7

Apache Maven:3.0.4



Maven主页:/ usr / share / maven



m2e:1.3.1.20130219-1424



m2e-wtp:0.17.0.20130212-1821


$ b $我的同事们都没有这个问题。其中两个使用Windows,两个使用Ubuntu 12.10。其中一个使用Eclipse 4.2,其他使用Eclipse 3.7。所以显然这是与4.2SR1或我的项目设置有关。但是我找不到问题所在。



这是我的pom.xml文件:

 < project xmlns =http://maven.apache.org/POM/4.0.0xmlns: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>已编辑< / groupId>
< artifactId>已编辑< / artifactId>
< packaging> war< / packaging>
< version> editing< / version>
< name>已编辑< / name>
< distributionManagement>
< repository>
< id> deployment< / id>
< name>内部版本< / name>
< url> http:// edited / nexus / content / repositories / releases /< / url>
< / repository>
< snapshotRepository>
< id> deployment< / id>
< name>内部版本< / name>
< url> http:// edited / nexus / content / repositories / snapshots /< / url>
< / snapshotRepository>
< / distributionManagement>
<依赖关系>
<! - Testes com Junit - >
<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 4.11< / version>
< / dependency>
<依赖关系>
< groupId> org.hamcrest< / groupId>
< artifactId> hamcrest-all< / artifactId>
< version> 1.3< / version>
< scope> test< / scope>
< / dependency>
<! - Testes Funcionais com cucumber-jvm - >
<依赖关系>
< groupId> info.cukes< / groupId>
< artifactId> cucumber-spring< / artifactId>
< version> 1.1.1< / version>
< scope> test< / scope>
< / dependency>
<依赖关系>
< groupId> info.cukes< / groupId>
< artifactId> cucumber-junit< / artifactId>
< version> 1.1.1< / version>
< scope> test< / scope>
< / dependency>
<! - Mockito para criar mocks e stubs - >
<依赖关系>
< groupId> org.mockito< / groupId>
< artifactId> mockito-all< / artifactId>
< version> 1.9.5< / version>
< / dependency>
<! - Fixture Factory测试数据生成器 - >
<依赖关系>
< groupId> br.com.fixturefactory< / groupId>
< artifactId> fixture-factory< / artifactId>
< version> 2.1.0-SNAPSHOT< / version>
< scope> test< / scope>
< / dependency>
<! - Jasper Reports - >
<依赖关系>
< groupId> net.sf.jasperreports< / groupId>
< artifactId> jasperreports< / artifactId>
< version> 4.5.1< / version>
< / dependency>
<! - Struts 2 - >
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-core< / artifactId>
< version> 2.2.1.1< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.struts.xwork< / groupId>
< artifactId> xwork-core< / artifactId>
< version> 2.2.1.1< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-tiles-plugin< / artifactId>
< version> 2.2.1.1< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-json-plugin< / artifactId>
< version> 2.2.1.1< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-jasperreports-plugin< / artifactId>
< version> 2.2.1.1< / version>
< / dependency>
<! - Banco de dados Mysql + Hibernate + c3p0 - >
<依赖关系>
< groupId> mysql< / groupId>
< artifactId> mysql-connector-java< / artifactId>
< version> 5.1.22< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 3.3.1.GA< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-annotations< / artifactId>
< version> 3.4.0.GA< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-commons-annotations< / artifactId>
< version> 3.1.0.GA< / version>
< / dependency>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-validator< / artifactId>
< version> 4.2.0.Final< / version>
< / dependency>
<依赖关系>
< groupId> javax.validation< / groupId>
< artifactId> validation-api< / artifactId>
< version> 1.0.0.GA< / version>
< / dependency>
<! - < dependency> <&的groupId GT; javax.xml.bind中< /&的groupId GT; < artifactId的> JAXB-API< / artifactId的>
< version> 2.2.7< / version> < /依赖性> <依赖性> <&的groupId GT; com.sun.xml.bind< /&的groupId GT;
< artifactId> jaxb-impl< / artifactId> <版本> 2.2.6< /版本> < /依赖性> - >
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-c3p0< / artifactId>
< version> 3.6.10.Final< / version>
< / dependency>
<依赖关系>
< groupId> c3p0< / groupId>
< artifactId> c3p0< / artifactId>
< version> 0.9.1.2< / version>
< / dependency>
<依赖关系>
< groupId> javassist< / groupId>
< artifactId> javassist< / artifactId>
< version> 3.3.GA< / version>
< / dependency>
<! - Servlet API - >
<依赖关系>
< groupId> org.apache.tomcat< / groupId>
< artifactId> servlet-api< / artifactId>
< version> 6.0.36< / version>
< / dependency>
<! - 特定Java EE - >
<依赖关系>
< groupId> javax.mail< / groupId>
< artifactId> mail< / artifactId>
< version> 1.4.5< / version>
< / dependency>
<依赖关系>
< groupId> javaee< / groupId>
< artifactId> javaee-api< / artifactId>
< version> 5< / version>
< scope>已提供< / scope>
< / dependency>
<! - 记录 - >
<依赖关系>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.17< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-api< / artifactId>
< version> 1.7.2< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-log4j12< / artifactId>
< version> 1.7.2< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> slf4j-simple< / artifactId>
< version> 1.7.2< / version>
< / dependency>
<依赖关系>
< groupId> org.slf4j< / groupId>
< artifactId> jcl-over-slf4j< / artifactId>
< version> 1.7.2< / version>
< / dependency>
<! - Apache Commons - >
<依赖关系>
< groupId> commons-collections< / groupId>
< artifactId> commons-collections< / artifactId>
< version> 3.2.1< / version>
< / dependency>
<依赖关系>
< groupId> commons-io< / groupId>
< artifactId> commons-io< / artifactId>
< version> 1.4< / version>
< / dependency>
<依赖关系>
< groupId> commons-logging< / groupId>
< artifactId> commons-logging-api< / artifactId>
< version> 1.1< / version>
< / dependency>
<依赖关系>
< groupId> commons-beanutils< / groupId>
< artifactId> commons-beanutils< / artifactId>
< version> 1.8.3< / version>
< / dependency>
<依赖关系>
< groupId> commons-httpclient< / groupId>
< artifactId> commons-httpclient< / artifactId>
< version> 3.1< / version>
< / dependency>
<依赖关系>
< groupId> commons-codec< / groupId>
< artifactId> commons-codec< / artifactId>
< version> 1.6< / version>
< / dependency>
<! - 模板 - >
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-core< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-api< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-jsp< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-servlet< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-template< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.tiles< / groupId>
< artifactId> tiles-compat< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<依赖关系>
< groupId> org.freemarker< / groupId>
< artifactId> freemarker-gae< / artifactId>
< version> 2.3.19< / version>
< / dependency>
<! - Quartz Scheduler - >
<依赖关系>
< groupId> org.quartz-scheduler< / groupId>
< artifactId> quartz< / artifactId>
< version> 1.8.6< / version>
< / dependency>
<! - GeraçãodeCódigo - >
<依赖关系>
< groupId> cglib< / groupId>
< artifactId> cglib-nodep< / artifactId>
< version> 2.2.2< / version>
< / dependency>
<! - Xstream - >
<依赖关系>
< groupId> com.thoughtworks.xstream< / groupId>
< artifactId> xstream< / artifactId>
< version> 1.4.3< / version>
< / dependency>
<! - Spring - >
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-core< / artifactId>
< version> 3.0.6.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-context-support< / artifactId>
< version> 3.0.6.RELEASE< / version>
< type> jar< / type>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-beans< / artifactId>
< version> 3.0.6.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> 3.0.6.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.apache.struts< / groupId>
< artifactId> struts2-spring-plugin< / artifactId>
< version> 2.1.8< / version>
< / dependency>
<! - RestEasy - >
<依赖关系>
< groupId> org.jboss.resteasy< / groupId>
< artifactId> resteasy-jaxrs< / artifactId>
< version> 2.0.1.GA< / version>
< / dependency>
<依赖关系>
< groupId> org.jboss.resteasy< / groupId>
< artifactId> resteasy-jaxb-provider< / artifactId>
< version> 2.0.1.GA< / version>
< / dependency>
<! - Xfire - >
<依赖关系>
< groupId> org.codehaus.xfire< / groupId>
< artifactId> xfire-all< / artifactId>
< version> 1.2.6< / version>
<排除>
< exclude>
< groupId> org.springframework< / groupId>
< artifactId> spring< / artifactId>
< / exclusion>
< exclude>
< groupId> org.springframework< / groupId>
< artifactId> spring-mock< / artifactId>
< / exclusion>
< / exclusions>
< / dependency>
<! - JQuery - >
<依赖关系>
< groupId> org.webjars< / groupId>
< artifactId> jquery< / artifactId>
< version> 1.9.1< / version>
< / dependency>
< / dependencies>
< build>
< finalName>已编辑< / finalName>
< plugins>
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
< version> 3.0< / version>
< configuration>
< encoding> ISO-8859-1< / encoding>
< source> 1.5< / source>
< target> 1.5< / target>
< / configuration>
< / plugin>
< / plugins>
< / build>
< / project>

我该如何解决?

解决方案

我也有同样的问题。在我的maven项目中添加速度依赖关系后,我在标记选项卡中得到相同的错误。然后我注意到maven项目创建的web.xml文件具有servlet2.3模式。当我将其更改为servlet 3.0模式并保存项目时,此错误消失。这是maven创建的web.xml文件

 <!DOCTYPE web-app PUBLIC 
- // Sun Microsystems,Inc.//DTD Web应用程序2.3 // EN
http://java.sun.com/dtd/web-app_2_3.dtd>

< web-app>
< display-name>原型创建的Web应用< / display-name>
< / web-app>

将其更改为

 < web-app xmlns =http://java.sun.com/xml/ns/javaee
xmlns:xsi =http://www.w3.org/2001 / XMLSchema-instance
xsi:schemaLocation =http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web -app_3_0.xsd
version =3.0>
< display-name>原型创建的Web应用< / display-name>

< / web-app>

保存项目,您的错误将消失。


I'm having a weird configuration problem with Maven in Eclipse. Although I can build the project and deploy it to tomcat without any errors, The Marker tab keeps showing the following message:

[-] Maven Java EE Configuration Problem
(x) JavaServer Faces 1.2 can not be installed : One or more constraints have not been satisfied.
(x) JavaServer Faces 1.2 requires Dynamic Web Module 2.5 or newer.

I am in fact using Dynamic Web Module 2.4, which would be the source of the message. I would need to change it to at least 2.5 to work with JSF. Problem is, I'm not even using JSF.

So, probably one of the project's dependencies needs it. I ran the following command to find out the dependency tree for my project:

mvn dependency:tree -DoutputFile=<i>/path/to/outputFile/dependencies.txt</i>

and surprise! No JSF 1.2 mentioned.

EDIT Forgot to add my PC setup:

OS: Ubuntu 12.10

Eclipse: 4.2 SR1

Java: jdk1.5.0_22 and jdk1.7

Apache Maven: 3.0.4

Maven home: /usr/share/maven

m2e: 1.3.1.20130219-1424

m2e-wtp: 0.17.0.20130212-1821

None of my co-workers are having this issue. Two of them use Windows, two use Ubuntu 12.10. One of them uses Eclipse 4.2, others use Eclipse 3.7. So apparently this is either has to do with 4.2SR1 or with my project setup. But I can't find where the problem is.

Here's my pom.xml file:

<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>edited</groupId>
    <artifactId>edited</artifactId>
    <packaging>war</packaging>
    <version>edited</version>
    <name>edited</name>
    <distributionManagement>
        <repository>
            <id>deployment</id>
            <name>Internal Releases</name>
            <url>http://edited/nexus/content/repositories/releases/</url>
        </repository>
        <snapshotRepository>
            <id>deployment</id>
            <name>Internal Releases</name>
            <url>http://edited/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>
    <dependencies>
        <!-- Testes com Junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <!-- Testes Funcionais com cucumber-jvm -->
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-spring</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.1.1</version>
            <scope>test</scope>
        </dependency>
        <!-- Mockito para criar mocks e stubs -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
        </dependency>
        <!-- Fixture Factory Test Data Builder -->
        <dependency>
            <groupId>br.com.fixturefactory</groupId>
            <artifactId>fixture-factory</artifactId>
            <version>2.1.0-SNAPSHOT</version>
            <scope>test</scope>
        </dependency>
        <!-- Jasper Reports -->
        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>4.5.1</version>
        </dependency>
        <!-- Struts 2 -->
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts.xwork</groupId>
            <artifactId>xwork-core</artifactId>
            <version>2.2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-tiles-plugin</artifactId>
            <version>2.2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-json-plugin</artifactId>
            <version>2.2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-jasperreports-plugin</artifactId>
            <version>2.2.1.1</version>
        </dependency>
        <!-- Banco de dados Mysql + Hibernate + c3p0 -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.22</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.3.1.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.4.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>3.1.0.GA</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.2.0.Final</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
        </dependency>
        <!-- <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> 
            <version>2.2.7</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> 
            <artifactId>jaxb-impl</artifactId> <version>2.2.6</version> </dependency> -->
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-c3p0</artifactId>
            <version>3.6.10.Final</version>
        </dependency>
        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
            <version>0.9.1.2</version>
        </dependency>
        <dependency>
            <groupId>javassist</groupId>
            <artifactId>javassist</artifactId>
            <version>3.3.GA</version>
        </dependency>
        <!-- Servlet API -->
        <dependency>
            <groupId>org.apache.tomcat</groupId>
            <artifactId>servlet-api</artifactId>
            <version>6.0.36</version>
        </dependency>
        <!-- Especificação do Java EE -->
        <dependency>
            <groupId>javax.mail</groupId>
            <artifactId>mail</artifactId>
            <version>1.4.5</version>
        </dependency>
        <dependency>
            <groupId>javaee</groupId>
            <artifactId>javaee-api</artifactId>
            <version>5</version>
            <scope>provided</scope>
        </dependency>
        <!-- Logging -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.2</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>1.7.2</version>
        </dependency>
        <!-- Apache Commons -->
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.4</version>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging-api</artifactId>
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>1.8.3</version>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.6</version>
        </dependency>
        <!-- Templating -->
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-core</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-api</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-servlet</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-template</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-compat</artifactId>
            <version>2.2.2</version>
        </dependency>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker-gae</artifactId>
            <version>2.3.19</version>
        </dependency>
        <!-- Quartz Scheduler -->
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>1.8.6</version>
        </dependency>
        <!-- Geração de Código -->
        <dependency>
            <groupId>cglib</groupId>
            <artifactId>cglib-nodep</artifactId>
            <version>2.2.2</version>
        </dependency>
        <!-- Xstream -->
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.3</version>
        </dependency>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>3.0.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>3.0.6.RELEASE</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>3.0.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.0.6.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-spring-plugin</artifactId>
            <version>2.1.8</version>
        </dependency>
        <!-- RestEasy -->
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxrs</artifactId>
            <version>2.0.1.GA</version>
        </dependency>
        <dependency>
            <groupId>org.jboss.resteasy</groupId>
            <artifactId>resteasy-jaxb-provider</artifactId>
            <version>2.0.1.GA</version>
        </dependency>
        <!-- Xfire -->
        <dependency>
            <groupId>org.codehaus.xfire</groupId>
            <artifactId>xfire-all</artifactId>
            <version>1.2.6</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-mock</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- JQuery -->
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>1.9.1</version>
        </dependency>
    </dependencies>
    <build>
        <finalName>edited</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <encoding>ISO-8859-1</encoding>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

How can I solve this?

解决方案

I had the same problem. After adding velocity dependencies in my maven project i was getting the same error in marker tab. Then I noticed that the web.xml file that maven project creates has servlet2.3 schema. When i changed it to servlet 3.0 schema and save the project then this error gone. Here is the web.xml file that maven creates

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 "http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
    <display-name>Archetype Created Web Application</display-name>
</web-app>

Change it to

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                        http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
                        version="3.0">
    <display-name>Archetype Created Web Application</display-name>

</web-app>

save the project, and your error would gone.

这篇关于Maven Java EE配置标记与Java服务器面对1.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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