OK I am trying to use http://jongo.org, in a project I have run mvn install and dropped the jar it returns into my project but when I try and use Jongo I get Caused by: java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/Module Does Jongo not package these directly?
My question is do I need to then manually include the other jars it depends on aswell into my project root?
Yes, you need add this dependency manually in maven:
Jongo relies upon Jackson 2.4.1, Bson4Jackson 2.4.0 and Mongo Java Driver 2.11+. Its Maven dependency, an OSGI compliant jar, comes with
the first two, you have to provide a dependency to the driver.
Jongo is deployed into OSS Sonatype (Maven repository hosting service
for open source projects). Add the following dependency to your
pom.xml
<dependency>
<groupId>org.jongo</groupId>
<artifactId>jongo</artifactId>
<version>1.2</version> </dependency>
</dependency>
Related
The error I am getting is PY4JAVAERROR :
an error occurred while calling o313.load: Java.lang.classnotfoundexception: com.mysql.jdbc.Driver
has anyone encountered this before?
Place mysql-connector jar in your classpath.
That occurs when you don't have a MySQL connector in your classpath. If you are using a maven project you can try adding the dependency to your pom.xml
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
If you are not using a dependency management tool like Maven or Gradle you can download the jar online and then add it to your classpath. Here is the link.
https://dev.mysql.com/downloads/connector/j/
Remember to do a bit of research for the correct versions before you download.
Either of the two options will definitely work.
It seems the mysql connectivity library is not included in the project. Solve the problem following one of the proposed solutions:
MAVEN PROJECTS SOLUTION
Add the mysql-connector dependency to the pom.xml project file:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version> // your desired version
</dependency>
Here you are all the versions: https://mvnrepository.com/artifact/mysql/mysql-connector-java
ALL PROJECTS SOLUTION
Add the jar library manually to the project.
Right Click the project -- > build path -- > configure build path
In Libraries Tab press Add External Jar and Select your jar.
You can find zip for mysql-connector here
Explanation:
When building the project, java throws you an exception because a file (the com.mysql.jdbc.Driver class) from the mysql connectivity library is not found. The solution is adding the library to the project, and java will find the com.mysql.jdbc.Driver
Is there a way I can pull some specific jar directly as a dependency defined in maven?
I have a maven project which has some internal and external dependencies. I am hosting this project on a maven registry so I can consume it in other projects. I am creating a jar and as well as creating "jar-with-dependencies" using the maven-assembly plugin in my project. Then I am hosting this on the maven repository where it has the pom, jar, and jar-with-dependencies all hosted.
In the other maven project, I want to pull the above maven project as a dependency. When I am trying to directly define it as a dependency as mentioned below, it is trying to pull the dependencies of the original project too in which some of the internal ones it could not find. Is there a way so that it can pull the hosted jar-with-dependencies directly or some other solution to this problem.
P.S. I do not want to host all those internal dependencies directly on the maven registry.
Update: I tried adding dependency with the help of the maven classifier to point to jar-with-dependencies. But it still does not resolve the issue
<dependencies>
<dependency>
<groupId>com.myproject.project</groupId>
<artifactId>project-java-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
<classifier>jar-with-dependencies</classifier>
</dependency>
</dependencies>
I need to add cxf-core, cxf-frontend ext. file in the project. I am trying to add these using maven dependency in pom.xml but it didn't work and version number is getting be red when it is added.
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-core</artifactId>
<version>2.6.2</version>
</dependency>
org.apache.cxf:cxf-rt-core:2.6.2 not found.
I also tried to add using external .jar libraries. The IDE is Intellij IDEA.
2.6.2 worked for me, I used Eclipse to create a new maven project and pasted in your dependency. It worked, fetched the required jars and give me this dependency hierarchy.
I am very new to eclipse and maven repository. I got a project to config the errors of POM.xml. I fixed many of it, but I am unable to fix some. Following are that errors.
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-jdbc</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jgodies.form</groupId>
<artifactId>forms</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
<scope>runtime</scope>
In Maven repository folder there are not all the files which are in the other folders, so I put them manually, but still no results.
All the Oracle realted jars are not the part of the Central Maven Repository.
May be the case with the other oracle related jars. That is the reason why its not able to resolve the dependencies.
You should create a separate custom repository on your company server where you can put all these jar and configure that in POM.xml. Maven will first check the Central reposiroty and if it does not find the files will later check the custom repositry.
For locally running Maven you will have to do a MVN Install manually. you should never manuallly copy any jars to the m2 repositiry
Getting the JDBC drivers is a bit tricky. Please check this article for directions.
Due to Oracle license restriction, there is NO public Maven repository provides Oracle JDBC driver. To use Oracle jdbc drive with Maven, you have to install it manually into your Maven local repository.
I'm trying to configure the library v7 support in my project so that it uses ActionBarActivity, thus keeping compliant with some of the Android 2.X versions.
First, follow the documentation from Google and imported the project android-support-v7-appcompat as a library in accordance with Section Adding libraries with resources on Support Library Setup. But this way my Maven Build failed because it could not find the dependence of the library in question.
Now, I decided to seek a cleaner solution, keeping my dependences managed by Maven. To do this follow the instructions of the answer, but using version 19.0.1. This made my Maven Build it were executed successfully, but my project is not compiling in my workspace, the following error occurs on first line of my POM:
dependency=[com.android.support:appcompat-v7:apklib:19.0.1:compile]not found in workspace
My dependencies are as follows:
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>apklib</type>
</dependency>
<dependency>
<groupId>com.android.support</groupId>
<artifactId>appcompat-v7</artifactId>
<version>${com.android.support-version}</version>
<type>jar</type>
</dependency>
The project in question is on GitHub, if they want to view it: https://github.com/veniltonjr/msplearning
Thank you in advance!
First, there is no apklib for com.android.support:appcompat-v7. It only ships as an aar.
Second, that library is not available in maven-central, it ships with the Android SDK.
You need to manually deploy it to your local maven repository.
Though you can use maven-sdk-deployer to construct and deploy the apk to your local folder. But you github project is failing due to missing internal dependencies.
com.msplearning.android-support-v4:jar:19.1.0, com.msplearning:android-support-v7-appcompat:jar:19.1.0