JDBC Drill dependency issues - java

Creating a new project with just the drill jdbc dependency in POM, gives a error saying Could not transfer artifact net.hydromatic:optiq-avatica:pom:0.9-drill-r20 from/to
Should i change anything in settings for this to compile i
I created a new project and adding JDBC dependency in POM.
I tried to compile and i get this error.
<dependencies>
<dependency>
<groupId>org.apache.drill.exec</groupId>
<artifactId>drill-jdbc</artifactId>
<version>1.4.0</version>
</dependency>
</dependencies>

It seems like network issue bacause I did not find any issue using this jar.
As a workaround, you can add drill-jdbc-all-1.4.0.jar located at <drill_directory>/jars/jdbc-driver to your project. It includes all the dependent jars.

Related

How to download files from Gitlab account using java

I am writing one utility job in java to download JSON files from particular URL of Gitlab account and further process them according to requirement. I tried to do same using java-gitlab-api dependency. However, even after including below maven dependency,
I get error as :
Missing artifact org.gitlab:java-gitlab-api:jar:1.1.8-
The import org.gitlab cannot be resolved.
Maven dependency I am using is :
<dependency>
<groupId>org.gitlab</groupId>
<artifactId>java-gitlab-api</artifactId>
<version>1.1.8-SNAPSHOT</version>
</dependency>
I tried to update, clean maven project but nothing worked. Anyone has an idea of how can I rectify issues and download files from gitlab account.
Use appropriate maven java-gitlab-api version(s). There is most recent version is available too.
https://mvnrepository.com/artifact/org.gitlab/java-gitlab-api/1.1.8
https://mvnrepository.com/artifact/org.gitlab/java-gitlab-api
<!-- https://mvnrepository.com/artifact/org.gitlab/java-gitlab-api -->
<dependency>
<groupId>org.gitlab</groupId>
<artifactId>java-gitlab-api</artifactId>
<version>1.1.8</version>
</dependency>

Why does Bintray Maven dependency snippet to copy include <type>pom</type>

I just spend all day trying to figure out why I was not able to include FontawesomeFX to my Maven project. It turns out that the dependency to copy includes an extra line that prevented my maven eclipse project from downloading the dependency.
So why is <type>pom</type> included?
So why is <type>pom</type> included?
Perhaps an unsatisfying answer, but this looks like a bug in Bintray. The artifact is not of type pom, and the suggested syntax appears to be wrong. (The suggested Ivy snippet makes the same mistake.)
JFrog do not appear to have a public issue tracker to report this without a support contract, but they suggest using the artifactory tag.
For comparison, the Central Repository shows the correct form:
<dependency>
<groupId>de.jensd</groupId>
<artifactId>fontawesomefx</artifactId>
<version>8.9</version>
</dependency>
but doesn't include versions since 8.10.

Maven - "Package from transitive module dependency referenced, declare a direct dependency to fix."

I never worked with Maven before, but after having a lot of problems with mockito dependencies in my Netbeans module, I decided to create a new one using Maven and move everything to this new project. After some time doing so, I managed to get the module running just ok.
The problem is that when I use some functionalities that require the Netbeans API I get an exception.
My guess is that the problem is in the dependencies declared in pom.xml. In some of the imports that I use in my application, I get the following message:
Package from transitive module dependency referenced, declare a
direct dependency to fix.
When I clean and build or run mvn clean install in the root directory I get this error:
Project uses classes from transitive module
org.netbeans.api:org-netbeans-modules-projectapi:jar:RELEASE73 which
will not be accessible at runtime.
To fix the problem, add this module as direct dependency. For OSGi bundles that are supposed to be wrapped in NetBeans modules, use the
useOSGiDependencies=false parameter
In the org.codehaus.mojo plugin declaration (which was the only one that had the useOSGiDependencies tag) I tried to change useOSGiDependencies=true to useOSGiDependencies=false but that didn't work. I also tried to change RELEASE73 to RELEASE82, since I am using Netbeans 8.2 but that didn't work as well. I also tried a bunch of other possible solutions that I found on google, but none seemed to work for me.
These are the Netbeans api dependencies that I have in my pom.xml file:
<dependencies>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-modules-project-libraries</artifactId>
<version>RELEASE73</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-netbeans-api-annotations-common</artifactId>
<version>RELEASE82</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-util</artifactId>
<version>RELEASE82</version>
</dependency>
<dependency>
<groupId>org.netbeans.api</groupId>
<artifactId>org-openide-awt</artifactId>
<version>RELEASE82</version>
</dependency>
<dependency>
<groupId>org.netbeans.modules</groupId>
<artifactId>org-netbeans-core</artifactId>
<version>RELEASE73</version>
</dependency>
<!-- ... -->
</dependencies>
I looked everywhere but couldn't find a straightforward answer on how to declare a direct dependency.
Can anyone explain to me what am I doing wrong here?
After digging a bit more, I found that I had to add all the dependencies manually. This answer helped me a lot.
I just lack experience with maven. Basically I googled org-netbeans-modules-projectapi:jar:RELEASE73 maven entered the first link and added the needed dependency to my project.

JDBC driver not found while debugging with Intellij IDEA

I have a Maven project that I can successfully compile and run through the command line. When I manually deploy a jar with dependencies in Tomee it works. However when I run the same project through IDEA I get
java.lang.ClassNotFoundException: org.firebirdsql.jdbc.FBDriver
I think this is because my jar with dependencies has the jdbc driver included, but the IDEA run configuration deploys my classes and not the jar, so the driver is missing.
It seems to me that I need to somehow configure IDEA additionally even though I already have this in my pom:
<dependencies>
<dependency>
<groupId>org.firebirdsql.jdbc</groupId>
<artifactId>jaybird-jdk18</artifactId>
<version>3.0.0</version>
<scope>runtime</scope>
</dependency>
...
</dependencies>
Am I indeed supposed to configure something else beside the pom?
I created the project without any IDE at first, because I was afraid it wouldn't work outside the IDE.

POM.xml error fix

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.

Categories