I added the below dependencies in my project POM file and the SerialAddress class is no where to be found from the downloaded mina-core.2.0.2.jar.
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-core</artifactId>
<version>2.0.2</version>
</dependency>
the package org.apache.mina.transport.serial doesnt even exist. Please advice me on the correct Dependency.
It looks like this class is not part of mina-core. Some exploration lead to the existence of Apache Mina Serial Communication Support.
So I guess you would want to add the dependency for mina-transport-serial.
<dependency>
<groupId>org.apache.mina</groupId>
<artifactId>mina-transport-serial</artifactId>
<version>2.0.2</version>
</dependency>
Related
How can I in an very easy way retrieve all direct and transitive dependencies for a given Maven POM in my own Java program?
I aware of the existing questions on Stackoverflow, especially the one using Ivy to resolve the dependencies. I am looking for a solution using Maven, which is able also to resolve the transitive dependencies.
If you need this during a Maven build, you can easily access it in a Maven plugin using project.getDependencies().
If you have a standalone Java program, you can use Maven resolver or the older Aether libraries to do the resolution.
I was now able to solve the problem by using JBoss Shrinkwrap.
Here is a code snipped similar to the one I now use in my tools:
MavenStrategyStage resolve =
Maven.configureResolver()
// do not consult Maven Central or any other repository
.workOffline()
// import the configuration of the given settings.xml
.fromFile(homeDir + "/jqa-release-environment/maven-settings.xml")
// load the POM you would like to analyse
.loadPomFromFile(pomFile)
.importCompileAndRuntimeDependencies()
.importRuntimeAndTestDependencies()
.resolve();
MavenWorkingSession mavenWorkingSession =
((MavenWorkingSessionContainer) resolve).getMavenWorkingSession();
List<MavenDependency> dependencies = new ArrayList<>();
dependencies.addAll(mavenWorkingSession.getDependenciesForResolution());
dependencies.addAll(mavenWorkingSession.getDependencyManagement());
To be able to use Shrinkwrap, I added the following dependencies to my POM.
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-depchain</artifactId>
<type>pom</type>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-impl-maven</artifactId>
<version>3.1.4</version>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap.resolver</groupId>
<artifactId>shrinkwrap-resolver-api-maven</artifactId>
<version>3.1.4</version>
</dependency>
I want to know what is the best aproach in a Maven conflict situation like this one
I have this library
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
<version>3.3.3</version>
</dependency>
Which has a dependency with
netty-transport 4.15.final
And I have this other dependency
<dependency>
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-extras</artifactId>
<version>3.1.0</version>
</dependency>
Which contains the dependency
netty-transport 4.0.37
It´s seems like the cassandra version with the 4.15.final does not work
So normally in this cases what you have to do, if I exclude the netty
from the vertx dependency it´s most probably it wont work with the version of Cassandra, and the other way around.
Are those library with those versions condemned to do not work together?
Regards.
What is the maven dependency i should add for
import javax.mail.*;
import javax.mail.internet.*;
Adding the maven dependency from here http://mvnrepository.com/artifact/javax.mail/mail/1.5.0-b01 makes some of the jersey dependencies unable to retrieve error. What do you think is going wrong?
The version 1.6.3 had been the last version of JavaMail; since 2019-07-03, the new name for it is "Jakarta Mail".
Together with the name change also the Maven coordinates got different:
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>jakarta.mail</artifactId>
<version>…</version>
</dependency>
The project homepage can be found here: https://eclipse-ee4j.github.io/mail/
We are using following dependency:
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
</dependency>
This class is deprecated:
http://www.bouncycastle.org/docs/docs1.5on/org/bouncycastle/jce/PKCS10CertificationRequest.html
but when I download this far form the maven repository
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.50</version>
</dependency>
There is no org.bouncycastle.pkcs there.
Where can I get the latest jar (and the sources)?
1.50 or sometimes 150 is the latest release.
The deprecation notes:
Deprecated.
use classes in org.bouncycastle.pkcs.
If you take a close look you will see that this class was moved to a different package: PKCS10CertificationRequest
You will need the following dependency to access that class:
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.50</version>
</dependency>
I use the javax:javaee-api-6.0.jar maven artifact.
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
I would like to download its source code with the dependency:sources mvn goal.
I was looking for the sources in the official maven repositories, but I still can't find it.
Could you give me a bit of advice on how can I achieve my object?
Thank you.
Mich is correct.
The purpose of the javaee-api module is to satisfy compile-time dependencies (That is why the Maven scope is set to provided). The module contains interface declarations (or contract) which must be satisfied by the J2EE container you plan to use.
If you really need/want to see the source code, I'd suggest taking a look at one of the open source J2EE containers.
see if these are any good and if they work for you http://repo1.maven.org/maven2/org/apache/openejb/javaee-api/
Try this: (it has sources attached)
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>3.0.3.Final</version>
<scope>provided</scope>
<type>pom</type>
</dependency>
It pulls in a huge number of dependencies, but as they are all provided you do effectively not alter your artifact.