简体   繁体   English

maven内部存储库中缺少工件

[英]Missing artifact in maven internal repository

I have added two jar files to my internal repository and created its corresponding folder directory as shown below in image. 我已经将两个jar文件添加到我的内部存储库并创建了相应的文件夹目录,如下图所示。 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" 但是它在我的pom.xml中显示编译时错误,其中我已经为两个jar添加了依赖项,说“Missing artifact common:common-jar:jar:1.0”和“Missing artifact mediator:mediator-jar:jar:1.0 “

在此输入图像描述

look at my pom.xml below 看看我下面的pom.xml

<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. 我认为确定$ {basedir}的价值存在一些问题,但我也尝试了$ {project.basedir} ,它也无法正常工作。

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> 而不是<url>file://${basedir}/libs</url>尝试在${basedir}之前删除双斜杠: <url>file:${basedir}/libs</url>

You have a nice guide here if you want to check it. 你有一个很好的指南在这里 ,如果你想检查一下。

First : Never use <scope>system</scope> 第一:绝不使用<scope>system</scope>

Follow the Example: Project folder - C:\\UX\\X5SCX\\GIT_STORE\\SRC\\FACTOR\\fwk\\broker\\lib 按照示例:项目文件夹 - 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>

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM