在Eclipse上构建Maven项目的Java版本冲突(Luna 4.4)

时间:2014-11-07 12:54:42

标签: java eclipse maven jboss

我在eclipse luna上构建maven项目时遇到以下错误。

JAX-RS (REST Web Services) 2.0 can not be installed : One or more constraints have not been satisfied. Maven Java EE Configuration Problem

我使用以下内容:

eclipse:luna 4.4
java:1.7

已添加jboss-tools-luna-4.2.0 final

下面是我的pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd“>     4.0.0     com.pb.potraitIo     bookstoreTeamcity     0.0.1-SNAPSHOT     战

<properties>

    <!-- Generic properties13 -->
    <java.version>1.7</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Web -->
    <jsp.version>2.2</jsp.version>
    <jstl.version>1.2</jstl.version>
    <servlet.version>3.1.0</servlet.version>


    <!-- Spring -->
    <spring-framework.version>3.2.3.RELEASE</spring-framework.version>

    <!-- Hibernate / JPA -->
    <hibernate.version>4.2.1.Final</hibernate.version>

    <!-- Logging -->
    <logback.version>1.0.13</logback.version>
    <slf4j.version>1.7.5</slf4j.version>

    <!-- Test -->
    <junit.version>4.11</junit.version>

    <!--  Initial build version was 3.0.2 This does not seem to be compatible with either java 7 or java 8 -->
    <cxf.version>3.0.2</cxf.version>


</properties>

<dependencies>

    <!-- Spring MVC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>

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

    <!-- Spring and Transactions -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>${spring-framework.version}</version>
    </dependency>

    <!-- Logging with SLF4J & LogBack -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>runtime</scope>
    </dependency>

    <!-- Hibernate -->
    <!-- <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> 
        <version>${hibernate.version}</version> </dependency> -->


    <!-- Test Artifacts -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${spring-framework.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxrs</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf.version}</version>
    </dependency>
    <!-- <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId> 
        <version>${cxf.version}</version> </dependency> -->

    <!-- <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxrs</artifactId> 
        <version>${cxf.version}</version> <scope>compile</scope> </dependency> -->

</dependencies>
<build>
    <finalName>bookstoreTeamcity</finalName>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <version>1.1.3</version>
                <configuration>
                    <configuration>
                        <properties>
                            <cargo.remote.username>admin</cargo.remote.username>
                            <cargo.remote.password/>
                        </properties>
                    </configuration>
                    <container>
                        <containerId>tomcat6x</containerId>
                    </container>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
<profiles>
    <profile>
        <id>cargo-run</id>
        <build>
            <defaultGoal>validate</defaultGoal>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.cargo</groupId>
                    <artifactId>cargo-maven2-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>cargo-run</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <configuration>
                            <home>${project.build.directory}/tomcat6x</home>
                            <properties>
                                <catalina.servlet.uriencoding>UTF-8</catalina.servlet.uriencoding>
                                <cargo.jvmargs>
                                <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -noverify]]>
                                </cargo.jvmargs>
                            </properties>
                        </configuration>
                        <container>
                            <zipUrlInstaller>
                                <downloadDir>
                                    ${settings.localRepository}/org/codehaus/cargo/cargo-container-archives
                                </downloadDir>
                                <url>
                                    http://mirror.tcpdiag.net/apache/tomcat/tomcat-6/v6.0.41/bin/apache-tomcat-6.0.41.zip
                                </url>
                            </zipUrlInstaller>
                            <timeout>600000</timeout>
                        </container>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

  

块引用

我通过以下方式构建了这个项目: 导入 - &gt; maven - &gt;现有的maven项目

此外java编译器设置指向jdk 1.7

附加项目分面屏幕截图。

有人可以对其决议有所了解吗?enter image description here

0 个答案:

没有答案