简体   繁体   English

Maven找不到存储库中已存在的工件

[英]Maven could not find artifact that already exists in repository

I run "mvn install" in command line and get stuck by below error. 我在命令行中运行“mvn install”并被下面的错误卡住了。

Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.detux.vios:common-entity:jar:2_0_0: 
Could not find artifact org.hibernate:hibernate-entitymanager:jar:3.6.2.FINAL in central (http://repo.maven.apache.org/maven2)

I check in m2\\repository\\org\\hibernate\\hibernate-entitymanager\\3.6.2.FINAL\\, here is its contents 我检查m2 \\ repository \\ org \\ hibernate \\ hibernate-entitymanager \\ 3.6.2.FINAL \\,这里是它的内容

在此输入图像描述

I've also tried to add new remote repository to pom.xml but it still doesn't work 我还尝试将新的远程存储库添加到pom.xml,但它仍然无效

<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>
    <parent>
        <artifactId>common</artifactId>
        <groupId>com.detux.vios</groupId>
        <version>2_0_0</version>
    </parent>
    <groupId>com.detux.vios</groupId>
    <artifactId>common-entity</artifactId>
    <version>${common.version}</version>
    <name>Vios Common entity</name>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>${hibernate.version}</version>
        </dependency>
        <dependency>
            <groupId>com.detux.vios</groupId>
            <artifactId>common-util</artifactId>
            <version>${common.version}</version>
        </dependency>
    </dependencies>
    <properties>
    </properties>
    <repositories>
        <repository>
            <id>repository.jboss.org-public</id>
            <name>JBoss repository</name>
            <url>http://repository.jboss.org/nexus/content/groups/public</url>
        </repository>
    </repositories>
</project>

Below is pom.xml of parent project 下面是父项目的pom.xml

<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>com.detux.vios</groupId>
    <artifactId>common</artifactId>
    <version>2_0_0</version>
    <packaging>pom</packaging>
    <name>Vios Common</name>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>jar-test-classes</id>
                        <phase>package</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <properties>
        <commons-jxpath.version>1.3</commons-jxpath.version>
        <common.version>2_0_0</common.version>
        <spring.version>3.0.5.RELEASE</spring.version>
        <spring.integration.version>2.0.4.RELEASE</spring.integration.version>
        <hibernate.version>3.6.2.FINAL</hibernate.version>
        <maven-jaxb2-plugin.version>0.7.4</maven-jaxb2-plugin.version>
        <commonsbeanutils.version>1.8.3</commonsbeanutils.version>
        <commons-lang.version>2.6</commons-lang.version>
    </properties>
    <modules>
        <module>common-model</module>
        <module>common-entity</module>
        <module>common-storage</module>
        <module>common-util</module>
        <module>common-service</module>
        <module>common-service-business</module>
        <module>common-service-resource</module>
        <module>common-catalog</module>
        <module>common-xml-jaxb2</module>
    </modules>
</project>

I am not sure how this could have happened, but the central has this artifact but with Final in its folder path and not FINAL . 我不确定这是怎么发生的,但是中心有这个神器但是在其文件夹路径中有Final而不是FINAL

Can you change your pom.xml to use Final and delete the existing local repository folder m2\\repository\\org\\hibernate\\hibernate-entitymanager\\3.6.2.FINAL so that it can download again? 你能改变你的pom.xml以使用Final并删除现有的本地存储库文件夹m2\\repository\\org\\hibernate\\hibernate-entitymanager\\3.6.2.FINAL以便它可以再次下载吗?

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

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