Qi4j maven configuration - maven

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.

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.

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

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 :
https://repository-qi4j.forge.cloudbees.com/release/
https://repository-qi4j.forge.cloudbees.com/snapshot/
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.

Related

Why maven is not able to download "SNAPSHOT" artifacts from azure artifacts repository? (Snapshot translation to timestamp is malfunctioning)

Maven is not able to download artifact when referred by version such as 'XXX-SNAPSHOT' but it is able to download every other dependency from it. It even download the SNAPSHOT if & only if I replace 'SNAPSHOT' by the real timestamp, for example, replace 155-SNAPSHOT by 155-20220224.175558-1.
We are hosting SNAPSHOTS and releases both under the same azur artifact feed. Any advice on how to approach/fix this missing snapshot translation to timestamp?
I wasn't able find the detailed documentation on how this snapshot translation mechanism works on client or server side, can anyone please point it to me?
<dependency>
<groupId>com.st.services.clients</groupId>
<artifactId>st-ccs-web-service</artifactId>
<!-- <version>155-SNAPSHOT</version> --><!-- not works -->
<version>155-20220224.175558-1</version>
</dependency>
<repositories>
<repository>
<name>My Hosted Maven Repo Group</name>
<id>maven-feed</id>
<url>https://pkgs.dev.azure.com/my-org/my-project/_packaging/maven-feed/maven/v1
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
Not the outcome you were after, but,
Having also tried this myself, I think Azure DevOps simply does not support this.
There are a few aspects of Azure DevOps's Artifacts feature that doesn't entirely align with Maven/how Maven does things. Unfortunately, this appears to be one of them.
(An example of another is the management of timestamped snapshots of the same version as individual versions, which Sonatype Nexus can do but DevOps Artifacts cannot).

Import component from add-on directory

I am using Vaadin version 21.0.7 with Spring Boot and i want to import Paginator add-on.
I have added addon's groupId in applicaton.properties as follows: vaadin.whitelisted-packages=com.test.demo,com.vaadin.componentfactory.
The problem is that i get the following error: Paginator cannot be resolved to a type.
Some questions you may want to update your question with answers to:
Are you using Maven? Gradle? Something else?
JDK version?
Is the error a compile-time one? If so, you should add the full output to your question.
Now, for a potential solution:
Assuming you are using Maven...
(1) Make sure that Maven resolved the dependency.
Your IDE should tell you if not, or you can check your local .m2 directory. On Windows, it is located at ${user.home}. On macOS and most Unix/Linux distributions, it is located at ~. Check .m2/repositories/com/vaadin/componentfactory/paginator/<version>/ and ensure that the JARs were downloaded.
If they were not, make sure you
(a) defined the Vaadin Addons repository in your POM, e.g.,
<repositories>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
</repository>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
(b) and defined the dependency, e.g.,
<dependencies>
<dependency>
<groupId>com.vaadin.componentfactory</groupId>
<artifactId>paginator</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
(2) Are you using Jigsaw (Java 9+ modules)?
If you are, make sure you specified the dependency:
module myModule {
requires paginator;
}

Maven:Including jars from remote repository

I wish to include jars present under \10.171.98.23 system [ex:\10.171.98.23\workspace\Project\lib] in my pom.xml by making use of remote repository concept.
How it could be achieved in Maven?Any suggestions would be more useful to proceed
The simplest example would be:
<repositories>
<repository>
<id>my-internal-site</id>
<url>http://myserver/repo</url>
</repository>
</repositories>
Check the documentation for more détails. You could also have a look at Maven the reference guide.

Maven Tycho: Cannot add artifact descriptor which has not been created by this repository

I'm trying to build an RCP application via Tycho and I receive this error when exporting the product.
I don't really understand the issue, but could it be that the reason why it fails it's because I'm using multiple P2 repositories to retrieve my plugins dependencies?
This is the snipped of the repositories I've defined in my parent POM. The rest is pretty standard Tycho.
<repositories>
<repository>
<id>eclipse-luna</id>
<url>${eclipseLuna}</url>
<layout>p2</layout>
</repository>
<repository>
<id>systems-rc-p2</id>
<url>${systemsRcP2}</url>
<layout>p2</layout>
</repository>
<repository>
<id>systems-snapshots-p2</id>
<url>${systemsSnapshotsP2}</url>
<layout>p2</layout>
</repository>
</repositories>
I found the issue.
Basically for some reason (project needs) I had to change the "sourceDirectory" and the "outputDirectory" of the project, pointing them to the classic "src" and "bin" instead of the Maven default "src/main" and "target".
In particular, what was causing the issue was the redefinition of the <outputDirectory> property and the <directory> one. It looks like Tycho does not like it at all.

Maven repository for QuickFIX/J library

I am using QuickFIX/J in the newest version (1.6.0) and want you to ask if you know any Maven repositories to integrate in my pom file?
I could manually add the jar files to my local repository but maybe there is a nicer and quicker way.
QuickFIX/J version 1.6 and newer can now be found in Marketcetera repository.
Add repository to your Maven pom file:
<repositories>
<repository>
<id>marketcetera</id>
<url>http://repo.marketcetera.org/maven</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
And then the artifact:
<dependency>
<groupId>quickfixj</groupId>
<artifactId>quickfixj-all</artifactId>
<version>${quickfix.version}</version>
</dependency>
${quickfix.version} can be 1.6.0, 1.6.1, or 1.7.0-SNAPSHOT, but also older version are available there. They host both floating point-based and BigDecimal-based versions. The default is floating point. To use BigDecimal versions, append '-bd' to the version.
EDIT (13th August '15):
Unfortunately this QuickFIX/J bundle does NOT contain dependent Apache Mina library for network transportation, you have to add also this to your Maven pom file:
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>${apache.mina.version}</version>
</dependency>
where ${apache.mina.version} is actual version of library (these days it's 2.0.9).
Without that you will be getting NoClassDefFound exceptions.
UPDATE (22.7.2016):
Good news!
Since the release of new QuickFIX/J version 1.6.2 the library is now available from official Maven repository so the only thing you need is following artifact in your pom.xml file:
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-core</artifactId>
<version>1.6.2</version>
</dependency>
More info at official pages.
You can use the Marketcetera repository. Add this to the list of repositories in your POM:
<repositories>
<repository>
<id>MarketceteraRepo</id>
<url>http://repo.marketcetera.org/maven</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
By the way, you could have looked up this information from the QuickFIX/J User Manual.
Marketcetera switched to using org.quickfix for the group ID, so the proper Maven dependency is:
<dependency>
<groupId>org.quickfixj</groupId>
<artifactId>quickfixj-all</artifactId>
<version>1.6.2-bd-SNAPSHOT</version>
</dependency>

Resources