简体   繁体   中英

Artifactory maven-metadata.xml and bundles with Java API

I'm attempting to upload & deploy a jar that we receive from a vendor into Artifactory using the Java API (artifactory-java-client-services v1.1.0). My uploads don't generate maven-metadata.xml and I can't find an option to auto-generate a pom.xml. I also can't find how I would indicate that I'm uploading a bundle rather than a single file.

Currently I'm using a simple snippet of code to upload a test jar and a simple pom:

Path jarPath = Paths.get(tmpDir.toString(), "test1.jar");

RepositoryHandle repositoryHandle = 
    ArtifactoryClient.create(url, username, password).repository(repositoryName);

UploadableArtifact jarArtifact = 
    repositoryHandle.upload("com/company/play/1.0.0/test.jar", jarPath.toFile());

File responseFile = jarArtifact.upload();

I use the same process to upload the pom.xml.

So:

  1. Is there a way to request the maven-metadata.xml be recalculated as in the REST call shown here ?

  2. Is there any way to indicate that Artifactory needs to auto-generate a simple pom.xml on upload with the Java API?

  3. Is there any way to indicate that the upload is a bundle?

Thanks in advance!

  1. maven-metadata.xml is generated automatically upon deployment. Note that it might take some time – indexing and metadata generation is an async task.
  2. pom.xml generation is not triggered from REST API or Java API ATM. Didn't you mention that you upload the pom.xml?
  3. Not sure what you mean by "bundle". OSGi bundle? Or an archive that you expect Artifactory to unzip and deploy? In case of OSGi bundle there is nothing needed to be done, in case of the archive, again, it's not supported ATM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM