0

I got a missing artifact error when adding a dependency. The error I got is this:

Missing artifact com.azure:azure-security-keyvault-secrets:jar:4.1.0

This is my pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.companyname.encryptionkeyclient</groupId>
  <artifactId>encryptionkeyclient</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>encryptionkeyclient</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.azure</groupId>
      <artifactId>azure-security-keyvault-secrets</artifactId>
      <version>4.1.0</version>
    </dependency>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-identity</artifactId>
            <version>1.0.1</version>
    </dependency>
    <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-core</artifactId>
            <version>1.1.0</version>
        </dependency>
  </dependencies>
</project>

I suppose the reason is that the package is not available yet on maven, however, the package is available already https://mvnrepository.com/artifact/com.azure/azure-security-keyvault-secrets/4.1.0 .

So I don't know what I am missing here, can anyone help? Thanks.

Fred
  • 59
  • 1
  • 8
  • only azure security is missing?? – Vishwa Ratna Jan 14 '20 at 03:44
  • Yes, I saw red line only under the dependency of azure security – Fred Jan 14 '20 at 05:33
  • 1
    Why not import it manually ?? Have you tried puttingburl of central repo – Vishwa Ratna Jan 14 '20 at 06:15
  • Hi Fred, could you please show the "" in the "settings.xml" file of your maven ? – Hury Shen Jan 14 '20 at 06:46
  • Tried to import it manually, I downloaded the .jar file then add the path in classpath and it worked, thanks. But I do not understand what you mean by "puttingburl of central repo". – Fred Jan 14 '20 at 07:01
  • Hi, Shen. I checked my project and could only find "pom.xml" file, I used the cmd suggested on this link to create the maven project https://stackoverflow.com/questions/46671308/how-to-create-a-java-maven-project-that-works-in-visual-studio-code – Fred Jan 14 '20 at 07:11
  • The settings.xml exists in the directory you installed your maven, for example: my settings.xml exists in the directory of "E:\maven\apache-maven-3.6.3-bin\apache-maven-3.6.3\conf". The "" in settings.xml decides where your project goes to download these jar packages. – Hury Shen Jan 14 '20 at 07:43
  • Thanks for your help, my is like this ``` mirrorId repositoryId Human Readable Name for this Mirror. http://my.repository.com/repo/path ``` – Fred Jan 14 '20 at 08:18
  • 1
    It seems you haven't modified the and the project will download the jars from the default address. I test it with the same in my side and download the "azure-security-keyvault-secrets" jar successfully. If you still want to download it by maven but not import it manually, you can try to remove all of the files/folders under the "repository" folder and modify anywhere of your pom.xml and click save. The project will download all of the jars again, wait a few minutes and check if it can download "azure-security-keyvault-secrets" jar. – Hury Shen Jan 14 '20 at 09:03
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/205919/discussion-between-hury-shen-and-fred). – Hury Shen Jan 14 '20 at 09:03

1 Answers1

1

The mirror address you provided has "azure-security-keyvault-secrets" jar and in my project it download this jar successfully(with the same mirror address).

You can remove all of the packages under the "repository" folder and save the pom.xml, the project will download all of the packages again. The issue will go away.

Hury Shen
  • 14,948
  • 1
  • 9
  • 18