Can not import WebSocketStompClient class - STOMP + SockJS java Client - java

I am trying to create Java WebSocket client (STOMP + sockJs) following
this sample. But I am not able to find maven/gradle dependency for
org.springframework.web.socket.messaging.WebSocketStompClient
Even maven search did not give any results.
After some searching I found that this is a part of
4.2.0.BUILD-SNAPSHOT
and the javadoc for this class is here.
I have tried to import
org.springframework:spring-messaging:4.2.0.BUILD-SNAPSHOT
and
org.springframework:spring-web:4.2.0.BUILD-SNAPSHOT
But I was not able to import this class.
I want to know if it is possible to import the 4.2.0.BUILd-SNAPSHOT from gradle.
If it is possible how do I know which spring module (like spring-web / spring-messaging) from the javadoc?
EDIT : am I correct in assuming that it is part of 4.2.0 from the Javadoc URL?

You need to add the snapshot repository if you want to use them:
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.2.0.BUILD-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>http://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Please add this in your POM.xml :Please match the version with your Spring-framework version.
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId>
<version>4.0.0.RELEASE</version>
</dependency>
Then do a mvn clean && mvn install from console if you are on linux or maven install from Eclipse.

I was not able to import 4.2.0.BUILD-SNAPSHOT but I was able to import 4.2.0.RC1 release.
I checked the pom.xml of the sample and just imported the same version as it is.

Related

How to add android library Volley to a plain maven project

I would like to try the Volley library on my plain maven project with java 8 or 11. I am however not able to add this dependency properly. It is an android library by google. So I am not using android studio, but just Intellij IDEA with maven.
When I add it as:
<dependency>
<groupId>com.android.volley</groupId>
<artifactId>volley</artifactId>
<version>1.1.1</version>
</dependency>
I am getting: Cannot resolve com.android.volley:volley:1.1.1
When I include the type pom as instructed here: https://bintray.com/android/android-utils/com.android.volley.volley/1.1.1#
<dependency>
<groupId>com.android.volley</groupId>
<artifactId>volley</artifactId>
<version>1.1.1</version>
<type>pom</type>
</dependency>
I am not getting errors, but I cannot use the java class from my java source.
I also included the following plugin
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<version>4.6.0</version>
<extensions>true</extensions>
</plugin>
I know that this library is not available at maven central, so I added jcenter as additional repository:
<repository>
<id>bintray-central</id>
<name>Bintray Central Repository</name>
<url>https://jcenter.bintray.com</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
Any idea if it would be possible what I am trying to do?

MAVEN - add 3rd party software

Is there a way to set maven up to make it possible to use 3rd party software?
I am trying to add the dependecy Spigot (minecraft server jar) to my project, but I want to work on it with some friends, and I want it too automatically update, if one of us decides to change the pom.xml.
So what I have next is:
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
and
<dependencies>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.9-SNAPSHOT</version>
</dependency>
</dependencies>
but now I have to do something with maven, but I have no clue how?
Isn't there a way so it will automatically install it from that website I have put at the repository thing?
I liked the idea of maven, but if this is not possible it is kinda useless for what I want XD
I hope someone knows how it will automatically update it, because for all I have searched I got nothing :/
Try the below option, that might help you to update the snapshot on daily basis. Not sure what other options are, you might want to check on that sometime.
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
</repositories>

Jasper server maven repository url?

I am trying to get below dependency from jasper server.
<dependency>
<groupId>com.jaspersoft.jasperserver</groupId>
<artifactId>jasperserver-api</artifactId>
<version>6.0.1</version>
</dependency>
But i am getting below error
Missing artifact com.jaspersoft.jasperserver:jasperserver-api:jar:6.0.1
Here is my POM
<project ...>
<modelVersion>4.0.0</modelVersion>
....
<name>jasperProject</name>
<url>http://www.jaspersoft.com</url>
<dependencies>
<dependency>
<groupId>com.jaspersoft.jasperserver</groupId>
<artifactId>jasperserver-api</artifactId>
<version>6.0.1</version>
</dependency>
</dependencies>
</project>
With some simple googling you can get to this other answer on SO, where you can find a reference to this, which in term states you can add it like this:
<repository>
<id>JasperForge Maven Repository</id>
<!-- note: you need a <server> definition at bottom of file this file -->
<url>http://anonsvn:anonsvn#jasperforge.org/svn/repos/maven2</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>true</enabled>
</releases>
</repository>
It also seems there's http://www.jasperforge.org/maven2/, which appears to be a non-browseable repository.
Another option is to put all required jars to a local maven repository. I know this is not the best solution, but it works, when you have no idea regarding correct Jasper public repository

Maven. Adding maven repository for activiti

The problem is that I'm trying to make somelike the helloworld with Activiti but I have an error here
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>5.1</version>
</dependency>
the error is the following: 'Description Resource Path Location Type
Missing artifact org.activiti:activiti-engine:jar:5.1 pom.xml /IllMakeThisTestApp line 29 Maven Dependency Problem
Trying to resolve it I've found the following recomendation here: "The download contains all the libraries that you need to work with Activiti. But for developers that prefer to use Maven, add the following reposiory"
<repositories>
<repository>
<id>Alfresco Maven Repository</id>
<url>https://maven.alfresco.com/nexus/content/groups/public/</url>
</repository>
</repositories>
But where shall I place it? To the file called settings.ini placed in M2_HOME/conf? This file is full of comments with no any sign of repositories. So I have no idea how to do this and ask you for help
You should place that in your pom.xml - see the Maven reference on the subject:
<project xmlns="http://maven.apache.org/POM/4.0.0"...
...
<repositories>
<repository>
<id>Alfresco Maven Repository</id>
...
You will only need to tinker with the Maven config if you need to setup a mirror for the repo, eg. in case your organisation has it's own Nexus/other repo mirroring the outside "world".
Cheers,
You can place right under project. For example
<project>
....
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>
In default maven will try to download all the artifacts from maven central. You can add any number of added repositories using tag given above. Alfresco is yet another open maven repository.

Building a project with Maven in Codenvy

I am new to Maven and Codenvy. Trying to build a simple Jar project there. The build fails everytime, although I seem to include all necessary dependencies in pom.xml file.
Here's the project: https://codenvy.com/factory?v=1.0&pname=simplejar&wname=ivantsoft&vcs=git&vcsurl=http%3A%2F%2Fcodenvy.com%2Fgit%2F16%2F81%2F89%2Fworkspacepyk15s4hwbfabmg6%2Fsimplejar&idcommit=2af3588e343317907905b306d7faa3db5674d068&action=openproject&ptype=Jar
In my pom.xml I have:
<repositories>
<repository>
<id>biojava-maven-repo</id>
<name>BioJava repository</name>
<url>http://www.biojava.org/download/maven/</url>
</repository>
</repositories>
...
<dependency>
<groupId>org.biojava</groupId>
<artifactId>biojava3-core</artifactId>
<version>3.0.6</version>
<scope>test</scope>
</dependency>
...
And in my java file I have:
...
import org.biojava3.core.sequence;
...
What am I doing wrong here?
Link is outdated.
INVALID FACTORY URL
The question is to be closed with what chrylis said:
Part of the problem is that your import is wrong; org.biojava3.core.sequence is a package, and you need to import either a specific class from it or org.biojava3.core.sequence.*.

Categories

Resources