【问题标题】:Failed to collect dependencies at org.apache.ignite:ignite-hibernate_5.1:jar无法在 org.apache.ignite:ignite-hibernate_5.1:jar 收集依赖项
【发布时间】:2018-08-04 11:44:55
【问题描述】:

我可以从 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 也说同样的事情 Failed to read artifact descriptor...,但是代码运行!!

这里是 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>

【问题讨论】:

  • 你用什么来创建jar? ignite-parent 是一个父模块,它没有任何工件,因此不需要。
  • @alamar 这是我使用的 jar 路径 -> ~/Desktop/apache-ignite-2.5.0-src/modules/hibernate-5.1/target/ignite-hibernate_5.1-2.5。 0.jar,对于这个链接 maven.apache.org/guides/mini/guide-3rd-party-jars-local.html –
  • @alamar 用于第二个链接 apacheignite.readme.io/docs/...,我已经在这个目录中运行了这个命令 ~/Desktop/apache-ignite-2.5.0-src, COMMAND= mvn clean install -DskipTests -Plgpl -pl modules/hibernate-5.1/ -am
  • 你用什么来创建你的 jar?
  • @alamar 我正在使用 onejar 插件,这可能是个问题?我以为我以错误的方式安装了 hibernate-core-5.1

标签: java hibernate maven ignite


【解决方案1】:

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

以下文档页面描述了它应该如何完成:https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

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

【讨论】:

【解决方案2】:

我浏览了你的用例,我已经下载了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,然后重复上述两个步骤。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-11-27
    • 1970-01-01
    • 2021-01-04
    • 2022-06-19
    • 2021-12-21
    • 1970-01-01
    • 2023-01-21
    • 1970-01-01
    相关资源
    最近更新 更多