3

I'm currently trying to figure out how Qi4j works. So i decided to start with a simple example. I tried to use the Qi4j lib in my pom.xml and am now facing the problem, that the artifact can't be found. I'm using NetBeans 7.0.1 and my pom.xml parts are shown below:

<repository>
    <id>qi4j-official</id>
    <url>http://repository.ops4j.org/maven2</url>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>false</enabled>
    </snapshots>
</repository>

<dependency>
    <groupId>org</groupId>     
    <artifactId>org.qi4j</artifactId>
    <version>1.4</version>
</dependency>

I'm i doing something wrong? Thanks a lot.

eskatos
  • 4,174
  • 2
  • 40
  • 42
Alebon
  • 1,189
  • 2
  • 11
  • 24

3 Answers3

3

Qi4j consists of many many artifacts, to keep the total footprint down as most applications won't use all bits and pieces.

<groupId>org.qi4j.core</groupId>

contains the artifacts (as of 1.3)

<artifactId>org.qi4j.core.api</artifactId>
<artifactId>org.qi4j.core.spi</artifactId>
<artifactId>org.qi4j.core.runtime</artifactId>
<artifactId>org.qi4j.core.bootstrap</artifactId>
<artifactId>org.qi4j.core.testsupport</artifactId>

For "compile" scope api and bootstrap should be enough. testsupport is obviously "test" scope and runtime should not be used by your code and only be a "runtime" dependency.

<groupId>org.qi4j.library</groupId>

The Libraries varies greatly in completeness and quality. Extensions can depend on libraries but not the other way around.

<groupId>org.qi4j.extension</groupId>

Extensions implements the slowly growing SPI pluggable functionalities; entity stores, indexing/query and caching. Next release (2.0) will have more extensions for value serialization and others.

Hope that helps, or meet the Qi4j community at the qi4j-dev Google Group for additional support.

eskatos
  • 4,174
  • 2
  • 40
  • 42
1

Based what i can see in the given repository the groupId and artifactId are completely different...

http://repository.ops4j.org/maven2/org/qi4j/core/org.qi4j.core.spi/1.4/org.qi4j.core.spi-1.4.pom

khmarbaise
  • 92,914
  • 28
  • 189
  • 235
0

To learn how to depend on Qi4j in your build see the dedicated how-to that's now present on the Qi4j website: http://qi4j.org/latest/howto-depend-on-qi4j.html

Here are the release and snapshot repositories :

Weekly SNAPSHOTs are uploaded the snapshot repository so you need to add this url as a maven repository :

<repositories>
    [...]
    <repository>
        <id>qi4j-snapshots</id>
        <url>https://repository-qi4j.forge.cloudbees.com/snapshot/</url>
        <releases><enabled>false</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
    [...]
</repositories>

And then you can add dependencies to Qi4j:

<dependencies>
    [...]
    <dependency>
        <groupId>org.qi4j.core</groupId>
        <artifactId>org.qi4j.core.bootstrap</artifactId>
        <version>QI4J_VERSION</version>
    </dependency>
    <dependency>
        <groupId>org.qi4j.core</groupId>
        <artifactId>org.qi4j.core.runtime</artifactId>
        <version>QI4J_VERSION</version>
    </dependency>
    [...]
</dependencies>

Where QI4J_VERSION is the version you want to use.

eskatos
  • 4,174
  • 2
  • 40
  • 42