【发布时间】: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