3

I have added two jar files to my internal repository and created its corresponding folder directory as shown below in image. but it is showing compile time error in my pom.xml where i have added the dependency for both the jars, saying "Missing artifact common:common-jar:jar:1.0" and "Missing artifact mediator:mediator-jar:jar:1.0"

enter image description here

look at my pom.xml below

<properties>
    <jdk.version>1.7</jdk.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Maven plugin & MOJO versions -->
    <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin>
</properties>

<repositories>
    <repository>
        <id>in-project</id>
        <name>In Project Repo</name>
        <url>file://${basedir}/libs</url>
    </repository>
</repositories>

<dependencies>

    <dependency>
        <groupId>common</groupId>
        <artifactId>common-jar</artifactId>
        <version>1.0</version>
    </dependency>

    <dependency>
        <groupId>mediator</groupId>
        <artifactId>mediator-jar</artifactId>
        <version>1.0</version>
    </dependency>

</dependencies>

please suggest what to do.

I think there is some problem identifying value for ${basedir} but i have also tried ${project.basedir} as well, it is also not working.

Fabien
  • 859
  • 6
  • 15
RaT
  • 1,134
  • 3
  • 12
  • 28
  • I don't want to save jars in local repository using install:install-file, My requirement is to do this with internal repository. – RaT May 01 '15 at 10:07
  • 1
    Have you tried moving both libraries up to your `/lib` folder? – Tavo May 01 '15 at 10:07
  • Not sure but I think you may need to look into the [Apache Maven Remote Resources Plugin] (http://maven.apache.org/plugins/maven-remote-resources-plugin/). You can get some help from here [SO link] (http://stackoverflow.com/questions/21755839/maven-remote-resource-plugin-issue) – Garry May 01 '15 at 10:17
  • @Tavo you mean placing jars directly at libs folder without creating folder structure libs/common/common-jar/1.0. right? – RaT May 01 '15 at 10:19
  • Yes, just that. Can you try? – Tavo May 01 '15 at 10:20
  • @xerx593 i have menthin in my pom the url to libs folder when i create the repository , using this "file://${basedir}/libs" – RaT May 01 '15 at 10:21
  • It should work since I have used same in project also just try to change `file://${basedir}/libs` to `file://${basedir}/src/libs` and put libs into src. – ersnh May 01 '15 at 10:21
  • @ns12 how is that? The `libs` folder is not inside `src`. It hangs directly from the project folder. – Tavo May 01 '15 at 10:22
  • @Tavo placing it directly in libs not working – RaT May 01 '15 at 10:23
  • 1
    @RahulTyagi try removing the two slashes at the beginning: `file:${basedir}/libs` – Tavo May 01 '15 at 10:25
  • yes, libs folder is not in src, it is not working – RaT May 01 '15 at 10:26
  • 1
    wow thanku so much @Tavo removing slash makes it working.......thank you :-) – RaT May 01 '15 at 10:28
  • 1
    Glad to help. It's sometimes hard to spot these issues. I'm sure you can put your jars inside their original folders and they will work just fine. – Tavo May 01 '15 at 10:31

2 Answers2

3

The problem lies in your url tag. Instead of <url>file://${basedir}/libs</url> try removing the double slash before ${basedir}: <url>file:${basedir}/libs</url>

You have a nice guide here if you want to check it.

Tavo
  • 3,087
  • 5
  • 29
  • 44
0

First : Never use <scope>system</scope>

Follow the Example: Project folder - C:\UX\X5SCX\GIT_STORE\SRC\FACTOR\fwk\broker\lib

  <repositories>
            <repository>
                <id>local-repo</id>
                <url>file://${basedir}/lib</url>
            </repository>
        </repositories>

<dependencies>
        <dependency>
            <groupId>ews</groupId>
            <artifactId>ews-java-api</artifactId>
            <version>2.0</version>
        </dependency>
</dependencies>

enter image description here

Tiago Medici
  • 1,944
  • 22
  • 22