2014-04-05 207 views
0

這裏是我使用的兩個jar文件/javax.json-api-1.0-2.8.jar和javax.websocket-API-1.0.jar pom.xml中無法找到Maven依賴?

 <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/xsd/maven-4.0.0.xsd"> 
     <modelVersion>4.0.0</modelVersion> 

    <groupId>org.sample</groupId> 
    <artifactId>whiteboard</artifactId> 
    <version>1.0-SNAPSHOT</version> 
    <packaging>war</packaging> 

    <name>whiteboard</name> 

    <properties> 
    <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <netbeans.hint.deploy.server>gfv3ee6</netbeans.hint.deploy.server> 
    </properties> 

    <repositories> 
    <repository> 
     <id>java.net-promoted</id> 
     <url>https://maven.java.net/content/groups/promoted/</url> 
    </repository> 
    </repositories> 


    <build> 
    <finalName>whiteboard</finalName> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-war-plugin</artifactId> 
      <version>2.1.1</version> 
      <configuration> 
       <failOnMissingWebXml>false</failOnMissingWebXml> 
      </configuration> 
     </plugin> 
     </plugins> 
    </build> 
    <dependencies> 
    <dependency> 
     <groupId>javax.websocket</groupId> 
     <artifactId>javax.websocket-api</artifactId> 
     <version>1.0</version> 
     <type>jar</type> 
    </dependency> 
     <dependency> 
     <groupId>javax.json-api-1.0</groupId> 
     <artifactId>javax.json-api-1.0</artifactId> 
     <version>2.8</version> 
     <type>jar</type> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.1</version> 
    </dependency> 
    </dependencies> 
    </project> 

。 當我跑我的項目會出現以下異常

未能就項目執行白板目標:無法解析項目org.sample依賴關係:白板:戰爭:1.0快照:無法收集依賴關係[javaee- api:javax:jar:7.0-b77(compile),javax.websocket:javax.websocket-api:jar:1.0(compile),javax.json-api-1.0:javax.json-api-1.0:jar:2.8編譯)]:無法讀取javaee-api的工件描述符:javax:jar:7.0-b77:無法將工件javaee-api:javax:pom:7.0-b77從/傳輸到中心(http://repo.maven.apache.org/maven2):repo.maven.apache .org:未知主機repo.maven.apache.org - > [Help 1]

回答