-1

I am trying to run my test suite using azure pipeline line using maven in my pom xml file i m using sqljdbc4 dependency which is not available on maven central so I am getting below error

Failed to execute goal on project SmartAdsEarlyWarning: Could not resolve dependencies for project SmartAdsEarlyWarning:SmartAdsEarlyWarning:jar:0.0.1-SNAPSHOT: Could not find artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

Please help me to resolve this issue

Vince Bowdren
  • 7,115
  • 3
  • 27
  • 50
  • 1
    Does this answer your question? [Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0](https://stackoverflow.com/questions/19537396/missing-artifact-com-microsoft-sqlserversqljdbc4jar4-0) – DeepDave-MT Dec 23 '21 at 12:02

1 Answers1

0

Thank you nirmal. Posting your suggestion as an answer to help other community members.

To resolve the Could not find artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0 error, add the JDBC driver to your Maven project by adding the following code to your POM file to include it as a dependency in your project:

<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>6.1.0.jre8</version>
</dependency>

You can refer to Missing artifact com.microsoft.sqlserver:sqljdbc4:jar:4.0 and Open sourcing the Microsoft JDBC Driver and Maven support

DeepDave-MT
  • 1,861
  • 1
  • 5
  • 18
  • I have updated dependency its working perfectly fine on my local machine but when running using same code using azure pipeline its giving me the below error Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project : Compilation failure [ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? – Jayshree Sonawane Dec 29 '21 at 08:33