15

我目前正在使用 Maven 开发一个 Java 项目。在我的pom.xml我得到这个错误。

Missing artifact com.bea.xml:jsr173-ri:jar:1.0

我已经添加了这个依赖

<dependency>
        <groupId>com.bea.xml</groupId>
        <artifactId>jsr173-ri</artifactId>
        <version>1.0</version>
</dependency>

到我的pom.xml. 但错误仍然相同。

我是否缺少为jsr173-ri依赖项添加存储库?我也没有将存储库添加到我的pom.xml.

有人可以建议我jsr173-ri添加存储库代码pom.xml吗?

4

4 回答 4

13

com.bea.xml在公共存储库中不可用(下载大小为零)。因此,您需要下载 JAR 文件并将其手动安装到本地存储库中。

一些有用的链接:手动安装依赖

于 2012-12-31T09:42:28.943 回答
2

步骤 1:在 C:\Users\{your name}\.m2\repository\{dep jar 文件夹}\{version-RELEASE}\{missing jar} 中添加缺少的 jar

Step2:在Eclipse中,右击pom.xml -> 进入Maven -> Add Dependency Step3:在Enter groupId, artifactId中查找jar name Step4:在Search Results中选择:然后点击OK。

于 2016-01-15T18:25:24.847 回答
1

Are you sure this is causing the problem? Haven't you missed anything else?

Here is the complete configuration (pom.xml) which you might need:

<?xml version="1.0" encoding="UTF-8"?>
<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>com.bea.xml</groupId>
  <artifactId>jsr173-ri</artifactId>
  <version>1.0</version>
  <name>JSR 173 - Streaming API for XML - Reference Implementation</name>
  <description>JSR 173 - Streaming API for XML - Reference Implementation</description>
  <url>http://dev2dev.bea.com/xml/stax.html</url>
  <distributionManagement>
    <downloadUrl>http://ftpna2.bea.com/pub/downloads/jsr173.jar</downloadUrl>
  </distributionManagement>

  <licenses>
    <license>
      <name>BEA JSR 173 RI</name>
      <url>http://www.ibiblio.org/maven2/com/bea/xml/jsr173-ri/1.0/jsr173-ri-1.0-license.txt</url>
      <distribution>manual</distribution>
    </license>
  </licenses>

  <organization>
    <name>BEA</name>
    <url>http://www.bea.com</url>
  </organization>

  <dependencies>
    <dependency>
      <groupId>javax.xml</groupId>
      <artifactId>jsr173</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>

</project>
于 2012-12-31T10:51:43.250 回答
0

依赖是正确的......你不必改变它。你可以从 http://mvnrepository.com/artifact/com.bea.xml/jsr173-ri/1.0下载 jar并将它放在你的本地回购。

于 2012-12-31T10:03:03.523 回答