15

I am currently working on a Java project using Maven. In my pom.xml I am getting this error.

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

I have added this dependency

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

to my pom.xml. But still the error is same.

Am I missing adding repository for jsr173-ri dependency? I am also not getting repository to add in my pom.xml.

Can someone suggest me repository code for jsr173-ri to add in my pom.xml?

Arslan Ali
  • 17,418
  • 8
  • 58
  • 76
code_fish
  • 3,381
  • 5
  • 47
  • 90
  • 1
    Maybe you will find the solution here: http://stackoverflow.com/questions/6111408/maven2-missing-artifact-but-jars-are-in-place – Werner Kvalem Vesterås Dec 31 '12 at 09:34
  • 1
    I'm wondering where this dependency is coming from to be honest. Perhaps you can exclude it because it is only for runtime purposes and is provided by the enterprise container? – Gimby Dec 31 '12 at 09:45
  • Actually earlier this project was not configured for maven. But now I am working to migrate it to maven and I am writng pom.xml for same. So can i exclude this dependency from Maven dependency from Maven Build Path? Because I am almost done and I don't know from where it is ruining my whole work. – code_fish Dec 31 '12 at 09:49
  • 1
    My maven repository also has this jar missing. It's strange. Maybe it was not installed/published properly. – Mawia Dec 31 '12 at 09:53
  • @Mawia Have you found any solution for same? – code_fish Dec 31 '12 at 11:33
  • @arun Well, if the jar itself is not available from maven repository, all you can do is install it in your local repository. – Mawia Dec 31 '12 at 11:43
  • @Mawia yes, may be that is the only solution. Thanks ! – code_fish Dec 31 '12 at 12:04

4 Answers4

13

com.bea.xml is not available in public repositories(Download size is zero). Therefore you need to download the JAR file and manually install it in to your local repo.

Some useful links: Manually install dependency

Chandana
  • 2,578
  • 8
  • 38
  • 55
  • 2
    Location to download `com.bea.xml` 1.0 jar : com.bea.xml `http://www.mmbase.org/maven2/com/bea/xml/jsr173-ri/1.0/jsr173-ri-1.0.jar` – Chandana Dec 31 '12 at 09:44
2

Step1: Add that missing jar in C:\Users\{your name}\.m2\repository\{dep jar folder}\{version-RELEASE}\{missing jar}

Step2: In Eclipse, right click on pom.xml -> go to Maven ->Add Dependency Step3: Look for jar name in Enter groupId, artifactId Step4: Select it in Search Results: and click OK.

Arpita
  • 21
  • 1
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>
Matin Kh
  • 5,192
  • 6
  • 53
  • 77
  • I have a pom.xml in which I have added dependency of whole project. But at the first line of pom.xml it is showing missing artifact error. After that i added dependency code for jsr173 in my pom.xml but the error persist. – code_fish Dec 31 '12 at 11:02
  • I have changed the `dependency` part of your desired library, as you might already have noticed. Have checked that? – Matin Kh Dec 31 '12 at 11:10
  • I have alreday tried that one. But error persists. I think problem is in repository. As I am getting from @Chandana answer, may be it is not available in public repository. I have to add jar file for same. – code_fish Dec 31 '12 at 11:17
  • 1
    You don't have to add a file to your repository. You add a `dependency` and maven downloads it for you and puts it in the repository. In this case (_which must have given you another error_) delete that specific folder (which should contain your jar file) and rebuild your project. – Matin Kh Dec 31 '12 at 11:27
  • I have decied to add jar file by using this code: mvn install:install-file -DgroupId=com.bea.xml -DartifactId=jsr173-ri -Dversion=1.0 -Dpackaging=jar -Dfile=E:\arun\jar\jsr173-ri-1.0.jar -DgeneratePom=true. I am not adding it explicitly. Isn't this right way? – code_fish Dec 31 '12 at 11:32
  • What's the difference anyway? You shouldn't be doing that. – Matin Kh Dec 31 '12 at 11:44
  • But this jar is not avialbale in public repository :( How can maven download this jar? – code_fish Dec 31 '12 at 12:06
  • 1
    I found it in the maven repository website. It sure can be downloaded. Search it for yourself. I strongly feel the problem lies in another place. – Matin Kh Dec 31 '12 at 12:14
0

dependency is correct....u don't have to change that.You can download the the jar from http://mvnrepository.com/artifact/com.bea.xml/jsr173-ri/1.0 and put it on ur local repo.

Mantu Singh
  • 252
  • 1
  • 3
  • 11