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

时间:2015-02-16 16:14:49

标签: java eclipse maven web-fragment

我正在研究一个java maven项目,并且eclipse在标题上抱怨这个消息。

但如果我查看我的项目方面,他们就不会检查,正如您在此图片中看到的那样:

enter image description here

同样在我的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>

那么Eclipse如何知道这是一个Web Fragment 3.0?

1 个答案:

答案 0 :(得分:1)

我现在看到它在/ META-INF下包含一个web-fragment.xml文件,因此可能会将其丢弃。 :)

我将此添加到我的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>