简体   繁体   English

Eclipse表示:Web Fragment Module 3.0需要Java 1.6或更高版本,但我的项目方面未设置

[英]Eclipse says: Web Fragment Module 3.0 requires Java 1.6 or newer, but my project facets are not set

I'm working on a java maven project and eclipse complains with this message on the title. 我正在研究Java Maven项目,并且eclipse在标题上抱怨此消息。

But if I look at my project facets, they're not checked, as you can see on this image: 但是,如果我查看我的项目构面,就不会对其进行检查,如您在此图像上所看到的:

在此处输入图片说明

Also on my pom.xml, I see nothing about this configuration: 同样在我的pom.xml上,我对此配置一无所知:

<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>nl.zin</groupId>
    <artifactId>commons-web</artifactId>
    <version>1.0.6-SNAPSHOT</version>
    <name>ZiN Commons Web Utilities</name>

    <properties>
        <version.cxf>2.7.0</version.cxf>
        <version.twitterbootstrap>3.1.1</version.twitterbootstrap>
        <version.zin.commons>1.0.0</version.zin.commons>
        <version.servlet>3.0.1</version.servlet>
        <javax.jsp.version>2.3.0</javax.jsp.version>
        <javax.jstl.version>1.2</javax.jstl.version>
        <org.spring.version>3.2.8.RELEASE</org.spring.version>
    </properties>

    <dependencies>
        <!-- Java EE -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${version.servlet}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>${javax.jsp.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>${javax.jstl.version}</version>
        </dependency>

        <!-- ZiN -->
        <dependency>
            <groupId>nl.zin</groupId>
            <artifactId>commons</artifactId>
            <version>${version.zin.commons}</version>
        </dependency>
        <!-- Twitter bootstrap -->
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
            <version>2.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap</artifactId>
            <version>3.1.1</version>
            <exclusions>
                <exclusion>
                    <artifactId>jquery</artifactId>
                    <groupId>org.webjars</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>bootstrap-datepicker</artifactId>
            <version>1.3.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.webjars</groupId>
                    <artifactId>bootstrap</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.spring.version}</version>
        </dependency>

        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${version.cxf}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${version.cxf}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http-jetty</artifactId>
            <version>${version.cxf}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-ws-security</artifactId>
            <version>${version.cxf}</version>
        </dependency>

        <!-- Added for WS-Security Interceptor -->
        <dependency>
            <groupId>org.apache.ws.security</groupId>
            <artifactId>wss4j</artifactId>
            <version>1.5.8</version>
        </dependency>

        <!-- Log4j -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>provided</scope>
        </dependency>       

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <!-- https://code.google.com/p/mockito/ -->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${version.cxf}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>src/main/interfaces/GebruikerService.wsdl</wsdl>
                                    <extraargs>
                                        <extraarg>-client</extraarg>
                                    </extraargs>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

So how does Eclipse known that this is a Web Fragment 3.0? 那么Eclipse如何知道这是Web Fragment 3.0?

I see now that it contains a web-fragment.xml file under /META-INF, so that might be giving it away. 现在,我看到它在/ META-INF下包含一个web-fragment.xml文件,因此可能会将其释放了。 :) :)

I added this to my pom.xml and it seems to have gotten rid of the error message: 我将此添加到我的pom.xml中,似乎已经摆脱了错误消息:

        <plugin> 
            <groupId>org.apache.maven.plugins</groupId> 
            <artifactId>maven-compiler-plugin</artifactId> 
            <configuration> 
                <source>1.7</source> 
                <target>1.7</target> 
            </configuration> 
        </plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Eclipse- Dynamic Web Module 3.0 requires Java 1.6 or newer while creating new project 错误 - Eclipse- Dynamic Web Module 3.0 requires Java 1.6 or newer error while creating new project 类型Dynamic Web Module 3.0需要Java 1.6或更高版本的java插件错误 - Type Dynamic Web Module 3.0 requires Java 1.6 or newer, java plugin error Dyanamic Web模块3.0需要Java 1.6或更高版本 - Dyanamic web module 3.0 required java 1.6 or newer 什么是Eclipse“动态Web模块”数字,为什么项目构面列表中没有JAX-RS? - What is Eclipse “Dynamic Web Module” number, why isn't JAX-RS in the project facets list? 即使我的java是1.7,也无法将Project Facet动态Web模块的版本更改为3.0 - cannot change version of project facet dynamic web module to 3.0 even if my java is 1.7 一切正常,但仍然出现 -> Type Dynamic Web Module 4.0 requires Java 1.8 or newer - Everything right, but still appearing -> Type Dynamic Web Module 4.0 requires Java 1.8 or newer 日食中缺少Project Facets - Project Facets is missing in eclipse Eclipse Java Maven项目禁用dafault项目方面 - Eclipse Java Maven project disable dafault project facets 如何在Eclipse中的现有Java项目中添加Web项目模块 - How to add web project module in existing java project in eclipse 更新到 App Engine Java 11 标准环境:Eclipse 中的项目方面 - Updating to App Engine Java 11 Standard Environment: Project Facets in Eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM