0

I can run the code from intellji ide, but when i want to convert to jar file, i get an error like this(After mvn clean install) (I have known that ignite-hibernate is lgpl dependencies, and this dependency is in my local .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]

Now here is the pom.xml, also pom.xml says the same thing Failed to read artifact descriptor..., but code runs!!

here is pom.xml in detail:

<?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>

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
monstereo
  • 830
  • 11
  • 31
  • What are you using to create jar? `ignite-parent` is a parent module which doesn't have any artifacts and should not be needed. – alamar Aug 07 '18 at 14:18
  • @alamar Here is jar path that I have used -> ~/Desktop/apache-ignite-2.5.0-src/modules/hibernate-5.1/target/ignite-hibernate_5.1-2.5.0.jar, for this link maven.apache.org/guides/mini/guide-3rd-party-jars-local.html – – monstereo Aug 07 '18 at 16:16
  • @alamar for second link apacheignite.readme.io/docs/…, I have run this command in this directory ~/Desktop/apache-ignite-2.5.0-src, COMMAND= mvn clean install -DskipTests -Plgpl -pl modules/hibernate-5.1/ -am – monstereo Aug 07 '18 at 16:17
  • What are you using to create YOUR jar? – alamar Aug 07 '18 at 16:31
  • @alamar i am using onejar plugin, it can be a problem? I thought that i installed hibernate-core-5.1 in wrong way – monstereo Aug 07 '18 at 16:35
  • It's possible that it can. Please add onejar invocations in your question as well as detailed error messages. – alamar Aug 07 '18 at 16:37
  • @alamar I have added pom.xml in the question. However interestingly, jar file works without errors now, (nothing changed, just i opened the project file after a days). My curiosity is -> did i install hibernate jar file correctly? – monstereo Aug 07 '18 at 16:57
  • @alamar, could you look at my problem at https://stackoverflow.com/questions/51818313/apache-ignite-unable-to-locate-spring-namespacehandler-for-xml-schema-namespace – monstereo Aug 13 '18 at 08:40
  • @alamar Could look at this error? https://stackoverflow.com/questions/51840605/storm-causes-dependency-conflicts-on-ignite-log4j – monstereo Aug 14 '18 at 13:46

2 Answers2

0

You probably didn't install the jar into your local maven repository properly.

The following documentation page describes how it should be done: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html

You can also build and install ignite-hibernate_5.1 from sources: https://apacheignite.readme.io/docs/maven-setup#section-lgpl-dependencies

Denis
  • 3,573
  • 8
  • 13
  • I have followed https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html this one before. Now I have tried https://apacheignite.readme.io/docs/maven-setup#section-lgpl-dependencies this one. Using this command mvn clean install -DskipTests -Plgpl -pl modules/hibernate-5.1/ -am. At the end, it said "build success" but there is an error in the pom.xml same as the above, even now I can convert the project to jar file. – monstereo Aug 04 '18 at 13:16
  • Where did you get the jar? Is its version precisely equal to `2.5.0`? – Denis Aug 06 '18 at 07:18
  • Here is jar path that I have used -> ~/Desktop/apache-ignite-2.5.0-src/modules/hibernate-5.1/target/ignite-hibernate_5.1-2.5.0.jar, for this link https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html – monstereo Aug 06 '18 at 07:23
  • for second link https://apacheignite.readme.io/docs/maven-setup#section-lgpl-dependencies, I have run this command in this directory ~/Desktop/apache-ignite-2.5.0-src, COMMAND= mvn clean install -DskipTests -Plgpl -pl modules/hibernate-5.1/ -am – monstereo Aug 06 '18 at 07:24
0

I went through your use case, in that I have downloaded apache-ignite-2.5.0-src.zip, unpacked it in ~/Downloads, and from its root ran

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

After that I changed the directory to a project containing Maven pom.xml from your question, and ran

.../51685257% mvn package

It ran without errors and produced target/HibenateFinalCacheStore-1.0-SNAPSHOT.one-jar.jar.

I suspect you can have something poisonous in your ~/.m2 cache. I suggest running rm -rf ~/.m2 and then repeating two above-mentioned steps.

alamar
  • 18,729
  • 4
  • 64
  • 97