无法在org.apache.ignite:ignite-hibernate_5.1:jar上收集依赖项

时间:2018-08-04 11:44:56

标签: java apache hibernate maven ignite

我可以从intellji ide运行代码,但是当我想转换为jar文件时,出现这样的错误(在mvn clean install之后) (我知道ignite-hibernate是lgpl依赖项,并且此依赖项位于我的本地.m2-> /.m2/repository/org/apache/ignite/ignite-hibernate_5.1 $

Failed to collect dependencies at org.apache.ignite:ignite-hibernate_5.1:jar:2.5.0: Failed to read artifact descriptor for org.apache.ignite:ignite-hibernate_5.1:jar:2.5.0: Failure to find org.apache.ignite:ignite-parent:pom:1 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

现在这是pom.xml,pom.xml也说了同样的事情未能读取工件描述符...,但是代码运行了!

这是pom.xml的详细信息:

<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.HibenateFinalCacheStore</groupId>
<artifactId>HibenateFinalCacheStore</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>7</source>
                <target>7</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.jolira</groupId>
            <artifactId>onejar-maven-plugin</artifactId>
            <version>1.4.4</version>
            <executions>
                <execution>
                    <id>build-query</id>
                    <configuration>
                        <mainClass>hibernateCacheStore.MainApp</mainClass>
                        <attachToBuild>true</attachToBuild>
                        <classifier>onejar</classifier>
                    </configuration>
                    <goals>
                        <goal>one-jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-core</artifactId>
        <version>2.5.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-spring</artifactId>
        <version>2.5.0</version>
    </dependency>

    <dependency>
        <groupId>org.apache.ignite</groupId>
        <artifactId>ignite-hibernate_5.1</artifactId>
        <version>2.5.0</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>5.1.0.Final</version>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.1-901-1.jdbc4</version>
    </dependency>

</dependencies>

2 个答案:

答案 0 :(得分:0)

您可能没有将jar正确地安装到本地Maven存储库中。

以下文档页面介绍了如何完成此操作:https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

您还可以从以下来源构建和安装ignite-hibernate_5.1https://apacheignite.readme.io/docs/maven-setup#section-lgpl-dependencies

答案 1 :(得分:0)

我经历了您的用例,因为我下载了apache-ignite-2.5.0-src.zip,将其解压缩到~/Downloads中,并从其根目录运行

.../apache-ignite-2.5.0-src% COMMAND= mvn clean install -DskipTests -Plgpl -pl modules/hibernate-5.1/ -am

之后,我将目录更改为包含您问题中的Maven pom.xml的项目,然后运行

.../51685257% mvn package

它运行正常且产生了target/HibenateFinalCacheStore-1.0-SNAPSHOT.one-jar.jar

我怀疑您的~/.m2缓存中可能有毒。我建议运行rm -rf ~/.m2,然后重复上述两个步骤。