1

我正在开发一个 java maven 项目,eclipse 在标题上抱怨这条消息。

但是,如果我查看我的项目方面,它们不会被检查,正如您在这张图片中看到的那样:

在此处输入图像描述

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

4

1 回答 1

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>
于 2015-02-16T16:58:48.313 回答