Maven spring-data-elasticsearch dependency Not Found - spring

I have a spring boot app for which I want to use the dependency spring-data-elasticsearch. I'm using one of the latest version of Elasticsearch on my server (v5.4.x) so I had to use the latest snapshot of spring-data-elasticsearch (3.0.0.BUILD-SNAPSHOT).
According to the git page (link below) :
https://github.com/spring-projects/spring-data-elasticsearch/blob/master/README.md
I have to declare in my pom.xml a special repository where is located this specific version of the dependency, as you can see below :
<repositories>
<repository>
<id>spring-libs-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/libs-snapshot</url>
</repository>
</repositories>
<dependencies>
<!-- ELK -->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-elasticsearch</artifactId>
<version>3.0.0.BUILD-SNAPSHOT</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- MySQL -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
</dependencies>
But I have the following error on my pom.xml :
Missing artifact org.springframework.data:spring-data-elasticsearch:jar:3.0.0.BUILD-SNAPSHOT
Anyone knows where the problem is coming from please ? I'm pulling hairs out of my head since 2 hours.
Thank you !

You probably have to add the Spring snapshot repository to your pom.xml
<repositories>
<repository>
<id>repository.spring.snapshot</id>
<name>Spring Snapshot Repository</name>
<url>http://repo.spring.io/snapshot</url>
</repository>
</repositories>

Thanks for your replies but I'm feeling like a fool. In my company we work with a nexus where all the repos are deployed, so I had to add the informations about the repos in my nexus too.
Sorry for the inconvenience.

Related

How can I use Maven locations in Eclipse Target files that come from custom repositories

I am trying to use a maven location in a Tycho build, that comes from a different repository than maven central. Below is the part of the definition that provides this on PDE. Tycho does not seem to honour the repository declaration and fails on resolution. Assuming I am observing this correctly, I have the following
Question: How can I hint Tycho to understand that these maven coordinates should be obtained from the associated repositories?
If this is not a current feature, but there is an issue, please comment as well, so this can be found and tracked.
<location includeDependencyScope="compile" includeSource="true" missingManifest="generate" type="Maven">
<dependencies>
<dependency>
<groupId>com.github.amlorg</groupId>
<artifactId>amf-api-contract_2.12</artifactId>
<version>5.0.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.raml</groupId>
<artifactId>webapi-parser</artifactId>
<version>0.5.0</version>
<type>jar</type>
</dependency>
</dependencies>
<repositories>
<repository>
<id>mulesoft.releases</id>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/releases</url>
</repository>
<repository>
<id>mulesoft.public</id>
<url>https://repository.mulesoft.org/nexus/content/repositories/public/</url>
</repository>
</repositories>
</location>

Missing artifact de.jetwick:snacktory:jar:1.1-SNAPSHOT

I am trying to use snacktory thus I have the following in my pom.xml file:
<!-- ... -->
<dependencies>
<!-- ... -->
<dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.1-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snacktory_snapshots</id>
<url>https://github.com/karussell/mvnrepo/tree/master/snapshots/de/jetwick/snacktory/</url>
</repository>
</repositories>
</project>
However, I am getting
Missing artifact de.jetwick:snacktory:jar:1.1-SNAPSHOT
in Eclipse from the Maven build. I've tried, as in another question stated 1.2 and 1.3 as well but the result is the same.
Why am I not able to get this dependency?
If you look on their github repository (used as a maven repository), they provide the repository url to use : https://github.com/karussell/mvnrepo
Change the repository to:
<repository>
<id>snacktory_snapshots</id>
<url>https://github.com/karussell/mvnrepo/raw/master/snapshots</url>
</repository>
Use the release instead
I would advise you to use their release version instead:
<repository>
<id>snacktory_releases</id>
<url>https://github.com/karussell/mvnrepo/raw/master/releases</url>
</repository>
with the dependency:
<dependency>
<groupId>de.jetwick</groupId>
<artifactId>snacktory</artifactId>
<version>1.2</version>
</dependency>

Apache Commons VFS Maven Repository?

Any idea on which Maven repository to use in order to use Apache commons VFS libraries?
Thanks.
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.1-SNAPSHOT</version>
</dependency>
** Edit ** : the following repository works fine:
<repository>
<id>commons-vfs</id>
<name>Apache Commons VFS Repository Group</name>
<url>https://repository.apache.org/content/groups/snapshots/</url>
<layout>default</layout>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Please check that your artifactId is correct: http://mvnrepository.com/artifact/org.apache.commons/commons-vfs2/2.0
It should be:
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.0</version>
</dependency>
If you need version 2.1-SNAPSHOT you can use this Maven repository:
http://repository.jboss.org/
Version 2.1-SNAPSHOT implements some new features.

Restlet Maven Dependencies

Does anyone know what the RESTLET maven dependencies are?
None of the entries on the site work. I had to end up installing jars to make it work.
add this repo:
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>https://maven.restlet.talend.com/</url>
</repository>
</repositories>
Then include dependencies with your version:
<dependency>
<groupId>org.restlet.jee</groupId>
<artifactId>org.restlet</artifactId>
<version>${restlet.version}</version>
</dependency>
Use:
<properties>
<restlet.version>2.0.14</restlet.version>
</properties>
to define restlet version or just put whichever version you like. Hope it helps!
Sometimes, the maven dependencies are not downloaded automatically. You have to force it using mvn compile.
Here is a reference to sample restful service that uses following dependencies :
http://topjavatutorial.com/frameworks/spring/spring-rest/standalone-restful-service-using-restlet-framework/
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet</artifactId>
<version>2.1-RC2</version>
</dependency>
<dependency>
<groupId>org.restlet.jse</groupId>
<artifactId>org.restlet.ext.simple</artifactId>
<version>2.1-RC2</version>
</dependency>
Use the given mirrors in this
These mirrors are up to date so no need to worry about the versions and so on..
Edit settings.xml in maven installation location to add mirrors.
<settings>
<mirrors>
<mirror>
<id>mygrid-restlet</id>
<url>http://www.mygrid.org.uk/maven/restlet/maven.restlet.org</url>
<mirrorOf>maven-restlet</mirrorOf>
</mirror>
</mirrors>
</settings>
assuming that the POMs using the original repository uses:
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.org</url>
</repository>
<!-- https://mvnrepository.com/artifact/com.softlayer.api/softlayer-api-client -->
<dependency>
<groupId>com.softlayer.api</groupId>
<artifactId>softlayer-api-client</artifactId>
<version>0.1.0</version>
</dependency>

WSO2 BAM 2.0 libraries in Maven

I'm trying to replicate the KPIAgent example in the WSO2 BAM ALPHA2 release but using maven to get the libraries required for the project to run.
So I've defined the following dependencies:
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.bam.agent</artifactId>
<version>3.2.4</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.bam.data.publisher.util</artifactId>
<version>3.2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.bam.service</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>com.google.common.wso2</groupId>
<artifactId>google-collect</artifactId>
<version>1.0.0.wso2v2</version>
</dependency>
<dependency>
<groupId>libthrift.wso2</groupId>
<artifactId>libthrift</artifactId>
<version>0.5.wso2v1</version>
</dependency>
<dependency>
<groupId>commons-pool.wso2</groupId>
<artifactId>commons-pool</artifactId>
<version>1.5.0.wso2v1</version>
</dependency>
Along with them I've defined the WSO2 repository this way:
<repository>
<id>wso2-maven2-repository</id>
<name>WSO2 Maven2 Repository</name>
<url>http://dist.wso2.org/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
</repository>
The problem I have is that the remote pom file for http://dist.wso2.org/maven2/org/wso2/carbon/org.wso2.carbon.bam.agent/3.2.4/org.wso2.carbon.bam.agent-3.2.4.pom refers to
<parent>
<groupId>org.wso2.carbon</groupId>
<artifactId>data-agents</artifactId>
<version>3.2.4</version>
</parent>
Which doesn't exist.
I assume this happens due to a rearrangement of the component's sources which is not fully reflected in the repository just yet; thus causing this inconsistency.
Question is then, which set of dependencies should I use to use EventReceiver in order to publish my own Events?
Thanks in advance for your support.
Seems it is not in the repo as you have mentioned for some reason. Can you try installing the pom given below to your local repository and see whether it works.
http://pastebin.com/AcmR1xmW

Resources