Maven not building sqljdbc intelliJ - java

I am trying to build my maven project in IntelliJ.
I added the dependency in the pom file as shown.
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/sqljdbc4-2.0.jar</systemPath>
</dependency>
I also have the sqljdbc4-2.0.jar in the /lib folder.
I am able to successfully clean the project and package it. However, when i run the jar on my linux machine it gives me following exception:
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver
Please help. Struggling with this for quite some time. Thanks.

Related

How to install Processing using Maven?

I want to install processing via maven in intellij. I have added the following to my POM file:
<dependencies>
<dependency>
<groupId>org.processing</groupId>
<artifactId>processing-complete</artifactId>
<version>3.3.7</version>
</dependency>
</dependencies>
When trying to build, it says Cannot resolve org.processing:processing-complete:3.3.7
However, the file is definitely there in the repository: https://repo.maven.apache.org/maven2/org/processing/processing-complete/3.3.7/
anyone has any idea how to successfully build the complete processing library using maven or gradle?
PS. I am a huge noob with maven, so it might be something simple, but I've tried a bunch of stuff and nothing seems to work.
Edited to have the maven log: from mvn -X dependency:sources
https://gist.github.com/jurrejelle/91b59785c7a3184e776f0a1797c416f4
Your dependency section is asking for a jar file (the default type), which isn't present in the artifact. If you look on Maven Central, you can see that the given dependency tag includes a pom type tag:
<dependency>
<groupId>org.processing</groupId>
<artifactId>processing-complete</artifactId>
<version>3.3.7</version>
<type>pom</type>
</dependency>
I was able to reproduce your error using the XML you posted, and adding <type>pom</type> in my pom.xml cleared up the error for me.

How to resolve Microsoft Azure dependencies on Eclipse

I'm trying to follow "How to run a compute-intensive task in Java" tutorial.
However, I'm stuck on the following step:
https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-java-run-compute-intensive-task/#how-to-create-a-java-application-that-performs-a-compute-intensive-task
Eclipse shows an error saying that these dependencies can't be resolved:
import com.microsoft.windowsazure.services.core.Configuration;
import com.microsoft.windowsazure.services.core.ServiceException;
import com.microsoft.windowsazure.services.serviceBus.*;
import com.microsoft.windowsazure.services.serviceBus.models.*;`
I'm using Eclipse and I've downloaded the Azure toolkit for Eclipse.
Here's how my Eclipse project looks like:
The code is simply a copy-paste of TSPSolver.java.
Per my experience, the issue was caused by missing some dependent libraries that you can try to add them via configure the Java Build Path or configure the pom.xml file in the Maven project to resolve it.
For the first way, adding the dependent libraries via configure the Build Path. You can download these libraries and their dependencies from the link.
Right click on the project name, then select Build Path and click Configure Build Path.
Add these jar files via click Add External Class Folder
For the second way, adding the maven dependencies in the pom.xml file.
Convert the current normal Eclipse Project into a Maven project.
Open the pom.xml file in the project and add the below content from link1 & link2.
<dependencies>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-core</artifactId>
<version>0.9.7</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>0.9.7</version>
</dependency>
</dependencies>
For those looking now, latest version are as follows:
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-storage</artifactId>
<version>8.0.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-servicebus</artifactId>
<version>3.6.7</version>
</dependency>

Not able to run my eclipse maven project- eclipse not recognising mySql-connector-java

I am nor able to run my eclipse maven project. I keep getting the following error in the problems tab
Archive for required library: 'C:/Users/user/.m2/repository/mysql/mysql-connector-java/5.1.38/mysql-connector-java-5.1.38.jar' in project 'Inspirations' cannot be read or is not a valid ZIP file
In my pom.xml file I have defined the dependency as
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.38</version>
</dependency>
You can try delete mysql folder in your repository and go to eclipse -> Maven --> Update Project.
If not working, i thinh u can try another version.

Errors in maven Struts2 project

Eclipse displays errors in a Maven project. How can I fix it?
It seems that project works as it should.
Maven dependencies:
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-plugin</artifactId>
<version>3.7.1</version>
</dependency>
<dependency>
<groupId>com.jgeppert.struts2.jquery</groupId>
<artifactId>struts2-jquery-grid-plugin</artifactId>
<version>3.7.1</version>
</dependency>
The jars downloaded from these artifacts should be on the classpath of the project Build Path. Subfolders aren't on the classpath, so eclipse can't find TLDs there. Configure the build path by adding project or external jars to the build classpath. You can see How to generate eclipse configuration from maven project.
Try /struts2-jquery-tags instead of /struts-jquery-tags. Missed the '2' in struts.

Why the Groovy jar be referenced in Eclipse?

My project doesn't reference the groovy-all-1.8.3.jar, and the jar is not in the maven dependency tree and .classpath file.
When the project is imported to Eclipse, it notices that the groovy-all-1.8.3.jar is referenced.
How can the jar be referenced?
In the Maven Project put the following dependency in pom.xml
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>1.8.3</version>
</dependency>
And run mvn clean install , It solves your problem.

Categories

Resources